What each approach changes
Every answer a model gives depends on two things: its weights, fixed when it was trained, and the context it reads at request time. Prompting and retrieval work on the context. Fine-tuning works on the weights.
Instant to change. The instructions are sent, and paid for, on every request.
Knowledge stays outside the model, so it can be updated and cited. The way the model answers is unchanged.
Behaviour is learned once, in advance. Needs good examples and a new run when the behaviour should change.
Prompting
Prompting means writing instructions, and often a few worked examples, into the request. It needs no training, takes effect immediately and is easy to change, which makes it the right place to start. Its costs are per call: a 2,000-token prompt is paid for on every request, adds latency and takes room in the context window. Long prompts are also followed imperfectly — the more rules there are, the more likely some are dropped or applied inconsistently.
Retrieval-augmented generation (RAG)
Retrieval-augmented generation adds a search step. Your documents are indexed in advance; for each question the most relevant passages are fetched and placed in the prompt, and the model answers from them. The term comes from a 2020 paper by Lewis and colleagues. Because the knowledge lives outside the model, you update it by updating the documents, and answers can cite their sources. The model's way of answering is unchanged, though: it still writes in its own style and format.
When the goal is knowledge, retrieval tends to win. A 2023 comparison by Ovadia and colleagues found that retrieval consistently outperformed unsupervised fine-tuning at getting facts into a model's answers, both for facts the model had already seen and for entirely new ones.
Fine-tuning
Fine-tuning continues training the model on your examples, so that the behaviour you want becomes its default. Instructions you would otherwise repeat in every prompt — the tone, the structure of an answer, how much detail to give, what to do with an unclear question — are learned once. The result answers that way even with a short prompt, which can make each request cheaper and faster, and can let a small model do a narrow job as well as a larger one prompted carefully.
Its costs come up front: you need good examples, a training run, an evaluation, and a new run whenever the desired behaviour changes. Facts learned this way are frozen at training time and are recalled less reliably than facts supplied in the prompt.
How to choose
| If the question is… | It points to |
|---|---|
| Does the model need facts that change weekly, or a large document collection? | Retrieval |
| Must answers show where a fact came from? | Retrieval |
| Is the problem how it answers — tone, format, length, consistency? | Fine-tuning |
| Are your prompts long and repeated on every call? | Fine-tuning can absorb them |
| Should a smaller, cheaper model match a larger one on one task? | Fine-tuning or distillation |
| Are you still working out what a good answer looks like? | Prompting first |
- Week 1 — prompting. A system prompt describes the product and the tone. It works, but answers vary in format, and the prompt grows to 1,800 tokens as rules are added.
- Week 3 — retrieval. Help-centre articles are indexed and the three most relevant are added to each request. Answers about features become accurate and up to date.
- Week 6 — fine-tuning. Three hundred reviewed support chats teach the format and tone. The system prompt shrinks to two sentences; retrieval still supplies the facts.
- Result. Each request carries far fewer instruction tokens, answers are consistent, and changing a policy still means editing a document rather than retraining.
Common mistakes
- Fine-tuning to teach facts that change, then retraining every time they do.
- Comparing a fine-tuned model with a poorly prompted base model; compare against the best prompt you have.
- Expecting retrieval to fix tone or format; it only changes what the model reads.
- Dropping the system prompt after fine-tuning when the model was trained with one.
- Fine-tuning before you know what a good answer looks like, so the examples disagree with each other.
References and further reading
External sources open in a new tab.
- 01Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksLewis et al., 2020 · arXiv · arxiv.orgThe paper that named and introduced RAG.
- 02Fine-Tuning or Retrieval? Comparing Knowledge Injection in LLMsOvadia et al., 2023 · arXiv · arxiv.orgA direct comparison of the two for adding knowledge.
- 03Model optimizationOpenAI API docs · developers.openai.comA provider's view of when to prompt, evaluate and fine-tune.
- 04Prompt engineering overviewClaude Platform Docs · platform.claude.comHow far careful prompting can go before training is needed.