Fine-tuning vs prompting vs retrieval: how to customize an AI agent's behavior
When an off-the-shelf model doesn't behave the way you need, there are three main levers. They solve different problems, and mixing them up wastes time and money.
Prompting (instructions and examples)
- Change behavior by writing better instructions, adding examples, or providing tools.
- Fast to iterate and cheap to change.
- Best for: tone, format, task steps, rules and most early experimentation.
Retrieval (giving the model the right information at runtime)
- Look up relevant documents, records or data and include them in the context.
- Keeps knowledge current without retraining, and lets you control access by user.
- Best for: answering from your company's documents, product catalogs or anything that changes.
Fine-tuning (further training on your own examples)
- Adjusts the model's weights using many examples of desired input and output.
- Can make a smaller model reliably follow a specific style or format, or improve performance on a narrow, consistent task.
- Costs: preparing quality data, training, evaluation and repeating the process when the base model updates.
A common misconception. Fine-tuning is usually not the best way to teach a model new facts. Retrieval is generally more reliable, more up to date and easier to audit.
A reasonable order: start with prompting, add retrieval for knowledge, and consider fine-tuning only once you have a clear, measurable gap and good evaluation data.
Have you found a case where fine-tuning clearly beat better prompting? How much example data did it take?
Comments · 4
Plain English version: prompting is giving instructions, retrieval is giving it a library, fine-tuning is teaching it new habits.
Start with prompting, add retrieval for fresh data, and fine-tune only if those fail. It's the cheapest order to learn in.
Can retrieval and fine-tuning be combined, or do they conflict?
They combine well. Fine-tune for style and format, retrieval for up-to-date facts. They don't conflict.