Book a free call

Prompt Engineering vs Fine-Tuning: Which to Use?

Prompt engineering is fast and cheap to change, while fine-tuning costs more up front but can beat prompts on narrow tasks. Learn when each approach wins.

Hertiv engineering teamReviewed by a senior engineer
7 min read
Prompt Engineering vs Fine-Tuning: Which to Use?
On this page

Short answer

Prompt engineering means writing better instructions for a model, while fine-tuning means training a model further on your own examples. Prompts are faster and cheaper to change; fine-tuning costs more up front but can beat prompts on narrow, repeated tasks.

What is prompt engineering?

Prompt engineering is the practice of writing clear instructions, examples and context so a language model gives a useful answer without any extra training. You change the words you send to the model, not the model itself.

A good prompt usually names the task, the format you want, the tone and any rules the answer must follow. It may also include a few examples of good answers, which helps the model copy the pattern. When the answer is wrong, you edit the prompt and try again, which takes minutes.

Prompt engineering works best when the task is broad, the examples change often, or you need an answer today. It is also the easiest route to start with, because it needs no training data and no extra infrastructure. Most teams should try prompts first and only move on when prompts stop being enough.

What is fine-tuning?

Fine-tuning is further training of a language model on your own examples, so it learns your style, your terms and your edge cases. You prepare a set of input and output pairs, run a training job and get a model that behaves the way your examples show.

The work sits in the data. A fine-tune needs hundreds or thousands of good examples, cleaned and labelled, plus a way to check whether the tuned model is actually better than the prompt version. Training itself is usually the smaller job; preparing and checking the data is where the time goes.

Fine-tuning fits tasks that repeat the same shape many times: support replies in a house style, classification into a fixed set of labels, or extraction from a standard document type. It is a poor fit for tasks that change weekly, because each change may need new examples and a new training run. For a deeper look at the service side, see LLM fine-tuning services.

How do they compare?

Prompt engineering and fine-tuning solve the same problem in different ways, and the trade-offs are clear once you compare cost, speed and control side by side.

FactorPrompt engineeringFine-tuning
Time to first resultHours to daysDays to weeks
Up-front costLowMedium to high
Data neededA few examplesHundreds of examples
Easy to changeEdit the promptRetrain with new data
Best forBroad, changing tasksNarrow, repeated tasks
RiskPrompt drift over timeOverfitting to old examples

The table shows why most teams start with prompts. They are cheap to test, easy to change and good enough for many tasks. Fine-tuning earns its keep when prompts keep failing on the same kind of input, or when the task is so repetitive that a small gain per answer adds up fast.

When does prompt engineering win?

Prompt engineering wins when the task changes often, the volume is low, or you need a result this week rather than this quarter. It also wins when the answer needs fresh context, such as a document the user just uploaded.

It is the right choice for drafting, summarising, brainstorming and answering open questions. In these cases the model needs guidance and examples, not new training. A well-written prompt with a few examples often matches a fine-tuned model on broad tasks, and it costs far less to adjust when requirements shift.

Prompts also make testing easier. You can compare two prompt versions side by side on the same inputs in an afternoon, which is hard to do with two tuned models. If you are still proving the idea, read how to build an AI proof of concept before investing in training data.

When does fine-tuning win?

Fine-tuning wins when the task is narrow, repeats at volume and has a clear right answer that prompts keep missing. It also wins when the output must follow a strict format or house style every single time.

Common cases include classifying tickets into a fixed set of categories, extracting the same fields from standard documents, and writing replies that must match a brand voice. In these cases the model learns the pattern from examples in a way that a prompt can only describe, and the gain shows up on every answer.

Fine-tuning can also cut running costs. A tuned small model can match a large prompted model on a narrow task while using fewer tokens per answer. That saving only matters at volume, so check the maths for your own traffic before deciding. The evaluation step matters here too; see how to test AI models for a practical way to compare versions.

Example (hypothetical): a support assistant

Example (hypothetical): a software company wants an assistant that drafts replies to support tickets. The team tests two routes on 200 real tickets. With prompt engineering, 148 of the 200 drafts are good enough to send after a quick edit. That is 74 out of 100, or 148 in 200.

With a fine-tuned model trained on 800 past replies, 172 of the 200 drafts are good enough to send. That is 86 out of 100, or 172 in 200. The fine-tuned route produces 24 more usable drafts per 200 tickets, which is 172 minus 148.

At 200 tickets a day, that is 24 fewer drafts a day that need heavy rewriting. The team still checks every draft before sending, but the fine-tuned model saves real reviewer time. The catch is the data work: cleaning 800 replies and running the training job took two weeks, while the prompt route took two days. The team picks fine-tuning because the task repeats daily and the gain is steady.

Can you use both together?

Yes, and many teams do. A common pattern is to fine-tune a model for the stable parts of a task, such as format and style, and use prompts for the parts that change, such as the current ticket or document.

Another pattern is to start with prompts, collect the answers that work well, and use those as training data for a later fine-tune. This gives you real examples from your own traffic instead of guessing what the model needs to learn.

Keep the two layers separate in your mind. The prompt handles the job at hand; the fine-tune handles the habits that never change. When a result is wrong, check the prompt first, because it is the cheaper thing to fix. Only retrain when the prompt cannot fix the problem.

What are the common mistakes?

The most common mistakes are fine-tuning too early, writing vague prompts, and judging a tuned model without a fair comparison against the prompt version.

  • Fine-tuning before trying prompts. Many tasks that look like training problems are actually prompt problems, and prompts cost far less to fix.
  • Vague prompts. A prompt that does not name the task, format and rules will give vague answers, and no amount of tuning fixes a missing brief.
  • Thin training data. A fine-tune on a few dozen examples teaches the model your noise, not your pattern.
  • No side-by-side test. If you do not compare the tuned model with the prompt version on the same inputs, you cannot tell whether training helped.
  • Forgetting maintenance. A tuned model goes stale as your product and language change, so plan for fresh examples and retraining.

How do you decide?

You decide by testing both routes on your own inputs, starting with prompts and moving to fine-tuning only when prompts fail on the same kind of input again and again.

  1. Write the prompt first. Spend a day on a clear prompt with a few examples and measure the result.
  2. Collect failures. Keep the inputs where the prompt version gives a poor answer and look for a pattern.
  3. Check the pattern. If failures share a shape, such as a fixed format or label set, fine-tuning may help.
  4. Build a small training set. Start with a few hundred good examples and compare the tuned model side by side with the prompt version.
  5. Pick on the numbers. Choose the route with the better result per unit of cost, including the time to maintain it.

This sequence keeps the spend low and the decision honest. It also gives you the evaluation set you need for either route, because you cannot improve what you do not measure. For the wider context, retrieval augmented generation is a third route worth knowing when the answer needs fresh facts.

Key takeaways

  • Prompt engineering changes the instructions; fine-tuning changes the model itself
  • Start with prompts, and fine-tune only when prompts fail on the same pattern
  • Fine-tuning needs hundreds of good examples, not a few dozen
  • A tuned small model can beat a large prompted model on a narrow, repeated task
  • Compare both routes side by side on the same inputs before you decide
  • Use prompts for changing context and fine-tuning for stable habits

Frequently asked questions

Is fine-tuning always better than prompt engineering?

No. Fine-tuning wins on narrow, repeated tasks with a clear right answer, but prompts win on broad or changing tasks. Many teams get a good result from prompts alone, and fine-tuning only pays off when prompts keep failing on the same kind of input.

How many examples does fine-tuning need?

A useful starting point is a few hundred good examples, cleaned and labelled. Fewer than that teaches the model your noise rather than your pattern. The exact number depends on the task, so test with a small set and add examples where the model still fails.

Can I fine-tune and still use prompts?

Yes. Most teams do both: the fine-tune handles stable habits such as format and style, while the prompt carries the job at hand, such as the current ticket or document. When a result is wrong, check the prompt first, because it is cheaper to fix.

Does fine-tuning cost less to run than prompting?

It can, at volume. A tuned small model may use fewer tokens per answer than a large prompted model on a narrow task. At low volume the training and data work cost more than the saving, so check the maths for your own traffic.

What happens if my data changes after fine-tuning?

The tuned model goes stale as your product, terms and language change. Plan for fresh examples and retraining on a schedule, and keep the prompt layer in place so you can adjust quickly between training runs.

Do I need a machine learning team to fine-tune?

Not always. Managed fine-tuning services handle the training job, but you still need someone who knows the task to prepare examples and judge results. The data work matters more than the training setup.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: AI and agent systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Choosing between prompts and fine-tuning for your product? Talk to Hertiv.

A senior engineer replies within one business day. Or see our LLM Fine-Tuning service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call