Forward-deployed / Learning zone
RAG & vector databasesa Generative AI module
Lesson 06

RAG vs. long-context vs. fine-tuning

TL;DR

There are three ways to give a model knowledge it didn't have, and teams reach for the wrong one constantly. RAG retrieves the relevant facts at query time and puts them in the prompt — best for large, changing, private, citable knowledge. Long-context just stuffs everything into the (now huge) context window every request — simplest, but pays to re-read everything each time and degrades when the pile gets big. Fine-tuning bakes patterns into the model's weights by training on your examples — best for behaviour, style, and format, and poor for facts (they go stale and can't be cited). The one-line rule: fine-tune for how the model should behave; retrieve for what it needs to know; use long-context when the knowledge is small enough to just hand over. They combine — a fine-tuned model with RAG is common — but choosing the primary tool for this need is a real decision with real cost, and defaulting to any one of them blindly is how features get expensive, stale, or unattributable.

🎯 For the product leader

Why it matters — This is the most common expensive mistake in AI features: fine-tuning to teach facts (which goes stale the next day and can't be cited), or paying long-context prices to re-read a knowledge base on every call. The wrong choice here compounds into your cost, freshness, and trust story.

What it changes in your decisions — You separate two questions that get conflated — "how should it behave?" (fine-tune) vs. "what does it need to know?" (retrieve) — and pick per need, often combining them, instead of adopting one religion.

Ask yourself — "Are we trying to change the model's behaviour, or give it facts? And how fresh must those facts be?"

Risk if ignored — A fine-tuned model confidently reciting last quarter's policy with no citation, or a long-context bill that scales with your document count instead of your usage.

The mental model: weights, window, or lookup

Three places knowledge can live, with very different economics:

RAG vs. long-context vs. fine-tune

Two questions decide which door · behavior or facts, then how much and how fresh

Three tools for the same complaint — "the model doesn't know this" — each right for a different shape of gap.

The model needs to know or do something it can't
Q1 · Behavior & style, or facts?
Behavior
Fine-tune

Train it into the weights — voice, format, classification, style

Facts
Q2 · How much, how fresh?
Long-context

Small & static enough to hand over every time — put it all in the window

RAG

Large, changing, private, or citable — retrieve the relevant bit

The comparison, at altitude

Fine-tuning Long-context RAG
Best for Behaviour, style, format, tone Small, self-contained knowledge per request Large / changing / private / citable knowledge
Freshness Stale until you retrain Fresh (you supply it) Fresh (update the index)
Citations No Possible but coarse Yes — per-passage
Cost shape Big up-front train, cheap-ish serve Pay to re-read everything every call Cheap per call + pipeline to build/run
Scales to — (about the model, not data size) The window limit; degrades well before it Millions of documents
Main risk Facts rot; expensive to iterate Cost + "lost in the middle" quality drop Retrieval quality is the ceiling

The deeper mechanics of the fine-tune-vs-RAG-vs-in-context tradeoff live in the strategy spoke; this lesson is the product-leader's decision layer on top of it.

The "long-context killed RAG" myth

As context windows grew to hundreds of thousands of tokens, a recurring claim appears: "just put everything in the prompt; RAG is obsolete." It isn't, for four stubborn reasons. Cost — long-context re-processes the whole pile every request, so your bill scales with document count × calls, not with usage; RAG processes only what's retrieved. Latency — a huge prompt is slow to read before the first token appears. Quality — models attend unevenly across a long window (the "lost in the middle" effect), so burying the answer in 100K tokens can retrieve worse than handing over the right 2K. Freshness & scale — your corpus is usually bigger than any window and changes constantly. Long-context is a genuine, simpler option when the knowledge is small and static enough — and a great partner to RAG (retrieve a generous set, let a long window hold it) — not a replacement.

They combine

The framing isn't a three-way fight; it's a toolkit. Common stacks: a fine-tuned model + RAG (the model has your voice and domain style baked in, and retrieves current facts); or RAG feeding a long window (retrieve broadly, let the big context hold more candidates so you lean less on perfect precision). Pick the primary tool by the dominant need, then add the others where they pay.

Failure modes

Practitioner checklist