A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Knowledge Distillation

Research Depth 92 in the knowledge graph I know this Set as goal
640prerequisites beneath it
See this on the map →
Neural Network FundamentalsAdvanced Ensemble Methods
distillation teacher-student compression

Core Idea

Knowledge distillation transfers knowledge from large, accurate teacher models to smaller, faster student models by training students to mimic teacher outputs. Using soft probability distributions instead of hard labels provides richer supervision signals. Students achieve similar accuracy with orders of magnitude fewer parameters.

Explainer

From your work with neural networks, you know that larger models with more parameters generally achieve better accuracy — but they also consume more memory and compute at inference time. A massive model that takes seconds per prediction is useless in a real-time application. Knowledge distillation solves this by training a small, efficient student model to reproduce the behavior of a large, powerful teacher model, capturing most of the teacher's accuracy at a fraction of the cost.

The key insight is in *what* the student learns from. In standard supervised learning, the model trains against hard labels — a cat image gets the label "cat" and nothing else. But the teacher model produces soft targets: a probability distribution like 0.85 cat, 0.10 tiger, 0.03 lynx, 0.02 other. These soft probabilities carry far more information than a hard label. The fact that the teacher thinks "tiger" is more likely than "car" reveals something about the visual structure of the image — the student learns not just the right answer but the *relationships between classes*. This is sometimes called the "dark knowledge" hidden in the teacher's outputs.

In practice, the teacher's output probabilities are sharpened by a temperature parameter applied to the softmax function. At temperature T=1 (normal softmax), the dominant class often has probability near 1.0, washing out the informative relationships among other classes. Raising the temperature to T=3 or T=5 produces softer distributions that spread probability mass more evenly, making the inter-class relationships more visible to the student. The student is then trained on a weighted combination of two losses: one matching the soft teacher outputs (at high temperature) and one matching the true hard labels (at normal temperature).

The results can be striking. A student network with 10x fewer parameters than the teacher often recovers 95% or more of the teacher's accuracy. If you have studied ensemble methods, you will recognize a connection: an ensemble of models can serve as the teacher, and distillation compresses that ensemble's collective knowledge into a single small network. This is how knowledge distillation bridges the gap between the accuracy of large-scale training and the efficiency demands of deployment — you train big, then distill small.

Practice Questions 5 questions

Prerequisite Chain

Understanding ZeroThe Number ZeroCounting to FiveCounting to 10Counting to 20Counting a Set of Objects Up to 20Cardinality: The Last Number CountedMatching Numerals to QuantitiesSubitizing Small QuantitiesAddition Within 10Number Bonds to 10Addition Within 20Doubles and Near DoublesDoubles Facts Within 10Near Doubles Facts Within 20Mental Math Strategies for AdditionMental Math: Adding and Subtracting TensAddition Within 100Repeated Addition as MultiplicationMultiplication as Equal GroupsMultiplication: ArraysBasic Multiplication Facts (0s, 1s, 2s, 5s, 10s)Multiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Multiplication and Division Fact FamiliesRelationship Between Multiplication and DivisionDivision Facts as Inverse of MultiplicationRemainders and Quotients in DivisionDivision Word ProblemsMulti-Step Word ProblemsSolving Multi-Step Word ProblemsMultiplication Word ProblemsDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueIntegers and the Number LineComparing and Ordering IntegersAbsolute ValueAdding IntegersSubtracting IntegersMultiplying IntegersDividing IntegersUnit RatesProportionsPercent ConceptConverting Between Fractions, Decimals, and PercentsOperations with Rational NumbersTwo-Step EquationsSolving Multi-Step EquationsEquations with Variables on Both SidesAngle Pairs: Complementary, Supplementary, and VerticalParallel Lines and TransversalsCorresponding AnglesAlternate Interior AnglesTriangle Angle Sum TheoremExterior Angle TheoremTriangle Inequality TheoremSimilar Triangles: AA SimilaritySimilar Triangles: SSS and SAS SimilarityProportions in Similar TrianglesRight Triangle Trigonometry IntroductionSine, Cosine, and Tangent RatiosTrigonometric Ratios ReviewRadian MeasureConverting Between Degrees and RadiansThe Unit CircleGraphing Sine and CosineGraphing Tangent and Reciprocal Trigonometric FunctionsDerivatives of Trigonometric FunctionsAntiderivativesIndefinite IntegralsBasic Integration RulesRiemann SumsDefinite Integral DefinitionProbability Density Functions and Continuous DistributionsCumulative Distribution FunctionsContinuous Random VariablesProbability Density FunctionsExpected ValueLinear Regression in Machine LearningNeural Network FundamentalsKnowledge Distillation

Longest path: 93 steps · 640 total prerequisite topics

Prerequisites (2)

Leads To (0)

No topics depend on this one yet.