RAG vs Fine-Tuning: What Actually Decides It
RAG vs fine-tuning is the wrong first question. What each technique really fixes, the order to try them in, and the eval that should make the call for you.
Nobody Needs a Custom Model Yet
RAG vs fine-tuning arrives as a question already framed for you. A team has an LLM feature that works in six cases out of ten, someone has read that fine-tuning makes a model "learn your business", and the meeting is now about budget for a training run. Sometimes it arrives inverted: a vector database was bought in the spring, retrieval is live, answers are still wrong, and the fix on the table is to train on top of it.
Both are usually answers to a problem nobody has written down. At Kuaray we get pulled into this decision a few times a quarter, and the honest recommendation is often far cheaper than expected: the model doesn't need new knowledge or new weights, it needs a tighter task definition, better context, and a test that says whether any of this worked.
RAG vs Fine-Tuning Change Two Different Things
Strip away the marketing and the two techniques touch entirely different parts of the system.
Retrieval-augmented generation changes what the model knows at inference time. The model stays as-is and the right documents go in front of it per request. Knowledge lives outside the weights, in an index you control — updatable this afternoon, scoped per user, citeable in the answer.
Fine-tuning changes how the model behaves. You adjust weights, usually a small adapter rather than the whole network, so the model reliably produces a particular shape of output: a house tone, a strict schema, a terse classification instead of three paragraphs of hedging.
The confusion runs one way. Teams reach for fine-tuning expecting it to install facts, and it is a poor mechanism for that: facts baked into weights are undated, unciteable, stale the day the policy changes, and correcting one wrong answer means training again. If a user could ask "where did that come from?", the answer belongs in retrieval.
So the rubric is narrower than it looks. Ask what is actually failing:
- Wrong, outdated or made-up facts → retrieval problem.
- Right facts, wrong form — ignores the schema, wrong register, verbose, inconsistent labels → behaviour problem.
- Right facts and form, but too slow or expensive at volume → a distillation problem, which fine-tuning solves well.
- Fails at multi-step work, mis-calls tools, loses the thread → neither. That is agent and context engineering, and the most common misdiagnosis of the four: see why AI agents fail in production.
The Cheap Rungs Teams Skip
Before either technique there is a ladder of cheaper interventions, and it is frequently sufficient.
The first rung is an eval set: twenty to fifty real cases from your own logs or ticket history, each with a stated expectation and a checker that returns pass or fail without a human in the loop. Build it before changing anything. Without it you cannot tell whether RAG or fine-tuning helped — only whether the demo felt better, which is how teams end up maintaining something that never moved the number.
The second rung is task decomposition and context engineering. Most "the model can't do this" findings turn out to be one prompt asked to do four jobs at once. Split it, give each step a narrow output contract, validate between steps. Where the downstream system cares about shape, a schema-constrained decode removes an entire class of format failure that people routinely try to fine-tune away.
The third rung is few-shot examples in context. Four well-chosen examples get you most of the behavioural consistency a light fine-tune would, at the cost of some tokens and zero training infrastructure. If they change nothing, the task is probably under-specified rather than under-trained.
Only when those are exhausted and the eval set is still red does the choice between retrieval and training become real.
What RAG Fixes, and the Part Everyone Skips
Retrieval is the right default for anything knowledge-shaped: policies, contracts, product documentation, support history, codebases, regulated content that must be traceable.
The part teams skip is that RAG quality is a search engineering problem, not a model problem. In the systems we're asked to rescue, bad answers nearly always trace to a retriever handing the model the wrong passages, and the model then doing something reasonable with bad input. Embedding similarity alone is a blunt instrument. What moves accuracy, in rough order of return:
- Chunking that respects document structure. Split on sections and clauses, not every 512 tokens, and carry the heading path into the chunk so a fragment is interpretable alone.
- Hybrid retrieval. Dense vectors plus keyword search (BM25). Identifiers, part numbers, error codes and proper nouns are exactly what embeddings blur.
- A reranker over a wide candidate set. Retrieve thirty, rerank, pass five. Usually the single largest accuracy gain available, and it requires no training.
- Metadata filters. Effective date, jurisdiction, product version, entitlement. Most "the AI gave the wrong answer" incidents are a scope failure: a superseded document was in play.
- Retrieval-level evaluation. Measure whether the correct passage reached the context at all, separately from whether the answer was right. Without that split you cannot tell a retrieval bug from a generation bug, and you will tune the wrong half.
Retrieval also carries an operational surface: the index is a data pipeline with freshness, permission and deletion requirements. Document-level access control has to be enforced at query time, or your assistant becomes an elegant way to leak the salary review. That is ordinary data engineering, and it is the part of a RAG project that actually takes time.
What Fine-Tuning Actually Buys
Fine-tuning is not a last resort. It is a specific tool with a few jobs it does better than anything else.
Behavioural reliability at the margin. When output must follow a convention that is tacit and hard to write down — a clinical note style, a labelling taxonomy whose edge cases your annotators resolved by feel — a few hundred good examples will beat any prompt. Parameter-efficient methods (LoRA and its quantized variants) make this an adapter you can swap, not a new model you own.
Cost and latency compression. The most underrated case. Once a large model's behaviour on a narrow task is good, distill it: use its outputs as training data for a much smaller model, then serve the small one. For high-volume, low-variety work — classification, extraction, routing, triage — the economics and the tail latency both improve materially. The same move retires a long static prompt: two thousand tokens of instructions paid on every call become weights you pay for once.
The honest costs, which vendor material tends to understate:
- Data is the project. Collecting, cleaning, de-duplicating and holding out a dataset is most of the work. A fine-tune on sloppy labels makes a model confidently wrong in a consistent house style.
- You now own a versioned artifact. Adapters need a registry, rollback, and a record of which base model version they were trained against. When the provider deprecates that base, your evals run again from scratch.
- Evals become mandatory. Behaviour regresses in ways the training objective never measured. Without a held-out set you are shipping on vibes.
- It does not fix knowledge. Worth repeating: it is the most expensive mistake in this space.
The Comparison, Honestly
| Dimension | RAG | Fine-tuning |
|---|---|---|
| Changes | What the model knows at query time | How the model behaves |
| Knowledge freshness | Reindex in minutes | Retrain to update |
| Citations / traceability | Native | Not available |
| Per-document access control | Enforceable at query time | Not possible |
| Token cost per request | Higher — context carries documents | Lower — behaviour is in the weights |
| Latency | Adds retrieval and rerank hops | Can reduce it, especially distilled small models |
| Dominant effort | Search and data pipeline engineering | Dataset construction and eval discipline |
| Fails when | Retriever surfaces wrong passages | Training data is inconsistent or thin |
| Reversibility | Change the index | Retrain or roll back the adapter |
When You Need Both
Mature systems usually end up with both, doing different jobs: retrieval supplies the facts, a small tuned model supplies the shape. A support assistant that cites live policy through RAG while a fine-tuned 8B model handles intent classification and formatting is a normal end state — and cheaper to run than the all-prompting version it replaced.
Build them in that order. Retrieval first, because it is reversible and exposes your data problems early. Fine-tuning second, once the task is stable enough that frozen behaviour is an asset rather than a commitment you regret.
The Order We Build It In
- Write the eval set before touching the architecture. Real cases, stated expectations, an automated checker. If you cannot define pass/fail, the feature is not specified.
- Fix the task, not the model. Decompose, constrain the output shape, add few-shot examples, re-run the evals. This frequently closes most of the gap.
- Instrument retrieval separately from generation. Log what was retrieved on every request. Know which half is failing before investing in either.
- Add hybrid search and a reranker before anything exotic. Cheapest large gain in the stack, no training required.
- Enforce permissions and freshness in the index. Entitlements at query time, effective dates in metadata, a deletion path — before the pilot widens, not after.
- Only then consider a fine-tune, and name its job. Behaviour, or cost compression. If you cannot say which, you are not ready to train. Start with an adapter and a held-out set.
- Keep the eval harness in CI. Both the index and the base model will move underneath you. The harness is the only thing that tells you when.
Steps 1 to 4 take weeks and resolve most of the cases we see. That is not an argument against fine-tuning — it is why fine-tuning works when you get there, because by then you know what you are optimizing.
The Uncomfortable Summary
RAG vs fine-tuning gets argued as a procurement decision when it is a diagnostic one. Retrieval changes what the model can see; fine-tuning changes how it responds. Neither fixes an undefined task, and neither can be judged without an eval set — which is why teams pay for both and still cannot say whether the system improved.
The useful question is not which technique to pick. It is: what are the twenty cases you would accept as proof, and who is writing the checker?
Talk to Kuaray about your LLM architecture — we audit retrieval quality, build the eval harness, and ship the version that holds. See how we approach AI and machine learning, or our MVP approach if this is a first production AI feature rather than a rescue.