Knowledge Distillation

Knowledge distillation trains a student model to match a teacher model. The teacher can be a larger model, an ensemble, a stronger checkpoint, or a model with access to a richer training signal.

Given teacher logits and student logits , temperature-scaled probabilities are:

where is the distillation temperature. Higher softens the teacher distribution and exposes similarity between classes.

The distillation loss is often a KL divergence or cross-entropy between teacher and student probabilities:

The factor is commonly used to keep gradient scale comparable across temperatures.

When hard labels are available, training can combine supervised and distillation losses:

where controls the hard-label versus teacher-signal tradeoff.

Distillation Targets

Distillation is broader than class-probability matching.

TargetExampleMain check
logits/probabilitiesclassifier compressioncalibration and class slices
embeddingsrepresentation transferretrieval or downstream task quality
sequenceslanguage/model output imitationexactness, diversity, hallucination
rankingsreranker or recommender distillationranking metrics and hard negatives
trajectoriesagent/tool tracescompletion and side-effect correctness
preferencespolicy optimizationreward hacking and held-out preference data

The target determines the loss and verifier.

Teacher Boundary

The teacher is a data source. Its provenance matters.

Teacher propertyWhy it matters
training datamay include benchmark or private data
calibrationsoft labels may be overconfident
domain coveragestudent inherits teacher blind spots
generation policysynthetic outputs depend on decoding
hidden tools/retrievalteacher answer may use unavailable evidence

Public notes should not imply ground truth if the teacher signal is only a model-generated label.

Evaluation Boundary

MetricWhat it proves
teacher agreementstudent imitates teacher
ground-truth metricstudent solves task
calibration metricprobabilities remain meaningful
slice/OOD metricrare cases and transfer behavior
cost/latency metriccompression or deployment benefit

Distillation is successful only if it improves the intended tradeoff, not merely agreement.

Uses

  • Compress a large model into a smaller deployable model.
  • Transfer behavior from an ensemble or stronger checkpoint.
  • Train a specialized model from weak labels generated by a teacher.
  • Distill generation, ranking, retrieval, or policy behavior into a cheaper model.

Risks

  • The student can inherit teacher errors and biases.
  • Teacher confidence can hide uncertainty if probabilities are poorly calibrated.
  • Distillation may improve average performance while hurting rare cases.
  • Synthetic teacher labels can leak benchmark or private information if the data source is not controlled.

Checks

  • What is the teacher, and what data did it see?
  • Are teacher outputs logits, probabilities, labels, rationales, trajectories, or preferences?
  • Is the student evaluated against ground truth, not only teacher agreement?
  • Are temperature, loss weights, and teacher checkpoint documented?
  • Does distillation preserve calibration and out-of-distribution behavior?
  • Are private teacher prompts, hidden datasets, or unpublished results omitted from public notes?
  • Is teacher agreement separated from task correctness?
  • Does the student improve the claimed cost, latency, or deployment constraint?