insideout Get Pro
Compare

Compare

RAG vs fine-tuning

Facts go in the prompt, behaviour goes in the weights.

The short answer

Use retrieval when the model needs facts it doesn't have, or facts that change: you fetch the right passages and put them in the prompt. Use fine-tuning when you need the model to behave differently every time, in a format, tone or narrow skill that prompting can't hold. Most products start with good prompts and retrieval, and add fine-tuning later for behaviour, not for knowledge.

Retrieval (RAG)

Use it when

  • Answers depend on your own documents.
  • The facts change weekly, daily or faster.
  • People need to see where an answer came from.
What it costs
An index and an embedding model up front; every question then pays for the passages you add to the prompt.
Watch out
If retrieval misses the right passage, the answer is wrong however good the model is. Measure retrieval on its own.

Fine-tuning

Use it when

  • A format, tone or style must hold on every call.
  • A narrow task where a small tuned model can replace a large one.
  • Your prompts have grown too long to pay for on every request.
What it costs
Hundreds to thousands of good examples, a training run, then a tuned model to host or pay for.
Watch out
It shapes behaviour far more reliably than it stores facts. Facts trained in can't be cited and go stale.

At a glance

QuestionRetrieval (RAG)Fine-tuning
What changesWhat the model sees: the promptThe model itself: its weights
Best forKnowledge: your documents, fresh factsBehaviour: format, tone, a narrow skill
When the facts changeUpdate the index, in minutesTrain again, in hours or days
Can it show sourcesYes, it can quote the passages it usedNo
Work up frontChunking, an index and a retrieval testA labelled dataset and a training run
Cost per requestLonger promptsShorter prompts, maybe a smaller model

How to choose

  1. Write 20 to 50 real questions with good answers before you build anything; that is your test.
  2. Paste the right documents into a strong prompt by hand and run the test. If the answers are good, the missing piece is retrieval.
  3. If the answers are wrong even with the right documents in front of the model, because it won't keep the format, tone or steps, that is behaviour: fine-tuning can help.
  4. Change one thing at a time and run the same test after each change, so you know which change helped.

When you need both

Many products use both. Retrieval supplies today's facts, and a fine-tuned model reads them the way you need: in your format, in your voice, citing the passage it used. Fine-tune on examples that include retrieved passages, so the model learns to use them rather than to memorise answers.

Learn it properly

Questions

Does fine-tuning teach a model new facts?

Partly, and unreliably. A tuned model may blend or forget what you trained in, it can't point to a source, and the facts go stale the day they change. Keep facts in retrieval and fine-tune for behaviour.

Is RAG cheaper than fine-tuning?

To start, almost always: an index costs little and needs no training run. At high volume, long prompts cost more per call, and a small tuned model can come out cheaper. Measure the cost per good answer on your own traffic.

Can I use both?

Yes, and many products do. Retrieval brings the facts in at question time, and a tuned model handles the format and tone.

What should I try first?

A clear prompt with a few good examples and the right documents. It is the fastest to change and tells you which of the two problems you actually have.