Skip to content
gentic.news — AI News Intelligence Platform
Connecting to the Living Graph…
Training & Inference

Supervised Fine-Tuning: definition + examples

Supervised Fine-Tuning (SFT) is a training stage in which a pretrained foundation model—typically a large language model (LLM) or vision transformer—is further trained on a curated dataset of input-output pairs. The goal is to specialize the model's general capabilities toward a specific task, domain, or desired behavior pattern without learning from scratch.

How it works (technically):

SFT starts with a model that has been pretrained on a broad, unlabeled corpus (e.g., next-token prediction on trillions of tokens). The pretrained weights are loaded, and the model is then fine-tuned using a labeled dataset where each example consists of a prompt (input) and a target response (output). The loss function is typically the same as during pretraining: cross-entropy loss over the tokens of the target sequence, but gradients are computed only for the output tokens (ignoring the input tokens). The optimizer (e.g., AdamW) updates all model parameters, or a subset (e.g., via LoRA or adapter layers), to minimize the prediction error on the target tokens. Batch size, learning rate, and number of epochs are carefully tuned to avoid catastrophic forgetting of the pretrained knowledge. A common practice is to use a lower learning rate (1e-5 to 5e-5) and a small number of epochs (1-3) compared to pretraining.

Why it matters:

SFT is the primary method for aligning pretrained models to human intent before reinforcement learning from human feedback (RLHF). It transforms a raw next-token predictor into a model that follows instructions, answers questions, or performs domain-specific tasks (e.g., legal summarization, code generation, medical diagnosis). Without SFT, models like GPT-4, Claude, or Gemini would generate random continuations rather than useful responses. SFT is also computationally efficient: fine-tuning a 70B-parameter model with LoRA requires only ~16 GB of VRAM per GPU, making it accessible to many organizations.

When it's used vs alternatives:

SFT is the standard first step after pretraining and before preference optimization (e.g., RLHF, DPO). It is used when you have a labeled dataset of desired input-output behaviors. Alternatives include:

  • *In-context learning (few-shot prompting)*: No training required, but limited to context window size and less reliable for complex tasks.
  • *RLHF/DPO*: Used after SFT to further align model outputs with human preferences (e.g., helpfulness, harmlessness) using pairwise comparisons or reward models.
  • *Full pretraining*: Extremely expensive; only done from scratch when no suitable pretrained model exists.
  • *Adapter-based tuning (LoRA, QLoRA)*: A parameter-efficient variant of SFT that updates only small rank-decomposition matrices, trading some performance for drastically lower memory.

Common pitfalls:

1. Catastrophic forgetting: Over-optimizing on a small, narrow dataset can erase general knowledge; mitigated by using replay buffers or mixing in pretraining data.

2. Data quality over quantity: A few thousand high-quality, diverse examples often outperform millions of noisy ones. The LIMA paper (2023) showed that 1,000 carefully curated examples can match larger SFT sets.

3. Overfitting: Small datasets and many epochs lead to memorization rather than generalization; use held-out validation sets and early stopping.

4. Label bias: If the SFT dataset contains systematic biases (e.g., always agreeing with the user), the model will learn that pattern.

5. Learning rate mismatch: Too high a learning rate destroys pretrained features; too low fails to adapt.

Current state of the art (2026):

SFT remains a core component of every major LLM pipeline. The state-of-the-art now emphasizes:

  • Data curation: Automated quality filtering using reward models (e.g., Llama 3.1 used a teacher model to filter SFT data).
  • Multi-task SFT: Training on a mixture of instruction-following, coding, math, and safety data simultaneously (e.g., Tulu 3, Gemma 2).
  • Long-context SFT: Fine-tuning models on sequences up to 128K tokens using ring attention and FlashAttention-3.
  • Parameter-efficient SFT: DoRA (Weight-Decomposed Low-Rank Adaptation) and LoRA-XS achieve near-full-fine-tuning quality with <1% of parameters updated.
  • Distilled SFT: Smaller models (e.g., Phi-3) are fine-tuned on outputs from larger teachers, achieving strong performance at low cost.

SFT is not expected to disappear; rather, it is being augmented with better data strategies, more efficient adapters, and tighter integration with preference optimization stages.

Examples

  • Llama 3.1 70B SFT on 15M instruction-output pairs filtered by a reward model to improve instruction following.
  • OpenAI's GPT-4 SFT stage used a dataset of ~100K human-written prompt-response pairs before RLHF.
  • Google's Gemma 2 27B SFT on a mixture of web text, code, and math data with a 0.1% learning rate for 2 epochs.
  • Meta's LIMA paper (2023) showed that SFT on only 1,000 high-quality examples matches larger datasets.
  • Microsoft's Phi-3 mini (3.8B) SFT on synthetic data generated by GPT-4, achieving strong reasoning benchmarks at low cost.

Related terms

Latest news mentioning Supervised Fine-Tuning

FAQ

What is Supervised Fine-Tuning?

Supervised Fine-Tuning (SFT) adapts a pretrained model on labeled input-output pairs to specialize its behavior for a downstream task, using standard supervised learning loss (e.g., cross-entropy on tokens).

How does Supervised Fine-Tuning work?

Supervised Fine-Tuning (SFT) is a training stage in which a pretrained foundation model—typically a large language model (LLM) or vision transformer—is further trained on a curated dataset of input-output pairs. The goal is to specialize the model's general capabilities toward a specific task, domain, or desired behavior pattern without learning from scratch. **How it works (technically):** SFT starts with a…

Where is Supervised Fine-Tuning used in 2026?

Llama 3.1 70B SFT on 15M instruction-output pairs filtered by a reward model to improve instruction following. OpenAI's GPT-4 SFT stage used a dataset of ~100K human-written prompt-response pairs before RLHF. Google's Gemma 2 27B SFT on a mixture of web text, code, and math data with a 0.1% learning rate for 2 epochs.