Fine-tuning

Also called: model fine-tuning, finetuning, supervised fine-tuning (SFT)

Filed under AI & modern tech

What Fine-tuning means in practice

“Fine” signals small adjustments. The expensive part, pretraining on huge amounts of general data, is already done. Fine-tuning nudges that model with hundreds or thousands of targeted examples, such as questions paired with ideal answers.

You meet the term in two settings. AI labs fine-tune base models to follow instructions before release. Businesses and developers fine-tune models for narrower jobs, such as classifying tickets, matching a house style or producing a fixed output format.

One nuance: fine-tuning is better at teaching behaviour and format than at adding facts. For knowledge that changes, retrieval (RAG) is usually the better fit. Lightweight methods such as LoRA train only a small add-on set of weights, which makes fine-tuning far cheaper.

Fine-tuning a model on 2,000 labelled support tickets so it always returns the right category in a strict JSON format.

Used in a sentence: Before we fine-tune anything, let’s see how far a better system prompt gets us.

Often confused with

RAG
RAG gives the model information at question time without changing it. Fine-tuning changes the model itself through training.
System prompt
A system prompt shapes behaviour through instructions and can be edited instantly. Fine-tuning bakes behaviour into the model and needs a new training run to change.
Pretraining
Pretraining builds a model’s general abilities from scratch on enormous datasets. Fine-tuning is the much smaller follow-up step.

What is fine-tuning? →

How it works, examples, and common questions, explained in plain English.

Common questions

What does SFT mean?

SFT stands for supervised fine-tuning: training a model on examples that pair an input with the desired output. It is the most common form of fine-tuning and is often followed by preference-based methods such as RLHF.

What does RLHF mean?

RLHF stands for reinforcement learning from human feedback. People compare model answers, those preferences train a scoring model, and the language model is tuned to produce higher-scoring answers. It is a kind of fine-tuning used to make chat models more helpful.

Sources and further reading

  1. LoRA: Low-Rank Adaptation of Large Language Models (Hu et al., 2021) — arXiv
  2. Training language models to follow instructions with human feedback (Ouyang et al., 2022) — arXiv

Read more