When would you choose RAG vs long-context stuffing vs fine-tuning?
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
Decide on four axes: freshness, corpus size, cost per query, and attribution/access control.
Full worked answer with diagram
Decide on four axes: freshness, corpus size, cost per query, and attribution/access control.
- Fine-tuning changes behaviour: style, format, tool-use patterns, domain reasoning habits. It's the wrong tool for injecting facts - knowledge in weights is lossy, unattributable, impossible to update without retraining, and can't be permissioned per user. Choose it when the model does the wrong kind of thing, not when it lacks information.
- Long-context stuffing wins when the corpus is small (fits comfortably in the window - even 1M tokens is only a few thousand pages), changes rarely, every user is allowed to see all of it, and questions require whole-document reasoning ("compare section 3 across these five contracts"). With prompt caching, repeated queries over the same stuffed corpus get much cheaper, which moved this boundary significantly since 2023. Downsides: per-query cost still scales with corpus size, retrieval quality degrades with distractors ("lost in the middle" effects), and there's no natural citation unit.
- RAG wins when the corpus is large or unbounded, updates frequently, needs per-user ACL filtering, or when you need citations. It adds pipeline complexity and a new failure mode (retrieval misses), but cost per query stays flat as the corpus grows.
They compose rather than compete: a common production stack is a fine-tuned small model (for format/behaviour) + RAG (for knowledge) + long context (to fit generous retrieved evidence plus conversation history). A concrete decision heuristic: corpus under ~100-200k tokens, stable, uniformly accessible → just stuff it and cache it. Growing, changing, permissioned, or needs citations → RAG. Model misbehaves even with the right facts in context → fine-tune.
Worth sketching. A drawn fork stops this becoming a list of pros and cons and forces you to name the deciding question at each branch.
flowchart TD
Q["New requirement"] --> B{"Wrong kind of output,<br/>or missing facts?"}
B -->|"wrong behaviour"| F["Fine-tune"]
B -->|"missing facts"| C{"Corpus small, stable,<br/>same for every user?"}
C -->|"yes"| L["Stuff the context,<br/>lean on prompt caching"]
C -->|"no"| R{"Needs ACLs, citations,<br/>or minute-level freshness?"}
R -->|"yes"| RG["RAG"]
R -->|"no, but it keeps growing"| RG
What a good answer covers
- Decide on four axes: freshness, corpus size, cost per query, and attribution/access control
- Fine-tuning changes behaviour: style, format, tool-use patterns, domain reasoning habits
- Long-context stuffing wins when the corpus is small (fits comfortably in the window - even 1M tokens is…
- RAG wins when the corpus is large or unbounded, updates frequently, needs per-user ACL filtering, or…
- They compose rather than compete
Key terms: Fine-tuning · Long-context stuffing · RAG
In the glossary: Fine-tuning · Prompt caching · Lost in the middle · RAG · ACL filtering
Interviewer follow-ups to expect
How does prompt caching change the RAG-vs-long-context economics?
Your corpus is 500 pages and updates monthly - what do you pick?
When would you use RAG and fine-tuning together?
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep