Prompting, RAG or Fine-Tuning: Choose by What the Model Is Missing

Prompting fixes instructions, RAG supplies facts, fine-tuning changes behaviour. A decision guide with the open-book test and the trap of fine-tuning in facts.


A decision tree: if the model is missing instructions, prompt (a config change); if it is missing facts, use RAG (a dependency); if it needs a behaviour at scale, fine-tune with LoRA (a rebuild). A warning box notes the common mistake of fine-tuning to add facts

“Should we fine-tune?” usually gets asked about a week after someone watched a model confidently invent an internal hostname. The model didn’t know the hostname, so the instinct is to teach it. Fine-tuning sounds like teaching. It’s the wrong tool for that job, and choosing it costs a training pipeline you’ll then have to operate.

The question that sorts this out isn’t “which technique is best?”. It’s “what is the model missing?”. There are three answers, and each maps onto a change you already know how to make to software.

Three things a model can be missing

Instructions. The model can do the task. It just hasn’t been told the format, the constraints, the tone, or what “done” looks like. The fix is prompting: instructions, a few worked examples, and where the output feeds code, structured outputs. In software terms it’s a config change: minutes to try, reversible, versioned in git.

Facts. The model can’t know your runbooks, your service catalogue, yesterday’s incident, or anything that changed after its training cutoff. The fix is retrieval-augmented generation: find the relevant documents at request time and put them in the context. In software terms it’s a dependency: a data pipeline and an index you run, keep fresh and monitor, like any database.

Behaviour. The model has the instructions and the facts and still won’t do the thing consistently: a strict output style across thousands of calls, a domain’s way of reasoning, or a narrow task you want a much smaller model to handle at a fraction of the cost. The fix is fine-tuning. In software terms it’s a rebuild: training data, a training run, an evaluation gate, a new artifact, a rollout and a rollback plan.

You wouldn’t recompile a binary to change a timeout, and you wouldn’t hard-code a customer list into one either. The same instincts apply here.

The open-book test

Before you build anything, run one experiment by hand. Take a question the model gets wrong and:

  1. Paste the exact document that contains the answer into the prompt. Not a search result: the right one, chosen by you.
  2. Write clear instructions and two or three examples of good answers.
  3. Ask again.

If it now answers correctly, the model never lacked ability. It lacked the document. That’s a retrieval problem, and your work is getting the right document into the context automatically: chunking, hybrid search and reranking, freshness.

If it answers correctly after step 2 alone, it was a prompt problem.

If it still fails with a perfect document and good examples in front of it, you’ve found a behaviour problem, and fine-tuning is a real candidate.

Run it on 30 or 40 failing cases, not one. Use a paired comparison so you can tell a real improvement from noise.

Why “fine-tune in the facts” goes wrong

This is the expensive mistake, so it deserves evidence rather than opinion.

Ovadia et al. (2023) compared unsupervised fine-tuning with RAG on knowledge-intensive tasks. Fine-tuning helped a little. RAG consistently did better, both for knowledge the model had encountered in training and for entirely new knowledge, and the authors found that models struggle to learn new facts through fine-tuning at all.

Gekhman et al. (2024) found something worse. Fine-tuning examples that introduce new facts are learned significantly more slowly than examples consistent with what the model already knows, and as the model eventually does learn them, its tendency to hallucinate rises linearly. Their conclusion is that models acquire factual knowledge mostly in pre-training, and fine-tuning teaches them to use it more efficiently.

There’s an operational argument too. A fact in an index can be updated in minutes and deleted when it’s wrong. A fact in model weights changes only with another training run, and you can’t point to where it lives. When an auditor asks where an answer came from, “chunk 4 of runbook v12, retrieved at 14:02” is an answer. “The weights” isn’t.

The comparison

PromptingRAGFine-tuning (LoRA)
What it changesWhat the model is askedWhat the model can seeHow the model behaves
Software analogyConfig changeDependencyRebuild
Time to first resultMinutesDaysDays to weeks
When facts changeEdit the promptRe-index the documentsRetrain
Can it cite a source?Only what you pastedYes, the retrieved chunksNo
What you operateVersioned prompts, evalsIngestion pipeline, index, freshness monitoringTraining data, training runs, model registry, eval gate, rollout
Typical failureIgnored instruction in long contextRight answer not retrievedLearned the wrong habit, or forgot an old one
Cost profileMore tokens per callRetrieval plus longer promptsTraining cost, then cheaper calls if you move to a smaller model

Read the “what you operate” row twice. Each column to the right adds a system with its own failure modes, owners and on-call. RAG means you now run a data pipeline. Fine-tuning means you now run a build pipeline for a model artifact, and that artifact has its own end-of-life problem when the base model it was trained on is retired.

When fine-tuning is the right answer

It isn’t never. It’s the right tool when the problem is genuinely behaviour:

  • A format or style at high volume that prompting gets right 90% of the time, when the other 10% costs you more than a training pipeline does.
  • A narrow task moved to a smaller model. The one I’d reach for first: a frontier model handles a classification or extraction task well, you collect its outputs as training data, and you fine-tune a small model to do just that task at a fraction of the cost and latency. That’s the model right-sizing tier applied deliberately.
  • Domain reasoning patterns the base model handles badly even with perfect context, which the open-book test will have shown you.

When it is the answer, the usual method is a parameter-efficient one rather than full fine-tuning. LoRA freezes the base weights and trains small low-rank matrices added to each layer. Against full fine-tuning of GPT-3 175B with Adam, its authors report 10,000 times fewer trainable parameters and 3 times less GPU memory, with no added inference latency once the matrices are merged. QLoRA trains the same adapters on a 4-bit quantized base model and fine-tuned a 65B model on a single 48 GB GPU. Hugging Face’s PEFT library implements both.

LoRA has an operational benefit that matters to platform teams: an adapter is small and separate from the base model, so one deployment of the base can serve several adapters and pick one per request. That turns “a fine-tuned model per team” from a GPU fleet per team into a file per team. Budget the GPU memory for the base model and its KV cache first; the adapters are the cheap part.

They combine, in this order

The three aren’t exclusive. Most systems that work use them in layers:

  1. Start with prompting and a real eval set. It’s the cheapest experiment and it tells you what’s actually failing.
  2. Add retrieval for anything the model needs to know about you. Measure retrieval separately from generation, because a wrong answer with the wrong document is a different bug from a wrong answer with the right one.
  3. Fine-tune last, for the behaviour that’s still wrong after the first two, or to move a stable, well-measured task to a smaller model. Keep RAG in place: a fine-tuned model still needs today’s facts.

Plenty of systems never need step 3. That’s not a failure of ambition. It means the model was missing facts all along.

Frequently asked questions

Should I use RAG or fine-tuning?

Use RAG when the model is missing facts, especially private, recent or changing ones. Use fine-tuning when the model has the facts and the instructions but still won't produce a behaviour consistently, or when you need a smaller, cheaper model to do one narrow task well. In a 2023 comparison, RAG outperformed unsupervised fine-tuning for both knowledge the model had seen before and entirely new knowledge.

Can fine-tuning teach a model new facts?

Poorly. A 2024 study found that fine-tuning examples introducing new facts are learned significantly more slowly than examples consistent with what the model already knows, and that as they are eventually learned, the model's tendency to hallucinate increases linearly. Fine-tuning mostly teaches a model how to use what it already knows. Facts belong in retrieval.

What is the quickest way to tell whether a problem needs prompting, RAG or fine-tuning?

Run an open-book test. Paste the exact document that contains the answer into the prompt by hand, with clear instructions and two or three examples. If the model now gets it right, the problem is retrieval: build RAG. If it gets it right with better instructions alone, the problem was the prompt. If it still fails with perfect context and good examples, you have a behaviour problem, and fine-tuning is a candidate.

What is LoRA?

Low-Rank Adaptation, a fine-tuning method that freezes the base model's weights and trains small low-rank matrices added to each layer. Its authors report 10,000 times fewer trainable parameters and 3 times less GPU memory than full fine-tuning of GPT-3 175B with Adam, with no added inference latency once the matrices are merged. QLoRA, which trains LoRA adapters on a 4-bit base model, fine-tuned a 65B model on a single 48 GB GPU.

Comments