Distillation trains a smaller student model to imitate a larger teacher, moving capability into a model that is faster and cheaper to serve.

DistillationDiagram with these labels, in reading order: run prompts; capture outputs; use for training; fine-tune; student learns from; Teacher Model; (GPT-4); Generate Outputs; and Traces; Synthetic Dataset; (Teacher Outputs); Student Model; (7B Distilled); Fine-Tune Student; on Dataset.run promptscapture outputsuse for trainingfine-tunestudent learns fromTeacher Model(GPT-4)Generate Outputsand TracesSynthetic Dataset(Teacher Outputs)Student Model(7B Distilled)Fine-Tune Studenton Dataset
Distillation Process Overview

Teacher outputs as training data

The classic method matches the teacher's full output distribution, known as soft logits. That carries more information than hard labels because it keeps the teacher's relative confidence across options. With large language models the usual route is data distillation:

  1. Run the teacher, for example GPT-4, over a set of prompts.
  2. Capture its answers and the reasoning behind them.
  3. Build a synthetic dataset from those outputs.
  4. Fine-tune the student on it with supervised fine-tuning (SFT).
  5. Evaluate the student on your task.

DeepSeek-R1's distilled Qwen and Llama variants follow this approach: DeepSeek fine-tuned them on about 800,000 samples generated by R1. So do many models trained on GPT-4 outputs. Check the provider's terms of service before training on a model's outputs.

Inherited blind spots and bias

A compiler turns high-level code into a lean binary and keeps the behavior. The student does something looser: it approximates the teacher statistically. It can copy the teacher's biases, blind spots and errors. How well it works depends on the quality of the teacher's outputs and the variety of the prompts used.

Bias transfer The student inherits the teacher's biases, which can cause unexpected behavior in production.

Serving cost and latency

A frontier model in production can be slow, costly and subject to provider rate limits. A smaller student, for example 7B parameters against a much larger teacher, cuts latency and cost, so you can serve more requests. How close the student gets to the teacher varies by task, so measure it on your own. You also keep the model under your own control, which helps with privacy.

When distillation fits and when it does not

SituationChoice
High volume, low latency, scoped domainDistilled student
Open-ended queriesFrontier model
Low volumeFrontier model
Rapidly changing informationFrontier model

Example scenario: a 72% student against a 90% teacher

Suppose the student scores 72% while the teacher holds 90%. Possible causes include too little or unrepresentative training data, or a distillation temperature set so low that the student copies the teacher's top predictions without learning the wider distribution.

DistillationDiagram with these labels, in reading order: Accuracy Drop; Check Temperature; Parameter; Check Data Quality; Raise Temperature; Clean Training Data; Retrain Student Model.Accuracy DropCheck TemperatureParameterCheck Data QualityRaise TemperatureClean Training DataRetrain Student Model
Distillation accuracy debugging
  • Check the distillation temperature. Temperatures above 1 soften the teacher's distribution and are common in distillation; tune the value on a validation set.
  • Confirm the training set is large enough and representative of the task.
  • Inspect the loss function to see whether it captures the student-teacher gap.

Raising the temperature softens the teacher's distribution, which can help the student learn it. Set a target, such as within 5% of the teacher, and track it after each change.

Back to the knowledge baseRequest an assessment