AI ENGINEERING · FINE-TUNING AND ADAPTATION · DECISION · 26 OF 35

Prompting vs RAG vs Fine-Tuning: How to Choose

A decision ladder for adapting a language model: start with prompting, add RAG when the model lacks knowledge, and fine-tune when you need a behaviour, format or narrow skill it cannot learn from instructions. Why fine-tuning does not reliably add facts, the real cost of each option, four worked product requests, combining RAG with fine-tuning, eval sets before and after, and common mistakes.

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
1 / 17

Press play to hear the narration, or step through at your own pace.

Key takeaways

  • Prompt first for a baseline
  • RAG for knowledge
  • fine-tune for behaviour or cost
  • combine them
  • prove it on evals

Notes

Three levers

There are three levers. Prompting changes the instructions and examples you send. Retrieval augmented generation, or RAG, fetches relevant text at the moment of the question and adds it to the input. Both leave the model untouched. Fine-tuning is different. You train the model further on your own examples, which changes its weights, so the new behaviour is baked in. Two levers change what the model reads. One changes what the model is.

Three ways to adapt a model
  • prompting change the instructions and examples you send
  • RAG fetch relevant text at query time, add it to input
  • fine-tuning train on your examples, change the weights

The idea

Here is the idea that sorts almost every case. Ask what the model is missing. If it is missing knowledge, facts it never saw or facts that change, the answer is to put those facts in front of it, which is RAG. If it is missing behaviour, a format, a tone, or a skill it will not do reliably however clearly you ask, then you teach it with examples, which is fine-tuning. Knowledge goes in the context. Behaviour goes in the weights.

The one question
  • what is the model missing?
  • knowledge: facts it never saw, or that change → put them in the context
  • behaviour: a format, tone or skill it will not do reliably from instructions → teach it with examples

Rung one: prompt

Always start on the first rung, prompting. Write clear rules, add a few worked examples, use structured output for formats, and try a stronger model. This costs hours, not weeks, and you can change it with a text edit. Just as important, it gives you a baseline score on your eval set. Without that number you cannot tell later whether RAG or fine-tuning actually helped. Many projects never need to leave this rung.

Try this first
  • clear role and rules
  • a few worked examples
  • structured output schema
  • a reasoning step if needed
  • a stronger model
  • cost: hours of work
  • change: edit text, redeploy
  • gives you: a baseline score

Rung two: RAG

Climb to the second rung when the answer depends on facts the model does not have. Prices and policies that change, private documents, support tickets, contracts. RAG also gives you citations, so users can check the source paragraph, and you can filter results by who is asking, so people only see what they are allowed to see. When a policy changes, you re-index one document. No training run, and the new answer is live in minutes.

Reach for RAG when
  • facts change: prices, stock, policies, this week's news
  • data is private: your docs, tickets, contracts
  • you need citations to the source paragraph
  • access differs per user
  • update: re-index a document, no training run

Rung three: fine-tune

The third rung is fine-tuning. Use it when you need a behaviour that instructions do not reliably produce: a strict output style, a house tone that is easier to show than describe, or a narrow skill like classifying, extracting or routing. The other big reason is cost. A small model fine-tuned on a few thousand examples can often match a frontier model on one narrow task, at a fraction of the price and latency, and without a long prompt on every call.

Reach for fine-tuning when
  • a strict format or style that prompts miss often
  • a narrow skill: classify, extract, rewrite, route
  • a tone that is hard to describe but easy to show
  • a small model must match a big one on one task
  • the prompt is huge and repeated on every call

Not for facts

The most common mistake is fine-tuning to add facts. It does not work reliably. A fact seen a handful of times in training is learned weakly, if at all. It can blend with similar facts, so the model becomes confidently wrong. It cannot cite a source. When the price changes, you need another training run. And you cannot cleanly remove one fact afterwards, which matters for privacy requests. If the problem is knowledge, retrieval is almost always the better path.

Why not fine-tune facts in
  • a fact seen a few times is learned weakly, if at all
  • it may blend with similar facts and get confidently wrong
  • no source to cite
  • a price change means a new training run
  • you cannot cleanly delete one fact later

What each costs

Compare the full cost, not just the training bill. Prompting needs no data and takes hours, but long prompts cost tokens on every call. RAG needs your documents, an index to host and a pipeline to keep it fresh, and adds retrieval time and passage tokens to each call. Fine-tuning needs hundreds to thousands of carefully labelled examples, a training run, somewhere to host the tuned model, and a fresh run each time you move to a newer base model.

Rough cost profile
          prompt   RAG        fine-tune
data      none     your docs  100s-1000s
                              labelled
build     hours    days-wks   weeks
per call  long     +retrieval short
          prompt   +passages  prompt
hosting   none     index      tuned model
upkeep    edit     re-index   re-train on
          text     on change  base change

Request one

Let us try four real requests. First: answer staff questions about our two thousand page HR handbook, and show the page it came from. What is missing? Knowledge. It is private, it changes every quarter, and the user wants citations. That is RAG, with a prompt that says to answer only from the passages and say so when the answer is not there. Fine-tuning would cost more, cite nothing and be stale after the first policy update.

Request: HR handbook bot
  • "answer staff questions about our 2,000-page handbook, with the page it came from"
  • missing: knowledge (private)
  • changes: every quarter
  • needs: citations
  • pick: RAG + a good prompt
  • not: fine-tuning

Request two

Second: turn supplier notes into a product listing, as JSON with a title, bullets and tags, in our friendly tone. This is format and tone, which sounds like fine-tuning. But try the first rung. A structured output schema fixes the format, and five example listings in the prompt set the tone. Say that scores ninety four percent on your evals, and the misses are minor. Stop there. Fine-tuning would add weeks of work to chase the last few percent.

Request: listing writer
  • "turn supplier notes into a product listing, JSON with title, bullets, tags, in our friendly tone"
  • missing: format + tone
  • try: schema-enforced output + 5 example listings
  • result: 94% pass on evals
  • pick: prompting, stop here

Request three

Third: route a million support tickets a day into forty queues. A frontier model with three thousand tokens of rules and examples, plus a three hundred token ticket, reads three point three billion tokens a day. A small model fine-tuned on a few thousand labelled tickets needs only the ticket, so zero point three billion. That is eleven times fewer tokens, at a per token price perhaps ten times lower. Roughly a hundred times cheaper, and faster too.

Request: ticket router
1M tickets/day, 40 queues

frontier model + long prompt
  3,000 prompt + 300 ticket tokens
  = 3.3B input tokens/day
small tuned model, no prompt
  300 ticket tokens
  = 0.3B input tokens/day

11x fewer tokens, ~10x cheaper
per token → roughly 100x less

Request four: both

Fourth: draft visit notes in our clinic's exact layout, using this year's billing codes. The codes change every year, so they come from retrieval. The layout is long and rigid, and prompted versions keep drifting, so that part is a good fit for fine-tuning. Here is the trick for combining them. Train on examples that already include retrieved passages, some of them irrelevant. The model learns to use the right passage, cite it, and say when the answer is missing.

Request: clinic note writer
  • "draft visit notes in our clinic's exact layout, using this year's billing codes"
  • codes change → RAG
  • layout is rigid, long, and prompts drift → fine-tune
  • train on examples that include retrieved passages

Measure it

Every rung must earn its place on numbers. Build an eval set of a few hundred real cases with correct answers, and score every option on it. For the ticket router, a small model with a prompt gets seventy one percent, the frontier model eighty eight, and the fine-tuned small model ninety. Now the choice is clear. Keep the test cases out of the training data, and check that tuning did not break other things the model must still do.

Ticket router, 400 test cases
option                     accuracy
small model + prompt          71%
frontier model + prompt       88%
small model fine-tuned        90%

also check: latency, cost per
call, and a few general tasks
the tuned model must not break

test cases never in training

Common mistakes

The classic mistakes. Fine-tuning to fix bad RAG answers, when the real problem is retrieval. Check recall at k first. If the right passage never reaches the model, no amount of training helps. Training on thirty examples, or on thousands of inconsistent ones, so the model faithfully learns the noise. Having no baseline, so nobody can show it helped. Letting test cases leak into the training set. And skipping the prompting rung entirely because fine-tuning sounds more serious.

Avoid these
  • fine-tuning to fix bad retrieval: check recall@k first, the passage may never reach the model
  • 30 examples, or noisy ones: it learns the noise
  • no baseline, so no proof
  • test cases leak into train
  • skipping prompting entirely

Numbers worth knowing

Some ballparks to plan with. A format or style change often shows up with around fifty to a few hundred good examples. A solid narrow skill usually wants one to ten thousand. Clean, consistent data beats more data every time. A few shot prompt is often one to five thousand tokens, and RAG adds a few thousand more per call. Updating a document in RAG takes minutes. Each fine-tuning iteration takes hours to days, and a new base model means tuning and evaluating again.

Ballparks
format or style change    ~50-500 examples
solid narrow skill        ~1k-10k examples
clean data beats more data, every time

few-shot prompt            ~1k-5k tokens
RAG context per call       ~2k-10k tokens
RAG doc update             minutes
fine-tune iteration        hours to days

new base model → re-tune and re-eval

Say it like this

How to say it. First I ask what the model lacks. Knowledge goes in the context with RAG, behaviour goes in the weights. I start with prompting to get a baseline on an eval set. I add RAG for private or changing facts and when we need citations. I fine-tune only for a narrow behaviour or format, or to let a small model do one task cheaply, and I keep it only if the eval score beats the baseline. That answer shows judgement, not just vocabulary.

In the interview
  • "First I ask what the model lacks. Knowledge goes in context with RAG; behaviour goes in weights. I start with prompting for a baseline, add RAG for private, changing facts, and fine-tune only for a narrow format or to go small and cheap, proven on an eval set."

Interview questions

Q1How do you decide between prompting, RAG and fine-tuning?

Ask what the model is missing. Start with prompting to set a baseline; add RAG when it lacks knowledge such as private or changing facts; fine-tune when it lacks a behaviour, format or narrow skill that instructions cannot reliably produce, or to make a small model do one task cheaply.

Q2Can fine-tuning teach a model new facts?

Not reliably. Facts seen a few times are learned weakly, can blend into confident errors, cannot be cited, go stale and are hard to remove. Put facts in the context with retrieval and use fine-tuning for behaviour.

Q3When is RAG the right choice?

When answers depend on information the model was not trained on or that changes: internal documents, prices, policies, tickets. It also gives citations, per-user access control and updates by re-indexing instead of retraining.

Q4What are good reasons to fine-tune?

A strict format or style that prompts keep missing, a tone easier to show than describe, a narrow skill like classification or extraction, or replacing a large model plus a long prompt with a small tuned model to cut cost and latency.

Q5What does each approach really cost?

Prompting costs little to build but long prompts add tokens to every call. RAG adds an index, a freshness pipeline and retrieval latency. Fine-tuning needs hundreds to thousands of labelled examples, training runs, hosting for the tuned model, and re-tuning when the base model changes.

Q6Can you combine RAG and fine-tuning?

Yes, and it is common: retrieval supplies current facts while fine-tuning sets format and behaviour. Training on examples that include retrieved passages, some irrelevant, teaches the model to pick the right one, cite it and say when the answer is missing.

Q7How do you prove a fine-tune was worth it?

Score a fixed eval set of real cases before and after, against the best prompted and RAG baselines, keeping test cases out of training. Also compare cost and latency per call and check the model has not regressed on other tasks it must still handle.

Q8Your RAG bot gives wrong answers. Should you fine-tune it?

Not first. Check retrieval quality, such as recall at k, because if the right passage never reaches the model training cannot fix it. Improve chunking, search or reranking and the prompt, then fine-tune only if a measured behaviour gap remains.