Fine-tuning
Also called model fine-tuning, supervised fine-tuning, SFT.
Training an existing model further on your own examples so it behaves the way you want, such as following a format, tone or task more reliably.
Last updated
What it is.
Fine-tuning starts from a trained model and continues training on a smaller set of examples, usually pairs of input and ideal output. The result is a new version of the model that has learned the pattern in those examples. Hosted APIs offer it for some models; open-weight models can be fine-tuned on your own hardware.
It is good at changing behaviour: output format, style, classification labels, domain wording. It is a poor way to add facts that change, because updating them means training again. For that, RAG is usually the better fit.
Why it matters
A fine-tuned smaller model can sometimes match a larger model on one narrow task, which can lower inference cost and latency. The cost is preparing good training data, running training, and owning a model version you must re-test and update.
Common mistakes.
- 01
Fine-tuning to teach facts that change every week.
- 02
Training on messy, inconsistent examples. The model learns the mess.
- 03
No evals to compare the tuned model with the base model and a good prompt.
Work it out with a tool.
Related terms.
- RAG (retrieval-augmented generation)A pattern that finds relevant passages from your own data and gives them to a language model along with the question, so it answers from your content.
- LLM evals (evaluations)Repeatable tests that score how well a model, prompt or AI feature does a specific task.
- LLM (large language model)An AI model trained on very large amounts of text that predicts the next piece of text, which lets it read, write and reason in language.
- Temperature (LLM setting)A setting that controls how random a language model's output is: lower is more predictable, higher is more varied.
Guides and pages
Browse the full glossary or read answers to common questions.