Supervised Fine-Tuning (SFT)
Supervised fine-tuning is the process of further training a large model on high-quality human demonstration data, usually called SFT in the alignment pipeline. It is the standard step after pretraining and before preference optimization, and it determines the model's basic behavioral style and answer quality.
Core principles
After pretraining and instruction tuning the model can already understand tasks, but its output style may be verbose, badly formatted or lacking safety awareness. SFT prepares a batch of demonstration conversations written by human experts, covering scenarios such as Q&A, writing, reasoning and safe refusal, and has the model imitate these demonstrations.
The training objective is the same as ordinary supervised learning, namely maximizing the likelihood of the demonstrated answer given the prompt. The difference is in the data: the core value of SFT data is not coverage but demonstration quality. Demonstrators need to embody appropriate tone, structure, reasoning process and boundary awareness, and the model learns all of these characteristics along with the content.
In the alignment pipeline, SFT is usually the first step, after which a reward model is trained on human preference data and then reinforcement learning or direct preference optimization pulls the model toward those preferences. SFT provides qualified samples while preference optimization provides rankings of better and worse; the two are complementary. Skipping SFT and going straight to preference optimization usually leaves the model unable to produce well-formatted candidate answers, and training becomes highly unstable.
In open-source practice, the community often releases its own SFT weights on top of base models and then layers different preference optimization recipes, producing variants with distinct styles, which shows that the choice of demonstrations at the SFT stage largely determines the model's personality.
Key points
Data quality matters far more than quantity. This is the most central practical conclusion about SFT. Low-quality demonstrations teach the model bad habits that are hard to correct later.
The LIMA hypothesis provides important evidence. Researchers fine-tuned with only about one thousand carefully selected demonstrations and obtained a surprisingly good assistant model. This supports the view that knowledge is mainly acquired during pretraining and that SFT mainly activates existing capabilities, and it shows that alignment is the selection and presentation of abilities rather than the instillation of knowledge.
Diversity must be deliberately ensured. If a small amount of high-quality data is highly homogeneous, the model overfits to a particular style. Coverage must span different task types, lengths and tones, plus the necessary refusal cases.
Loss masking is standard practice. The loss is computed only on the response part, with the prompt excluded, preventing the model from learning to repeat the user input.
The overfitting risk is high. With small data and many epochs, the model easily memorizes the demonstration text and generalization drops, so practice usually trains only one to three epochs with a relatively low learning rate. On data format, the token conventions for multi-turn dialogue must be unified, ensuring the template is identical at training and inference time; otherwise bizarre answers unrelated to the question appear.
Common misconceptions
First, assuming more SFT data is always better. A large amount of low-quality data can perform worse than a small set of carefully chosen samples while adding cost and overfitting risk.
Second, treating SFT as a means of knowledge injection. It mostly shapes expression and behavior; new domain facts should be handled through pretraining or retrieval.
Third, ignoring refusal and safety samples. Without boundary demonstrations the model tends to comply when it should refuse, or to be overly cautious on harmless requests.
Application scenarios
Alignment of general assistants, style customization for enterprise-specific assistants, shaping of safety and compliance boundaries, standardization of customer service scripts, unification of multi-turn dialogue formats, display of reasoning processes, and conventions for expressing knowledge in vertical industries.