RAG vs fine-tuning: a decision framework.
Two techniques get conflated constantly. They solve different problems, fail in different ways, and cost different amounts to keep alive. Here is how we decide.
Almost every "should we fine-tune?" conversation is really a knowledge problem wearing a behaviour problem's clothes — or the reverse. RAG (retrieval-augmented generation) and fine-tuning are not competing answers to one question; they answer two different questions. Confuse them and you spend a quarter teaching a model facts it will forget, or curating a corpus to fix a tone it could never learn that way. This is the framework we use before writing a line of code.
What each technique actually changes
Start with mechanics, because the trade-offs fall straight out of them. RAG leaves the model's weights untouched and instead changes what the model *sees* at inference time: you retrieve relevant documents, paste them into the context window, and let the model reason over them. Fine-tuning changes the model's *weights* — you continue training on curated examples so the model internalises a behaviour or a style.
- RAG = supply knowledge at runtime. The model reads your data fresh on every request. Update the data, and the next answer reflects it instantly — no retraining.
- Fine-tuning = shift behaviour at training time. You bake a pattern (format, tone, classification rule, reasoning style) into the weights. The behaviour is "free" at inference; the model no longer needs lengthy instructions to produce it.
- Prompt engineering is the cheap third option people forget. A well-structured system prompt — examples, role, constraints — often closes the gap that someone assumed required fine-tuning.
The crisp test: if the answer changes when your data changes, you have a retrieval problem. If the answer changes when your *standards* change — how you want it written, classified, or structured — you have a behaviour problem. The first points at RAG; the second points at fine-tuning, but only after prompting has hit its ceiling.
Current Claude models — Opus 4.8, Sonnet 4.6, Haiku 4.5, Fable 5 — ship with a 1M-token context window. A great deal of "knowledge" that once forced retrieval or fine-tuning now fits directly in the prompt. Try the simplest thing that works before you build a pipeline.
When RAG is the right answer
Reach for RAG when the model needs facts it was never trained on, or facts that change faster than any training cycle could keep up with. Retrieval also gives you the property regulated teams care about most: every answer can cite the source passage it came from.
- Knowledge is proprietary or private — internal docs, tickets, contracts, a product catalogue the base model has never seen.
- Knowledge changes often — pricing, policy, inventory, the latest release notes. Re-index, do not retrain.
- You need attribution — answers must link back to a clause or a document for trust, audit, or compliance.
- The corpus is large and sparse — you only need a handful of relevant passages per query, not the whole library memorised.
RAG does not teach the model *how* to behave. If retrieval surfaces the right passage but the model still answers in the wrong format or misclassifies it, that is a behaviour gap — and no amount of better retrieval fixes it. Note too that a clean tool boundary, often an MCP server, is what makes retrieval auditable instead of a black box.
When fine-tuning earns its keep
Fine-tuning is for behaviour you can demonstrate but struggle to describe — and that you need consistently, at volume, without burning context on instructions every call. It shines on narrow, repetitive, well-defined tasks where you have (or can build) a high-quality labelled set.
- A consistent output format or house style that long prompts only approximate — and you have hundreds-plus clean examples of it done right.
- A specialised classification or extraction task where the rules are tacit and easier shown than stated.
- Latency and cost pressure at scale — a fine-tuned model needs shorter prompts, which trims tokens on every one of millions of calls.
- A reasoning or domain style the base model can be nudged toward, where prompting plateaus before the quality bar.
What fine-tuning does *not* do: inject fresh facts reliably. Train a model on last quarter's policy and it answers from last quarter's policy with total confidence — there is no source to cite and no easy way to correct one wrong fact short of curating data and retraining. If the knowledge moves, fine-tuning fights you.
RAG, fine-tune, or both
The honest answer for most production systems is "both, but staged." Get retrieval and prompting right first; it is faster, cheaper, and tells you whether you even have a behaviour problem left to fine-tune away. Map your situation against the table before committing to a pipeline.
| Your situation | Lead with | Why |
|---|---|---|
| Needs current / private facts | RAG | Knowledge supplied at runtime; cite the source. |
| Needs a consistent format or tone | Fine-tune (after prompting) | Behaviour baked into weights, not re-instructed each call. |
| Facts change weekly | RAG | Re-index instead of retrain. |
| Narrow task, big volume, latency-bound | Fine-tune | Shorter prompts cut per-call tokens at scale. |
| Private knowledge + strict house style | Both | RAG feeds facts; fine-tune shapes how they are said. |
| Not sure the gap is behaviour at all | Prompt first | A better system prompt often closes it for free. |
When you do run both, the division of labour is clean: RAG owns *what* the model knows, fine-tuning owns *how* it responds. Build them as separable layers so you can re-index without retraining and retrain without re-indexing.
What each one costs to keep alive
Most teams compare build cost and stop there. The deciding cost is maintenance — the bill that recurs every month after launch. We talk in tiers rather than figures, because the absolute numbers drift with every model release.
- RAG build: moderate — retrieval, chunking, an index, an evaluation harness. RAG maintenance: ongoing-but-cheap — keep the index fresh and the chunking honest; no retraining.
- Fine-tune build: lower up front if your data is clean — but data curation is the real work and it is rarely cheap. Fine-tune maintenance: lumpy — every meaningful behaviour change is another curation-plus-retrain cycle.
- Per-call cost: RAG spends more tokens (you pay to read context each time); a fine-tuned model spends fewer (shorter prompts). At high volume that flips the total-cost picture — which is exactly why latency-bound, high-traffic tasks lean fine-tune.
- Hidden cost of fine-tuning: model lock-in. A new base model means re-running your fine-tune; a RAG pipeline usually just points at the new model and keeps working.
Ask: "When this needs to change, who changes it and how often?" If the answer is "facts, often, by a non-engineer" — RAG. If it is "behaviour, rarely, after a curation pass" — fine-tune. Optimise for the team that lives with the system, not the demo.
You cannot choose without an eval set
Neither technique is decidable by intuition. The only way to know whether prompting plateaued, retrieval missed, or behaviour drifted is to measure — which means a labelled eval set with the failure modes each technique produces, separated so you can read them.
- Build the eval set first — representative inputs with known-good outputs, including the edge cases that actually hurt in production.
- Score retrieval and generation separately. A wrong answer from the right passage is a behaviour bug; a wrong answer from a missing passage is a retrieval bug. Conflate them and you will tune the wrong layer.
- Establish a prompt-only baseline before any pipeline or training. It is the cheapest intervention and frequently the surprise winner.
- Re-run the same eval after every change — new index, new fine-tune, new base model — so quality is a number you watch, not a vibe you hope for.
for case in eval_set: retrieved = retrieve(case.query) # RAG layer answer = generate(case.query, retrieved) # behaviour layer record(case.id, { # did retrieval surface the passage we needed? "retrieval_hit": case.gold_doc_id in ids(retrieved), # given context, did the model answer correctly + in-format? "answer_correct": judge(answer, case.gold_answer), }) # low retrieval_hit -> fix the index / chunking (a RAG problem)# high hit, low correct -> fix behaviour (prompt, then fine-tune)Read top-to-bottom, those two columns tell you which lever to pull. Eval-driven development is the whole discipline of our AI workflow automation work — we do not ship an AI feature without the harness that proves it, and keeps proving it after launch.
Putting it together
Run the questions in order. Stop at the first one whose answer points somewhere — most systems never reach the bottom.
1. Does a better system prompt close the gap? -> ship the prompt. 2. Does the model lack facts (private or changing)? -> RAG. 3. With the right context, is behaviour still wrong (format, tone, classification)? -> fine-tune. 4. Both knowledge and behaviour gaps? -> RAG for facts, fine-tune for behaviour, as separable layers. 5. Can you measure any of this yet? -> build the eval set first; everything above depends on it.
RAG decides what the model knows. Fine-tuning decides how it behaves. Prompting decides whether you needed either.
Decide it with us in one cycle
This is a discovery-call-length decision, not a quarter-long one — once the eval set exists. We build Claude-native by default and run a prompt-first, eval-driven loop: baseline, then retrieval, then fine-tune only if the numbers still demand it. If you want the framework applied to your system instead of read about, that is exactly what an AI workflow automation engagement is for, and our pricing is built around two-week cycles you can stop after.
Questions, answered.
Neither is universally better — they solve different problems. RAG supplies knowledge at runtime and suits facts that are private or change often. Fine-tuning shifts behaviour (format, tone, classification) by changing the model's weights. If the answer changes when your data changes, you want RAG; if it changes when your standards change, you want fine-tuning — usually after prompting has hit its ceiling.
Yes, and most mature production systems do. The clean division is: RAG owns what the model knows, fine-tuning owns how it responds. Build them as separable layers so you can re-index your knowledge without retraining, and retrain behaviour without re-indexing. Stage it — get retrieval and prompting right first, then fine-tune only the behaviour gap that remains.
Usually no. Fine-tuning is unreliable for injecting facts and gives you no source to cite — and it fights you the moment that knowledge changes. For proprietary or changing knowledge, RAG is the right tool: it retrieves the relevant passages at inference time and can attribute every answer to its source.
RAG is usually cheaper to maintain because updating knowledge means re-indexing, not retraining — often something a non-engineer can do. Fine-tuning maintenance is lumpy: each behaviour change is another data-curation-and-retrain cycle, and a new base model can force a re-run. Fine-tuning can win on per-call cost at high volume, though, because shorter prompts mean fewer tokens per request.
Not unnecessary, but they move the line. Current Claude models ship with a 1M-token context window, so a lot of knowledge that once forced a retrieval pipeline now fits directly in the prompt. Always try the simplest thing — prompt with context — before building a pipeline. RAG still wins for large or sparse corpora and for attribution; fine-tuning still wins for ingrained behaviour at scale.
Build a labelled eval set first, then score retrieval and generation separately. A wrong answer from the right passage is a behaviour bug (prompt, then fine-tune); a wrong answer from a missing passage is a retrieval bug (fix the index). Establish a prompt-only baseline before any pipeline or training, and re-run the same eval after every change so quality is a number you watch rather than a vibe.