1:1 mentoring with Big Tech AI engineers

RAG vs Fine-Tuning — A Decision Framework (and When to Do Neither)

One changes what the model knows. The other changes how it behaves. Almost every expensive mistake in this decision comes from confusing the two.

By AgenticPrep TeamUpdated 12 min read
Key idea

Retrieval changes what is in the context window; fine-tuning changes what the model does with it. So the first question is not “RAG or fine-tune?” but “is the model missing a fact or missing a habit?” Facts go in an index, habits go in the prompt first, and weights come last, on a narrow task a prompt has measurably failed.

Missing a fact or missing a habit: the split picks the lever
START FROM ONE ANSWER THAT WAS WRONG A wrong answer from a real query Paste the right passage into the prompt. Is the answer right now? yes no Knowledge gap: retrieval re-index in seconds · cite · filter per tenant Behaviour gap: prompt first instructions · examples · structured output still failing, narrow, high volume Fine-tune a smaller open model only after a scored prompted baseline On a frontier API: context only No fine-tuning on Claude: prompt + retrieval Facts expire and habits do not: never fine-tune on anything with an expiry date.

The paste test takes one query.

The two are not competing implementations of one idea, the way two databases are. They fix different defects on different timescales. A fine-tune aimed at a retrieval problem costs weeks of labelling and ships a model that is fluent, confident and permanently out of date. And on Claude’s API in 2026, the weights are not yours to change at all.

Climb the ladder: what each lever changes

Prompt minutes per try
  • Changes the instructions and examples
  • New fact: edit the prompt
  • Undo: revert a string
RAG and tools hours per try
  • Changes what is in the context, per query
  • New fact: re-index one document
  • Undo: revert the index
Fine-tune days per try
  • Changes the weights
  • New fact: a new training run
  • Undo: a model artifact you now own

Rule of thumb: stop at the first rung that passes your eval. Each rung up costs more to build, more to change and more to keep alive.

They stack more often than they compete: a fine-tuned model still needs retrieval for facts, and a prompt still frames every request. A surprising share of “we need to fine-tune” is a system prompt that never said what good looks like, and a surprising share of “the format keeps drifting” is structured output that was never turned on. When to Fine-Tune has the full ladder.

Run the paste test on one real failure

A support bot, a policy that changed last month
user

Can I get a refund on my annual plan after 45 days?

assistant

No. Refunds are only available within 30 days.

Wrong: the new policy gives annual plans 60 days.
app

Same question, with the current policy page pasted above it by hand.

assistant

Yes. Annual plans can request a refund within 60 days; unused months are refunded pro rata.

Fixed by context alone: a knowledge gap. Retrieval’s job.

If the answer turns right with the fact sitting in the window, you have a retrieval problem, and no training run keeps that paragraph current. If it is still shaped wrong (wrong format, wrong tone, refuses what it should answer) with the fact right there, now you have a behaviour problem. Write down the failure before choosing: a decision made without one is a guess with a budget.

Check who still lets you fine-tune

RouteStatus, October 2026
Claude APINo fine-tuning. The one managed route was Claude 3 Haiku on Amazon Bedrock, which listed its end of life as 10 September 2026.
OpenAISelf-serve fine-tuning is winding down: closed to new organisations from 7 May 2026, and no new training jobs for anyone from 6 January 2027 (deprecations page). Existing fine-tunes serve until their base models retire.
Google GeminiSupervised tuning on Vertex AI for selected models.
Open-weights modelsLlama, Qwen, Mistral, Gemma and others, on hosted tuning services or your own GPUs. You own the weights, so nobody deprecates them under you.

From Cost, Latency & Quality Tradeoffs; the OpenAI dates re-checked on 2026-10-21. Check each provider’s deprecation page before you plan.

That changes the question for most teams. On Claude, “RAG or fine-tuning?” becomes “which context: a cached long prompt, retrieval, or an agent searching with tools?” (RAG Architecture prices all three). Fine-tuning now means moving one narrow task to a smaller open model you serve yourself.

Compare them on the dimensions that decide

DimensionRetrievalFine-tuning
Fixesmissing, private or changing factswrong shape, tone or judgement
Update one factre-index one documenta new training run
Provenancethe chunk you sent, citablenone: weights cannot cite
Per-tenant accessa filter inside the searchimpossible: one set of weights
Per-query cost2,500 more input tokensoften lower: shorter prompt
New base modelswap it, keep the indexretrain and re-evaluate
Signature failurewrong chunk, answered honestlyfluent, from a world that moved on

Per-query cost: 5 chunks of 500 tokens at $2.00 per million input tokens (Claude Sonnet 5.5) is $0.005 a question, before output.

The access-control row ends arguments in regulated shops. If two customers must never see each other’s data, their data cannot share a set of weights, and one fine-tune per tenant is not a plan (Multi-Tenant Isolation). That constraint sits upstream of every quality argument.

Four requests, worked

“Answer questions about our internal docs”
Retrieval, and it is not close. Content changes weekly, answers need a citation, teams see different documents. The work is chunking, retrieval and reranking and a golden set, not the choice.
“It won’t stay in our output format”
Structured output, then maybe a tune. If the shape is a schema, enforce it. Fine-tuning earns its keep on a style no schema expresses: a house voice, a report’s hedging conventions.
“It doesn’t understand our jargon”
Usually retrieval, at the search layer. The right chunk is missed because your vocabulary is not the general one. Hybrid keyword plus vector search and a glossary fix more than a tuned generator; tune the embedding model last.
“It works, but it’s too slow and expensive at volume”
The case where tuning can win. Distil a big model’s outputs on your traffic into a small one (Distillation), after prompt caching and a smaller prompted model have been priced.

Do the break-even math before the training run

def fine_tune_payback(tokens_m_per_day,
                      frontier=8.00,  # $/M tokens, large model, blended
                      small=0.40,     # $/M tokens, tuned small model
                      shrink=0.30,    # prompt tokens the tune removes
                      build=25_000,  # data + evals + iteration, one-off
                      upkeep=3_000):  # $/month: retrains, evals, on-call
    big = tokens_m_per_day * frontier * 30
    tuned = tokens_m_per_day * (1 - shrink) * small * 30
    net = big - tuned - upkeep                 # monthly saving after upkeep
    return None if net <= 0 else build / net   # months to pay back
Tokens/dayNet / monthPayback
5M−$1,842never
10M−$684never
20M$1,63215.3 months
50M$8,5802.9 months
200M$43,32017 days

Illustrative inputs from Cost, Latency & Quality Tradeoffs: $8.00 vs $0.40 per million tokens, 30% shorter prompts, $25,000 to build, $3,000 a month to keep; net is the saving per month after upkeep. The saving covers upkeep only above about 13M tokens a day.

Training compute is the small line: a hosted LoRA run on an 8B-class model is a few dollars (LoRA & QLoRA); the weeks of data and eval work and the monthly upkeep decide. Retrieval is the opposite shape: cheap to build, rent on every query. And price the smallest current model before you distil: Claude Haiku 5.5 is $0.10 in and $0.50 out per million tokens (prompts up to 100,000 tokens). If it passes your eval prompted, a tune has nothing left to save.

End the argument with a four-arm eval

from collections import Counter
def run_arms(questions, arms, grade):
    """arms: name -> fn(question) -> answer; grade(answer, case) -> bool."""
    return {name: [grade(fn(q["text"]), q) for q in questions]
            for name, fn in arms.items()}
def paired(a, b):
    """Questions only A got right, and only B: the comparison that counts."""
    c = Counter(zip(a, b))
    return c[(True, False)], c[(False, True)]

arms = {
    "baseline":  lambda q: ask(SYSTEM, q),
    "prompt+":   lambda q: ask(SYSTEM_WITH_EXAMPLES, q),
    "rag":       lambda q: ask(SYSTEM, q, context=retrieve(q, k=5)),
    "finetuned": lambda q: ask_tuned(SYSTEM_SHORT, q),
}
scores = run_arms(load_jsonl("eval/real_queries.jsonl"), arms, grade)
for name, s in scores.items():
    print(f"{name:>10}  {sum(s) / len(s):.0%}")
print("rag-only vs tuned-only wins:", paired(scores["rag"], scores["finetuned"]))
If you seeIt meansDo
prompt+ closes most of the gapit was never a model problemship the prompt
rag beats finetuneda knowledge gap: the wrong technique, applied wellretrieval; drop the tune
finetuned wins on shape onlya behaviour gaptune the habit, retrieve the facts

Draw 200 or so questions from real logs, never from the documents: questions written while reading a passage make every retrieval arm look great. Compare arms question by question, not by average: on 200 questions near 85%, one pass rate carries about ±4.9 points of noise (RAG Evaluation). The judge behind grade needs its own calibration (LLM evaluation metrics).

Run both, with a strict split

Both, done badly facts in two places
  • Fine-tune on the documents “to teach it our domain”, add retrieval when answers go stale
  • Weights and index disagree, and the model prefers itself
  • Nobody can tell a bad chunk from a baked-in memory
Both, done well one owner per job
  • Retrieval owns every fact; the tune sees zero domain facts
  • The tune teaches only the habit: shape, voice, when to say “the documents do not cover this”
  • Content changes need a re-index, never a retrain

Rule: never fine-tune on anything with an expiry date. If someone in another department could revise it next quarter, it belongs in an index.

Common mistakes
  • Choosing before an eval exists. No scored prompted baseline, no fine-tune: there is nothing for the tune to beat.
  • Pricing the GPU hours and calling that the cost. Compute is the smallest line; upkeep never ends.
  • Fine-tuning to “reason better about our domain”. A tuned 8B is still an 8B: tuning teaches format and behaviour, not reasoning beyond the base model.
  • Planning on a route that is closing. Check the provider’s deprecation page first.
Interview angle

“Should we do RAG or fine-tune?” Ask for one failing answer, run the paste test aloud, and sort it: knowledge goes to retrieval, behaviour to the prompt first. Then: is the task narrow and high-volume enough to repay the build, and is there a scored baseline? A strong close: “I’d fix the prompt and retrieval first, and fine-tune only the narrow high-volume slice, with the eval built before training.” Model answer: fine-tune vs RAG vs prompting.

Check yourself
A support bot gives outdated refund rules. The policy changes every few weeks. A teammate proposes fine-tuning on the new policy. What do you recommend?

Retrieval. It is a knowledge problem, and the facts change faster than you could retrain. Put the current policy in the context and cite it; a tune would bake in one version and go stale on the next change.

An extraction prompt on a large model passes your eval at 40M tokens a day, and the bill is the problem. What do you do first?

Price the smallest current model prompted on the same eval, and prompt caching. If those fall short, a tune is a candidate: with the inputs above it nets about $6,264 a month and pays back in 4.0 months, provided the tuned model matches on the eval.

A model fine-tuned on product docs last year now runs with retrieval, and its answers sometimes contradict the retrieved chunks. What went wrong?

Facts live in two places. The weights hold last year’s docs and the model trusts them over the context. Retrain on habit-only examples with no domain facts, or drop the tune and keep the behaviour in the prompt.

Recap
  • Missing fact: retrieval. Missing habit: prompt first, weights last.
  • The paste test on one real failure sorts the two in a minute.
  • Claude’s API has no fine-tuning and OpenAI stops new jobs on 6 January 2027: tuning now means a smaller open model.
  • A tune pays back only when saving per token times volume beats build plus upkeep.
  • Run both with one owner per job: never fine-tune on anything with an expiry date.

Next: When to Fine-Tune: The Decision Framework — the three questions, the green lights and the red flags. If retrieval won, start with RAG chunking strategies.

  • rag
  • fine-tuning
  • architecture
  • decision-framework
Share

Keep reading

All posts

Enjoyed this post? The full curriculum has 151 sections, system design problems, and AI-reviewed practice runs.

See the full guide