Dashboard
0%
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 →

Q12EasyConcept

RAG vs fine-tuning vs long context: when do you use each?

30-second answerSay your answer out loud first, then reveal.
NeedBest fitWhy
Answer from 50K internal docs that change weeklyRAGUpdatable, scalable, citable
Always respond in a specific JSON format / toneFine-tuning (or just prompting)Behaviour, not knowledge
Medical terminology the model misunderstandsFine-tune the embedding model, or the LLMDomain language
Analyse one 200-page contract thoroughlyLong contextFits; needs holistic reasoning
Cheaper, faster model for one narrow taskFine-tune / distil a small modelCost and latency
Access-controlled dataRAGFilter 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."

You understood something today that you didn't yesterday.