SFT (Supervised Fine-Tuning)
Briefly
SFT — supervised fine-tuning, fine-tuning the model on pairs of «query → correct response». The model learns to respond not just convincingly, but in the way you need.
What is it
SFT (Supervised Fine-Tuning) is controlled fine-tuning: you show the model examples of correct answers, and it adjusts its weights to respond in the desired style and format.
This is the most direct way to turn a «plain language model» into a useful assistant.
How SFT differs from regular Fine-Tuning
Fine-Tuning is the general term for fine-tuning. SFT is a specific type where training occurs on labeled examples:
Query: "Write a polite refusal"
Response: "Thank you for your inquiry, but we are unable to assist at this time."
The model sees many such pairs and learns to reproduce the desired behavior.
How the SFT dataset is structured
The dataset usually looks like a table:
| User query | Expected response |
|---|---|
| Explain the term «token» | A token is the smallest unit of text… |
| Rewrite the text in a formal style | Dear client… |
| Write code to read CSV | import csv … |
The better and more diverse the examples, the better the model learns.
What SFT changes
- style and tone of responses;
- output format;
- ability to follow instructions;
- behavior in dialogue.
What SFT does not do
- does not add new precise facts;
- does not make the model «all-knowing»;
- does not replace RAG if working with up-to-date documents.
Facts are better stored in an external knowledge base, while SFT is used for form and behavior.
How SFT relates to LoRA and PEFT
Full SFT on billions of parameters is expensive. Therefore, in practice, SFT is often done using efficient methods:
- LoRA — fine-tuning through compact adapters;
- QLoRA — LoRA over a quantized model;
- PEFT — a family of methods for fine-tuning a subset of parameters.