Start free

Zero to FDE / Blog / RAG vs fine-tuning: which one to use, and when

Blog

RAG vs fine-tuning: which one to use, and when

Use RAG when the model lacks your information. Consider fine-tuning when the model has the information but does not behave the way you need. Most business problems are the first kind, which is why RAG is usually the place to start.

What each one does

  • RAG (retrieval-augmented generation) finds the relevant passages from your documents when a question arrives and puts them in the prompt. The model’s weights do not change. See what RAG is, with code.
  • Fine-tuning trains the model further on your examples, so its default behaviour shifts: tone, format, or skill at a narrow task.

Side by side

RAGFine-tuning
FixesMissing or changing factsStyle, format, narrow task skill
Updating knowledgeChange the documentsTrain again
Can cite its sourceYes, the passages are in the promptNo
NeedsA retrieval pipeline and good chunksHundreds or more of quality examples, and evaluation
Per-user permissionsFilter at retrieval timeHard: knowledge is baked into the weights
Main riskRetrieving the wrong passageCost, drift, and re-training for every base model change

A decision order that works

  1. Improve the prompt and add a few examples. This is the cheapest change.
  2. Add retrieval if the model needs facts it does not have, or facts that change.
  3. Measure with an evaluation set. Do not go further until you can show what is still failing.
  4. Fine-tune only if the failures are about behaviour that prompting and retrieval did not fix, and you have the examples to train on.

Anthropic’s guidance on building agents makes the same point about starting simple: “we recommend finding the simplest solution possible, and only increasing complexity when needed.”1

They are not rivals

A system can use both: a model tuned for a company’s tone, answering from retrieved documents. The mistake is fine-tuning to teach facts. Facts change, and a tuned model cannot show where an answer came from.

Why this matters for client work

A client asking for “a model trained on our data” almost always needs retrieval with permissions and citations. Being able to explain that in two minutes, and to say what it would take to justify fine-tuning, is part of the Forward Deployed Engineer’s job. RAG is Week 3 of the Zero to FDE roadmap.

Zero to FDE is a self-paced 16-week course, ₹2,999 once, with a 7-day full refund. Week 1 is free, and one Week 4 lesson is free if you already write backend code. It has no live classes, no mentors and no accredited certificate.

Sources

  1. Anthropic, “Building effective agents” (19 December 2024)

Zero to FDE is a 16-week path, for working engineers and AIML graduates, to the work Forward Deployed Engineers do: backend basics, LLMs, RAG, agents, evaluation and deployment, with a shipped deliverable every week. Week 1 is free and complete, no card needed.

Start Week 1 free

More from the blog