Zenaique
Part ofAI Product Manager·Week 2: RAG & Use CasesView roadmap →

When should you fine-tune instead of using RAG?

Short answer·Medium·4.6 · 211·~3 min·Asked atKore AiPersistentWandb·Relevant atAnthropicCoreweaveDatabricksElastic
Attempt it

Explain when fine-tuning is the better choice over RAG, and vice versa.

Free · 2 AI evals / day
TL;DR

Fine-tune to change behavior, style, or domain reasoning. Use RAG when you need fresh or private facts. Most production systems use both.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Imagine teaching a smart assistant. Fine-tuning is like sending it to a training course that rewires its habits, after the course it talks, formats, and reasons differently forever. RAG is more like handing it a folder of notes right before each question, the assistant itself is unchanged, but it can read fresh facts from the folder. If you want your assistant to always answer in a polite legal tone, you train it. If you want it to know what your company shipped yesterday, you give it the folder. Most real systems do both, train the tone and hand over the folder.

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.

The fine-tuning versus RAG question is rarely a real either-or. It feels like one in interview prep because the two techniques are introduced in parallel chapters of every LLM course, but in production they solve fundamentally different problems and most serious stacks ship both.

The reason the question keeps coming up is that teams burn weeks building one when the actual problem demanded the other. A team will fine-tune a model to know their internal docs, then watch the model hallucinate when the docs change a week later. Another team will pile retrieved context onto every query trying to enforce a JSON schema, when a 30-minute LoRA fine-tune would have solved it permanently. Knowing which side of the line a problem sits on is the senior judgment call.

The ambiguity dissolves once you stop thinking of them as competing 'approaches' and start thinking of them as edits to different parts of the system. Fine-tuning edits the parameters. RAG edits the prompt. Those are two different operations on two different artifacts, and they produce two different categories of behavior change. Anything that needs gradient signal goes to fine-tuning; anything that needs fresh text goes to RAG.

This deep dive walks the boundary: what each technique actually changes inside the system, where each one breaks down, how they compose, and what the 2026 production stacks look like.

What fine-tuning actually changes

Fine-tuning updates the model's parameters using gradient descent on labelled examples. Whether you use full fine-tuning, LoRA, or QLoRA, the artifact at the end is a modified set of weights. That artifact captures BEHAVIOR, the model's output distribution conditioned on input, generalised across many examples.

The behaviors that fine-tuning encodes well: tone and persona, structured output adherence like JSON or XML, refusal policies, domain reasoning patterns that need new internal abstractions (medical triage flows, legal citation formatting), tool-use and function-calling syntax, and translation between specialised registers.

What fine-tuning CANNOT do well: hold a specific fact. Memorising the price of widget X with fine-tuning is wasteful (you have to retrain when the price changes) and unreliable (the model may parrot a similar widget Y's price). Facts belong in retrieval; behaviors belong in weights. The clearest test: if updating the answer requires retraining, you put the wrong thing in weights.

What RAG actually changes
Why production stacks use both
Cost and latency in practice
Evaluation: the two stacks need different metrics
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.
ConcernFine-tuningRAG
Best forBehavior, style, format, domain reasoningFresh or private facts, citations, large corpora
Update cadenceDays (data, train, eval, deploy)Seconds to minutes (reindex)
LatencyLower (no retrieval hop)Higher (retrieval adds 100-300ms)
Per-query costLower (smaller prompt)Higher (retrieved context inflates tokens)
Operational complexityTraining pipeline, eval suiteIndex, retriever, reranker, freshness

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

  • Perplexity uses RAG over live web results combined with lightly fine-tuned Claude and GPT models for citation-style synthesis.
  • GitHub Copilot Chat retrieves from open files and project context via RAG while the underlying model is fine-tuned for code completion behavior.
Sign in to see more production examples.

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

QWhy can't you use RAG to teach a model to output strict JSON?
A

Retrieval changes the prompt, not the decoding distribution. Schema adherence is a behavioral property that needs either gradient updates or constrained decoding, not more context.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Treating RAG and fine-tuning as competing solutions to the same problem. They solve different layers, behavior versus knowledge, and the strongest production stacks combine both.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • Behavior versus knowledge framing

  • When fine-tuning is the only viable option

Sign in to unlock the revision sheet.

Primary sources. Browse 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