1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
51 small wins to finish your pathNext question →
RAG vs fine-tuning vs long context: when do you use each?
30-second answerSay your answer out loud first, then reveal.
| Need | Best fit | Why |
|---|---|---|
| Answer from 50K internal docs that change weekly | RAG | Updatable, scalable, citable |
| Always respond in a specific JSON format / tone | Fine-tuning (or just prompting) | Behaviour, not knowledge |
| Medical terminology the model misunderstands | Fine-tune the embedding model, or the LLM | Domain language |
| Analyse one 200-page contract thoroughly | Long context | Fits; needs holistic reasoning |
| Cheaper, faster model for one narrow task | Fine-tune / distil a small model | Cost and latency |
| Access-controlled data | RAG | Filter per user at retrieval time |
Why fine-tuning is poor for facts
- Models learn new facts unreliably from fine-tuning and may still hallucinate them.
- There are no citations, and you can't update or delete one fact easily (a GDPR problem).
- It requires retraining for every data change.
Combined approaches
- RAG + a fine-tuned generator that's better at using context and citing.
- RAG + long context: retrieve whole relevant documents instead of tiny chunks.
- Fine-tuned embedding models for domain retrieval (Q42).
Interview framing. "RAG is for what the model should know, fine-tuning is for how it should behave, long context is for what it should read right now."
Related
You understood something today that you didn't yesterday.