AI products

RAG or fine-tuning: which do you need?

One question separates them, and most teams that ask it discover they were about to build the expensive one.

Short answer. Almost always retrieval. The distinction that settles it: retrieval changes what the model knows, fine-tuning changes how the model behaves. If your complaint is that the model does not know your documents, your policies, your prices or your product, that is a knowledge problem and fine-tuning is the wrong tool — it will be more expensive, go stale the day your data changes, and still hallucinate. Fine-tuning earns its cost when you need a consistent format, tone or classification behaviour that prompting cannot hold reliably, or when latency and per-request cost at high volume justify a smaller specialised model.

RAG or fine-tuning: the test that settles it

Ask one question about the failure you are trying to fix:

Is the model getting it wrong because it lacks information, or because it is responding in the wrong way?

Lacking information is a retrieval problem: it does not know your pricing, your policies, last quarter's numbers, this customer's history. No amount of weight adjustment reliably installs facts that change weekly, and attempting it produces a model that is confidently out of date.

Responding in the wrong way is a behaviour problem: the output format drifts, the tone is off, a domain-specific classification is inconsistent no matter how the prompt is written. That is what fine-tuning is for.

Most teams asking the question have the first problem and are being sold the second solution.

One production corpus, for scale. The multilingual platform behind the 87% and 99.2% figures published on this site indexes roughly 2,500 documents — about 15,000 pages, or 10–15 million tokens — drawn from 14 sources in 5 languages, and it is reindexed daily. The reindex interval is the part that decides the architecture, not the size: a corpus that moves every day cannot be fine-tuned into a model at any sensible cost, because each training run is out of date the morning after it finishes. Client anonymised.

RAG vs fine-tuning, side by side

Retrieval (RAG)Fine-tuning
ChangesWhat the model knowsHow the model behaves
Data freshnessImmediate — reindex and it is currentFrozen at training time; new facts need a new run
Upfront costLower; the work is in the data pipelineHigher; needs a curated, labelled example set
Per-request costHigher — retrieved context consumes tokensLower — shorter prompts, potentially a smaller model
AttributionNatural: you can cite the retrieved sourceNone: the answer has no traceable origin
Access controlEnforceable at retrieval time, per userNot enforceable — training data is baked in for everyone
DebuggabilityYou can inspect what was retrievedLargely opaque

The access-control row decides more enterprise architectures than the cost rows do. If different users are allowed to see different documents, retrieval can enforce that at query time and fine-tuning fundamentally cannot — anything in the training set is available to everyone who can reach the model.

What the cost row is worth, measured. On a production retrieval system of the size described above: about $0.011 per answer — roughly $0.002 of retrieval and $0.009 of generation — across about 40,000 queries a month. Read the split carefully, because it is easy to read backwards: the retrieval infrastructure is the cheap fifth, and what retrieval costs you sits inside the generation line, as the extra input tokens every retrieved passage adds to every prompt. Context length is the cost lever; a cheaper vector database is not.

And what it costs in time. The same system answers in about 1.9 seconds on average, 4.2 at p95 — roughly 0.3s of retrieval and 1.5s of generation, the remaining tenth elsewhere in the pipeline. The condition carries the claim: that is measured to the last token, not to the first. Time-to-first-token on the same system is a much smaller number and it is the one usually quoted, which is worth knowing before you compare anybody's latency figure with anybody else's. Your numbers move with model choice, context length and volume — the shape of them does not. Client anonymised.

When fine-tuning beats retrieval

What these have in common: none of them is about the model knowing things.

What to try first, and in what order

  1. Prompt properly first. A surprising share of "we need fine-tuning" turns out to be a prompt that never got a serious second pass. It is the cheapest experiment available.
  2. Build retrieval and measure. Get grounded answers with citations, then score them against a real test set rather than reading a few and forming an impression.
  3. Look at what is still failing. If failures are factual, the fix is in retrieval — chunking, ranking, permissions, coverage. If failures are behavioural and stubborn, you now have a labelled example set, because the failures themselves are the training data.
  4. Fine-tune against that measured gap, and only that.

Teams that run this sequence usually stop after step two or three. That is a good outcome, not a failed experiment — it means the cheaper architecture was sufficient, which is exactly what you wanted to find out.

The step missing from that list, and from most projects: measure the thing you are replacing, before you replace it. The system quoted throughout this article scores 99.2% because a harness was built to score it. Nobody measured the manual process it took over, so there is no comparable before — and rather than put a number from a different method next to it, we publish neither. What can be stated is the workload: 87% less manual handling. Whether the machine is more accurate than the people were is a question this project can no longer answer. Baselining costs an afternoon beforehand and cannot be bought back afterwards at any price.

What actually improves answer quality

Once retrieval is in place, quality improvements come from unglamorous places rather than from a better model:

All four are part of how we scope AI development, and they are the reason the cost breakdown in what an AI SaaS product costs puts data preparation as the largest single block rather than the pipeline itself.

Common questions

Three that come up once the choice stops being abstract.

Retrieval-augmented generation fetches relevant material at request time and puts it in the model context, so the model answers from information it did not previously have. Fine-tuning adjusts the model weights on example inputs and outputs, so the model behaves differently — a consistent output shape, a house style, a domain classification. The first changes what the model knows; the second changes how it responds.
Yes, and mature systems often do — retrieval for knowledge, a fine-tuned model for a consistent output contract. It is usually premature as a starting point. Build retrieval first, measure where quality actually falls short, and fine-tune against that measured gap. Doing both at the start means you cannot tell which one is responsible when the output is wrong.
No, and expecting it to is the most expensive misconception in this area. Fine-tuning teaches a model a style of answer, which can make confident wrong answers more fluent rather than less frequent. Grounding output in retrieved source material, with citations the user can check, is what reduces hallucination — together with evaluation that scores factual accuracy rather than reading well.

Not sure which one your product needs?

Bring us the failure you are trying to fix. Thirty minutes is usually enough to tell whether it is a knowledge problem or a behaviour problem — and the answer changes the budget considerably.

Message received

We’ll review your enquiry and respond within one business day.

Related reading