Zenaique

Walk through choosing RAG, fine-tuning, or long-context for a knowledge feature

Short answer·Hard·4.0 · 0·~3 min·Relevant atSambanova
Attempt it

A product needs the model to answer from company-specific knowledge. Walk through how you'd decide between RAG, fine-tuning, and long-context — and why they're often combined rather than chosen exclusively.

Free · 2 AI evals / day
TL;DR

Classify the gap first: fresh, large, citable knowledge → RAG; stable behavior or format → fine-tuning; small per-request docs → long-context. Mature systems combine all three.

Memory aid
Sign in for the mnemonic that makes this stick. See Pro pricing.
Easy to grasp

Imagine teaching a new employee to handle your company's questions. If the answers live in a handbook that changes every week, you don't make them memorize it — you let them look it up each time, so they're never out of date. That's RAG. If they keep filling out forms wrong, you train them once so the right format becomes second nature. That's fine-tuning. And if a customer hands them one document for a single task, they just read it on the spot. That's long-context. A good system uses all three at once, because each fixes a different kind of problem.

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.

Sign in for 5 free unlocks/day or go Pro for unlimited. See Pro pricing.

2–4 min · Everything important, quickly.

Spend 6-8 minutes on the gap classifier, the cost that bites each option, and the handoff thresholds so you can design a layered system rather than crown a single winner.

DimensionRAGFine-tuningLong-context
Gap it closesKnowledge (large, fresh, citable)Behavior / format / styleSmall per-request knowledge
FreshnessLive — update the indexStale until retrainedFresh per request
Update costReindex (cheap)Training run (expensive)None
CitationsNative (returns sources)NonePossible if docs in prompt
Main cost / limitRetrieval quality ceilingUpdate cycle latencyLinear tokens; mid-prompt recall

Real products, models, and research that use this idea.

  • An enterprise assistant fine-tunes for a strict response schema, uses RAG over a docs index refreshed continuously, and drops user-pasted logs into long-context.
  • Coding assistants combine RAG over a codebase with long-context for the open file and fine-tuning for diff/edit format conventions.
  • Support tools choose RAG over fine-tuning for product knowledge precisely because the catalog changes weekly and answers must cite the source article.

What an interviewer would ask next. Try answering before peeking at the approach.

QYour RAG answers are wrong even though the documents contain the right facts. Where do you look first?
Sign in or go Pro to see the approach for this follow-up.
QWhen does long-context genuinely beat RAG even for a large document?
Sign in or go Pro to see the approach for this follow-up.
QHow would you decide whether to fine-tune for a behavior versus just prompt-engineer it?
Sign in or go Pro to see the approach for this follow-up.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Framing it as a single exclusive choice — 'should we RAG or fine-tune?' — when the gaps are orthogonal and a real system layers all three on the parts each one fits.

Sign in or go Pro to see all red flags and common mistakes. See Pro pricing.

60-second night-before-the-interview bullets. Scan these on the way to the call.

Sign in for 5 unlocks/day or go Pro for unlimited revision sheets. See Pro pricing.

Primary sources. Skim if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
What is RLHF, and why is it used after pretraining?
MCQ·Easy