What is AI fine-tuning?
Fine-tuning is the further training of a pretrained model on additional data so that its weights adapt to a particular task, style or domain.
It differs from Retrieval-Augmented Generation in where knowledge lives: RAG leaves the weights unchanged and fetches information from documents at query time, while fine-tuning changes the weights to teach behaviour, format or style. Not every weight has to change; parameter-efficient methods train only a small part.
- Topic
- Machine learning, models and training
- Also known as
- Finetuning, model fine-tuning
How AI fine-tuning works
- A base or instruction-tuned model that has finished pre-training is chosen as the starting point.
- A training set fitting the goal is prepared: input and expected output pairs, preference pairs or raw domain text.
- The model is trained at a low learning rate; full fine-tuning updates all weights, while methods such as Low-Rank Adaptation update only added adapters.
- Results are measured on a separate evaluation set, checking for loss of general ability (catastrophic forgetting).
In more detail
Limiting catastrophic forgetting: data mixing and safety replay
To prevent catastrophic forgetting during domain adaptation, teams mix a small proportion of general instruction or safety replay data (data mixing) into the fine-tuning batch and use regularisation or lower learning rates. Benchmark suites track target-task gains alongside general capability and safety regressions after every checkpoint.
Commonly confused terms
| Term | How it differs |
|---|---|
| Pre-training | Pre-training trains a model from random weights on massive general corpora using self-supervised objectives, whereas fine-tuning starts from those pretrained weights and adapts them to a narrower task or domain with far less data and compute. |
| Quantisation | Quantisation reduces numerical precision of weights or activations (e.g. BF16 to INT4) to shrink memory and speed up inference without necessarily training, whereas fine-tuning updates weight values through training (though QLoRA combines both). |
Why AI fine-tuning matters for on-premises AI
Models can be adapted without confidential training data leaving the organisation's servers. A small model tuned for a narrow task can do the same job as a large general model on less inference hardware. Full fine-tuning needs much GPU memory and training time; parameter-efficient methods cut that cost. A tuned model can memorise its training data, so datasets with personal data need minimisation and access control; fine-tuning can also weaken safety behaviour, so safety tests are rerun.
A bank adapts a model to classify support request types using labelled examples it keeps in-house and measures the results on a separate test set.
Common questions
How much data does fine-tuning need?
There is no fixed number; it depends on task difficulty and method. Data quality and how well it represents the task matter as much as the number of examples.
Fine-tuning or RAG for questions over company documents?
RAG suits changing information and source citations. Fine-tuning is chosen to teach a fixed output format, house style or narrow classification behaviour rather than facts.
Related terms
- Parameter-efficient fine-tuning (PEFT)
- Supervised fine-tuning (SFT)
- Full fine-tuning
- Low-rank adaptation (LoRA)
- Catastrophic forgetting
- Instruction tuning
- Pre-training
- Retrieval-augmented generation (RAG)
- AI base model
- Transfer learning
Sources
- Universal Language Model Fine-tuning for Text Classification, 2018
- BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding, 2018
- Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!, 2023
Related page on this site: Related FAQ · In the glossary: Glossary, E to L