RAG vs Fine-Tuning: When to Use Each
RAG retrieves relevant documents at query time; fine-tuning bakes new behavior into model weights. How to choose based on what actually needs to change.
RAG (retrieval-augmented generation) and fine-tuning both adapt an LLM to a specific use case, but they change different things. RAG retrieves relevant external documents at query time and hands them to the model as context, leaving the model’s weights untouched. Fine-tuning updates the model’s weights directly through additional training, changing how it behaves for every future request. The choice between them comes down to a single question: does the model need new knowledge, or a new skill?
What RAG actually does
Retrieval-augmented generation sits in front of a model, not inside it. At query time, a retrieval step searches an external knowledge source — usually a vector database holding embeddings of your documents — for the passages most relevant to the current question, then inserts those passages into the prompt alongside the user’s query. The model reasons over both, but it’s still the same base model with the same weights it started with.
The practical upshot: update the underlying documents, and the next query immediately reflects the change. No retraining, no deployment of new weights — just a refreshed index. This is why RAG is the default choice for anything that changes often: internal documentation, support tickets, product catalogs, policy text.
What fine-tuning actually does
Fine-tuning takes a pretrained model and continues training it on a smaller, task-specific dataset, adjusting the model’s internal weights so the new behavior is baked in directly. Instead of being told the answer at query time, the model has effectively “learned” it through gradient updates. Techniques like LoRA make this cheaper by training a small set of additional parameters rather than the full model, but the effect is the same in kind: the change lives in the weights, and it persists without needing to supply extra context on every request.
Fine-tuning is the right tool when what needs to change is how the model behaves — its tone, its output format, its ability to follow a narrow set of domain-specific instructions consistently — rather than what facts it has access to.
The core distinction: knowledge vs skill
The clearest way to decide is to ask what’s actually wrong with the base model’s output.
- If the model doesn’t know something — a fact, a recent policy, the contents of your internal wiki — that’s a knowledge gap, and RAG closes it by supplying the missing information directly in context.
- If the model knows the relevant facts but responds in the wrong format, tone, or style, or fails to follow a specific instruction pattern reliably, that’s a behavior gap, and fine-tuning closes it by adjusting how the model generalizes across examples of the desired behavior.
Feeding a model more and more examples of the correct format through RAG-style context stuffing rarely fixes systematic behavioral issues as reliably as fine-tuning does, and fine-tuning a model on facts it should instead be looking up tends to produce a model that’s confidently wrong when those facts change, since hallucinations are more likely once weights encode stale training data as if it were current.
Comparing the two
| RAG | Fine-tuning | |
|---|---|---|
| Changes | Retrieved context, not weights | Model weights |
| Best for | Facts, evolving knowledge | Tone, format, narrow skills |
| Update speed | Immediate (edit the index) | Requires retraining |
| Cost pattern | Retrieval + larger prompts per query | Upfront training cost, cheaper per query |
| Stale data risk | Low — source docs can be refreshed | Higher — weights don’t self-update |
| Transparency | Can cite the retrieved source | Behavior is implicit in weights |
| Infrastructure | Vector database, retrieval pipeline | Training pipeline, GPU access |
They’re not mutually exclusive
In practice, many production systems use both. A support assistant might be fine-tuned to consistently respond in the company’s voice and follow a specific escalation format, while also using RAG to pull the latest product documentation into context so its answers stay accurate as that documentation changes. Fine-tuning shapes how the model responds; RAG supplies what it responds with. Neither approach eliminates the need for good prompt engineering — how the retrieved context or fine-tuned instructions are framed in the final prompt still matters.
A simple decision path
Start with RAG by default — it’s cheaper to set up, doesn’t require training infrastructure, and its effects are easy to reason about and update. Reach for fine-tuning only when you’ve confirmed the problem is behavioral rather than informational: the model has the right facts available but isn’t using them the way you need, consistently, across many examples. Choosing carefully around chunking strategy usually resolves more RAG quality issues than teams expect before fine-tuning becomes necessary at all.
The takeaway
RAG and fine-tuning solve different problems: RAG supplies facts at query time without touching the model, while fine-tuning changes the model’s underlying behavior through additional training. Use RAG when the issue is missing or changing knowledge, and fine-tuning when the issue is how the model responds rather than what it knows. Most serious production systems end up using RAG for freshness and fine-tuning for consistency, rather than treating the two as competing choices.
Tagged
Keep reading
Chisato · · 5 min read What Is Catastrophic Forgetting in AI Fine-Tuning?
Catastrophic forgetting is when training a model on new data erases skills it already had. Why it happens during fine-tuning, and how teams work around it.
Chisato · · 4 min read What Is DPO? Direct Preference Optimization Explained
DPO tunes a language model on human preference data directly, without training a separate reward model or running reinforcement learning.
Chisato · · 4 min read What Is Constitutional AI? Training Models on Principles
Constitutional AI trains language models to critique and revise their own outputs against a written set of principles, reducing reliance on human labels.