﻿# Knowledge distillation teaches from a distribution over alternatives

Knowledge distillation trains a student against a teacher distribution. Understand soft targets, temperature and why matching probabilities differs from copying sampled answers.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/distillation-soft-target-distribution/
Language: en

Knowledge distillation uses a teacher model to supervise another model, often a smaller student. One important form compares probability distributions rather than only hard labels. Understanding what the student observes explains what information can transfer and why the term distillation does not identify one universally interchangeable training procedure.

## Hard labels discard alternative probabilities

A hard target names one event. A soft teacher target also assigns relative mass to alternatives, exposing distinctions that disappear when only the most likely label is retained. Imagine a classifier deciding among several related categories: two alternatives can have different teacher support even when neither is selected. Matching that distribution can provide a different learning signal from training solely on the winning label. This is an explanation of the information channel, not a guarantee that all teacher uncertainty is correct or useful for the student’s intended task.

## Temperature changes the teacher comparison

The classical formulation can soften distributions using temperature and train the student to match the resulting targets under a declared loss. The corresponding gradient scaling matters in that recipe. Temperature here serves the training comparison; it should not be conflated with sampling a deployed chatbot’s response. Record how both teacher and student scores are transformed and how any hard-label objective is combined. Changing those details changes the training signal even if the same two model checkpoints and the same input examples are used.

## Text outputs provide a narrower observation

A dataset containing only a teacher’s generated answers does not expose the full next-token distribution at each step. It provides demonstrated sequences under a generation policy. Such sequence-based supervision can still be useful, but differs from direct soft-target access. Filtering, prompting and sampling determine which behaviors appear in that dataset. A student cannot recover unobserved teacher probabilities merely because the file was labeled distilled. Be explicit about whether the pipeline transfers logits, probabilities, selected labels or complete generated text, since these are distinct observable signals.

## Student capacity and evaluation remain constraints

Matching a teacher on a training distribution does not establish equivalence on every input. The student’s architecture, capacity and available optimization determine what it can represent. Evaluate held-out tasks, calibration where relevant and known teacher mistakes separately. Preserve the teacher revision and target-generation recipe for reproduction. A smaller artifact can be attractive operationally, but compression and quality are different measurements. This makes distillation a concrete supervision design whose retained information can be inspected rather than a claim that one model inherits every capability of another.

## Primary research and implementation references

- [Distilling the Knowledge in a Neural Network](https://arxiv.org/abs/1503.02531).

- [TinyBERT: Distilling BERT for Natural Language Understanding](https://arxiv.org/abs/1909.10351).

- [DistilBERT, a Distilled Version of BERT](https://arxiv.org/abs/1910.01108).

## Related engineering context

[Reproducible inference stacks: preserving a GPU pilot’s result](/journal/software-stack-reproducibility/); [A GPU inference benchmark you can trust](/journal/inference-benchmark-method/).
