“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:
- Paste the exact document that contains the answer into the prompt. Not a search result: the right one, chosen by you.
- Write clear instructions and two or three examples of good answers.
- 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
| Prompting | RAG | Fine-tuning (LoRA) | |
|---|---|---|---|
| What it changes | What the model is asked | What the model can see | How the model behaves |
| Software analogy | Config change | Dependency | Rebuild |
| Time to first result | Minutes | Days | Days to weeks |
| When facts change | Edit the prompt | Re-index the documents | Retrain |
| Can it cite a source? | Only what you pasted | Yes, the retrieved chunks | No |
| What you operate | Versioned prompts, evals | Ingestion pipeline, index, freshness monitoring | Training data, training runs, model registry, eval gate, rollout |
| Typical failure | Ignored instruction in long context | Right answer not retrieved | Learned the wrong habit, or forgot an old one |
| Cost profile | More tokens per call | Retrieval plus longer prompts | Training 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:
- Start with prompting and a real eval set. It’s the cheapest experiment and it tells you what’s actually failing.
- 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.
- 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.
Comments