Compare
RAG vs fine-tuning
Facts go in the prompt, behaviour goes in the weights.
The short answer
Use retrieval when the model needs facts it doesn't have, or facts that change: you fetch the right passages and put them in the prompt. Use fine-tuning when you need the model to behave differently every time, in a format, tone or narrow skill that prompting can't hold. Most products start with good prompts and retrieval, and add fine-tuning later for behaviour, not for knowledge.
Retrieval (RAG)
Use it when
- Answers depend on your own documents.
- The facts change weekly, daily or faster.
- People need to see where an answer came from.
- What it costs
- An index and an embedding model up front; every question then pays for the passages you add to the prompt.
- Watch out
- If retrieval misses the right passage, the answer is wrong however good the model is. Measure retrieval on its own.
Fine-tuning
Use it when
- A format, tone or style must hold on every call.
- A narrow task where a small tuned model can replace a large one.
- Your prompts have grown too long to pay for on every request.
- What it costs
- Hundreds to thousands of good examples, a training run, then a tuned model to host or pay for.
- Watch out
- It shapes behaviour far more reliably than it stores facts. Facts trained in can't be cited and go stale.
At a glance
| Question | Retrieval (RAG) | Fine-tuning |
|---|---|---|
| What changes | What the model sees: the prompt | The model itself: its weights |
| Best for | Knowledge: your documents, fresh facts | Behaviour: format, tone, a narrow skill |
| When the facts change | Update the index, in minutes | Train again, in hours or days |
| Can it show sources | Yes, it can quote the passages it used | No |
| Work up front | Chunking, an index and a retrieval test | A labelled dataset and a training run |
| Cost per request | Longer prompts | Shorter prompts, maybe a smaller model |
How to choose
- Write 20 to 50 real questions with good answers before you build anything; that is your test.
- Paste the right documents into a strong prompt by hand and run the test. If the answers are good, the missing piece is retrieval.
- If the answers are wrong even with the right documents in front of the model, because it won't keep the format, tone or steps, that is behaviour: fine-tuning can help.
- Change one thing at a time and run the same test after each change, so you know which change helped.
When you need both
Learn it properly
- Prompt, retrieve or fine-tuneTraining and Tuning · Lesson 09 Pro
- Answering from documentsSearch and Retrieval · Lesson 09 Pro
- Measuring search with recall, MRR and NDCGSearch and Retrieval · Lesson 08 Pro
- Adapters and LoRATraining and Tuning · Lesson 08 Pro
- Specifying a good outputEvaluation · Lesson 01 Free
Questions
Does fine-tuning teach a model new facts?
Partly, and unreliably. A tuned model may blend or forget what you trained in, it can't point to a source, and the facts go stale the day they change. Keep facts in retrieval and fine-tune for behaviour.
Is RAG cheaper than fine-tuning?
To start, almost always: an index costs little and needs no training run. At high volume, long prompts cost more per call, and a small tuned model can come out cheaper. Measure the cost per good answer on your own traffic.
Can I use both?
Yes, and many products do. Retrieval brings the facts in at question time, and a tuned model handles the format and tone.
What should I try first?
A clear prompt with a few good examples and the right documents. It is the fastest to change and tells you which of the two problems you actually have.