What is fine-tuning?
Fine-tuning means continuing the training of an existing model on your own examples. The starting model already knows language in general. Fine-tuning adjusts its internal weights so that it handles your task the way you want: writes in your house style, classifies tickets into your categories or returns output in your exact format.
It is far cheaper than training a model from scratch, because the general ability is already there. You are teaching a specialism, not a language.
How does fine-tuning work?
- Choose a base model that allows fine-tuning.
- Prepare examples. Pairs of input and ideal output, typically hundreds to thousands. Quality matters more than volume.
- Train. The model's weights are updated on those examples. Lighter methods, such as low-rank adaptation (LoRA), change only a small set of added weights, which cuts cost.
- Evaluate. Compare the tuned model with the base model on examples held back from training.
- Deploy and maintain. The tuned model is a new asset to host, monitor and retrain when requirements or the base model change.
Fine-tuning vs RAG vs prompt engineering
| Prompt engineering | RAG | Fine-tuning | |
|---|---|---|---|
| What changes | The instructions | The information supplied at question time | The model's weights |
| Best for | Most tasks, first attempt | Facts that are private or change often | Consistent style, format or a narrow skill |
| Effort to start | Minutes | Days to weeks | Weeks, plus a dataset |
| Updating | Edit the prompt | Edit the documents | Retrain |
The sensible order is the order of the columns. Start with a better prompt and examples. Add retrieval when the model lacks facts. Fine-tune when both are in place and the output is still not consistent enough, or when a smaller tuned model could replace a larger one at lower cost.
When is fine-tuning worth it?
- The task is narrow, repeated at volume and easy to score.
- You have, or can produce, good examples.
- A long prompt full of examples is doing the job but costs too much per request.
- You need a small model to do one thing as well as a large one.
It is a poor fit for teaching facts. A tuned model can still state them wrongly and cannot cite where they came from.