Notes

Supervised Fine-Tuning (SFT)

A freshly pretrained model is a superb continuer of text and a poor assistant. Ask it a question and it may answer with five more questions, because that is what pages of the web look like. Supervised fine-tuning is the step that teaches it to respond, by showing it thousands of examples of exactly that.

What the training actually is

SFT is ordinary supervised learning laid over pretrained weights. The dataset is pairs: a prompt, and the response a human or a stronger model judges good. The objective is the same next-token prediction used in pretraining, but the loss is computed only on the response tokens, so the model learns to produce an answer rather than to predict the question. Dataset sizes run from a few thousand carefully curated examples to a few hundred thousand, and quality dominates volume here — a handful of sloppy or self-contradictory responses shows up directly in how the finished model behaves. Hugging Face's TRL library is the common implementation.

Where it sits in the pipeline

SFT is the first post-training stage and the floor everything else stands on. Preference methods — reward modelling with RLHF, or DPO — begin from the SFT checkpoint and sharpen a behaviour that already exists; they cannot install a skill SFT never taught. It is also the practical lever for teams who train nothing from scratch: a LoRA adapter over an 8B open model, fitted on a few thousand in-house examples, moves format, tone and domain vocabulary further than prompt wording ever will. What SFT does not do well is add knowledge — facts the base model never saw belong in retrieval, not in training examples.

Supervised fine-tuning continues training a pretrained model on curated prompt–response pairs, computing the loss only on the response tokens, so the model learns to answer rather than merely continue text. It is the first post-training stage and the base that preference methods such as RLHF and DPO build on. SFT reliably shifts format, tone and task behaviour; it is a weak way to add new facts, which retrieval handles better.

Someone who has read the whole internet knows an enormous amount but has never been taught to be helpful — ask them a question and they might just carry on writing in the same style. Supervised fine-tuning is the apprenticeship that fixes this. The model is shown thousands of examples of a question placed next to a good answer, and it picks up the habit of answering. This is the stage where a raw text-predictor starts behaving like an assistant. A few thousand carefully written examples teach it more than a million careless ones, because it copies the habits it is shown, good or bad.