Topic 1 of 5 · 4 min read
Supervised fine-tuning on example conversations
Goal: Explain how fine-tuning on example conversations turns a base model into an instruction follower.
A base model only continues text. Supervised fine-tuning (SFT) shows it thousands of example conversations, so it learns to answer a request instead of continuing it.
Check yourself · 1 of 3
What is the main job of supervised fine-tuning on example conversations?
Why it matters
After pretraining, a model has read a huge amount of text and is good at predicting what comes next. Give it the line "What is the capital of France?" and it may continue with more quiz questions, because that is what such pages look like. It is not being rude. It was never asked to answer. If you know what SFT does, you know why chat assistants answer, stop at a sensible point, and keep a role.
How it works
- People write demonstrations. Each one is a request plus the answer a good assistant would give. Writers follow guidelines on tone, length and format. Some data is also written or filtered by other models.
- The examples use a chat template. The text is wrapped in markers for system, user and assistant turns. The model learns that after a user turn comes an assistant turn.
- Training uses the same next-token objective as pretraining. The only changes are the data and a smaller, careful run. Usually the loss counts only the assistant's words, so the model learns to produce answers, not questions.
- The result is an instruction-following model. It handles new requests that look like the examples, such as summaries, rewrites, small code fixes and explanations.
The InstructGPT paper (2022) is the classic account. Its authors report that people preferred outputs from a tuned 1.3B model over the raw 175B model. A small amount of well-chosen data changed behaviour more than raw size did.
Before and after
Weak: a user types "Translate to French: good morning" into a raw base model. It continues with "Translate to French: good evening, Translate to French: thank you".
Fixed: the same request to an SFT model returns "Bonjour." It has learned the pattern request, then answer.
What goes wrong
- It teaches style more than facts. SFT mostly shapes how the model answers. Knowledge comes from pretraining, so a fluent answer is not a checked answer.
- The model copies the demonstrators. If the examples are always polite, long and bulleted, so are the answers. This is one source of "house style".
- Gaps in the examples become gaps in behaviour. A request type the data never covered may get a weaker or stranger reply.
Chat apps such as ChatGPT, Claude and Gemini, and open-weight models released as "instruct" or "chat" versions, all go through this step.
Examples
Base model versus tuned model
Send "Write a short apology for a late delivery" to a base model. You may get a list of similar prompts, or a half-finished letter that drifts. Send it to the instruct version of the same model and you get one clear apology. Same knowledge, different training on top.
Why a few examples can go far
Writers produce a few thousand examples of summaries, rewrites and answers. The model already knows how to write. The examples mostly show it which kind of writing is wanted when a person asks for something.
Key points
- Supervised fine-tuning trains a base model on written request and answer examples, using the same next-token objective as pretraining.
- A base model continues text; an instruction-tuned model answers it, because the examples taught that pattern.
- Chat templates with system, user and assistant turns are part of what the model learns.
- SFT shapes format, tone and helpfulness more than it adds knowledge.
- The demonstrators' habits, such as length and bullet lists, carry into the model's default style.
Common mistakes
- Thinking the assistant was trained from scratch to chat, when it began as a text predictor.
- Believing SFT teaches the model new facts, so a fluent answer must be true.
- Assuming every assistant has the same behaviour, when each lab's demonstrations and guidelines differ.
- Forgetting that a raw base model will not follow instructions reliably.
Check yourself · 2 of 3
A base model given the line "What is a mortgage?" replies with ten more questions about money. Why?
Check yourself · 3 of 3
Where does the style of an assistant's default answers, such as length and bullet points, largely come from?
Practice items, not counted towards your mastery.
Start here
- Training language models to follow instructions with human feedback (InstructGPT) (opens in a new tab)PaperFree
The 2022 OpenAI paper that describes the supervised, ranking and RL steps, and reports a 1.3B tuned model preferred over the 175B base model.
- RLHF Book (Nathan Lambert) (opens in a new tab)BookFree
A free book that walks through instruction tuning, reward models, DPO and RL on verifiable rewards in order.
- Direct Preference Optimization: Your Language Model is Secretly a Reward Model (opens in a new tab)PaperFree
Shows how preference pairs can train a model directly, without a separate reward model or RL loop.