Bring the mental model from Maximum Likelihood; this page will reuse it instead of restarting from zero.
Knowledge Distillation: Learning from Teachers
Train a smaller student to mimic a stronger teacher by matching soft probability distributions (often with temperature), transferring 'dark knowledge' beyond hard labels.
01
Intuition
Build the mental picture first so the rest of the page has something to attach to.
If you train a model on hard labels, every example is treated like a one-bit fact: "this is a cat."
A good teacher model knows more than that. It might say:
- 0.84 cat
- 0.12 dog
- 0.04 fox
Those "almost" probabilities carry what is often called dark knowledge: relative non-target probabilities can encode similarity structure learned from data. Distillation trains a student to match the teacher's distribution, so the student can inherit the teacher's behavior even with fewer parameters or a different architecture.
In LLMs, distillation often extends the same intuition to next-token distributions: a smaller model is trained to approximate a larger model's token probabilities. Speculative decoding uses a fast draft model as an approximation to the final model; the draft may be distilled, but speculative decoding's correctness comes from verification rather than distillation itself.
Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.
02
Math
Translate the story into symbols, assumptions, and a derivation you can inspect.
Let the teacher and student produce logits zT(x) and zS(x) over a discrete output space.
With temperature τ>0, define softened probabilities:
A standard modern way to write the soft-target distillation term is teacher-student KL divergence; with a fixed teacher distribution, this is equivalent to soft-target cross-entropy up to a teacher-only constant:
where:
The second term can be a hard-label loss for classification or a standard next-token loss in an LLM setting.
Rule of thumb: increasing τ makes the teacher distribution softer (more informative about non-top classes), but if τ is too large it becomes nearly uniform and carries little signal.
Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.
03
Code
Keep the implementation aligned with the notation so the algorithm is legible.
import numpy as np
def softmax(z, tau=1.0):
z = z / tau
z = z - z.max()
e = np.exp(z)
return e / e.sum()
def kl(p, q):
eps = 1e-12
return float(np.sum(p * (np.log(p + eps) - np.log(q + eps))))
teacher_logits = np.array([4.0, 2.0, 0.0])
student_logits = np.array([3.0, 0.5, -0.5])
for tau in [1.0, 2.0, 4.0]:
pT = softmax(teacher_logits, tau)
pS = softmax(student_logits, tau)
print("tau=", tau, "pT=", np.round(pT, 3), "pS=", np.round(pS, 3), "KL=", round(kl(pT, pS), 3))
Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.
04
Interactive Demo
Use direct manipulation to connect the explanation to a moving system.
Live Concept Demo
Explore Knowledge Distillation: Learning from Teachers
The stage is code-native and interactive. Use it to test the explanation against the mechanism.
Manipulate one control and predict the visible change.
Choose what to inspect in Knowledge Distillation: Learning from Teachers. This shared fallback is an observation guide, not evidence of learning.
The demo below asks you to predict the largest non-label pull before revealing the softened teacher distribution. The key invariant is that distillation transfers structure in the teacher's non-argmax probabilities, not only the hard top label.
Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.
Concept: Knowledge Distillation: Learning from Teachers
What is the smallest example that makes Knowledge Distillation: Learning from Teachers click without losing the math?
Object contextEfficiency
concept:efficiency/knowledge-distillationKnowledge Distillation: Learning from Teachers
What is the smallest example that makes Knowledge Distillation: Learning from Teachers click without losing the math?
Start with the prediction checkpoint, then compare the reveal to the mental model.
Take this moveStudy modes
Keep the object fixed; change the lens.Route back through the notebook
Carry the same object through intuition, math, code, and demo.
Train a smaller student to mimic a stronger teacher by matching soft probability distributions (often with temperature), transferring 'dark knowledge' beyond hard labels.
The next edge should feel earned: use the demo prediction here before following Speculative Decoding: Lossless Multi-Token Generation.
After The First Pass
Turn the concept into an inspected object.
The lower panels are one second act: keep the object fixed, inspect it visually, check source boundaries, practice transfer, then attach the research question.Mechanism Storyboard
See the idea move before the page explains it
Train a smaller student to mimic a stronger teacher by matching soft probability distributions (often with temperature), transferring 'dark knowledge' beyond hard labels.

Start with the picture, metaphor, or geometric mechanism.
Before reading further, choose the kind of change Knowledge Distillation: Learning from Teachers should make visible.
Visual Inquiry
Make the image answer a mathematical question
Train a smaller student to mimic a stronger teacher by matching soft probability distributions (often with temperature), transferring 'dark knowledge' beyond hard labels.
Which visible object should carry the first intuition?
Pick the cue that should make Knowledge Distillation: Learning from Teachers easier to reason about before the page gives the answer.
Source Grounding
Canonical references for the mechanism on this page.
What is the smallest example that makes Knowledge Distillation: Learning from Teachers click without losing the math?
concept:efficiency/knowledge-distillationsources: hinton-2015-distillation
Open the closest source note before trusting the local explanation.
1 selected-object source shown first; 1 reference total.
Audit the claim boundary, then ask from the same selected object.
Grounds temperature-softened soft targets and the incorrect-class probability-ratio/similarity-structure intuition used by the page.
Hinton et al. define softened class probabilities with temperature, train the distilled model to match teacher soft targets, say incorrect-answer probability ratios encode rich similarity...
This checks Hinton-style finite-class soft-target distillation. It does not check sequence-level LLM distillation recipes, speculative-decoding correctness, teacher quality, capacity matc...
Claim Review
Train a smaller student to mimic a stronger teacher by matching soft probability distributions (often with temperature), transferring 'dark knowledge' beyond hard labels.
What is the smallest example that makes Knowledge Distillation: Learning from Teachers click without losing the math?
concept:efficiency/knowledge-distillationsources: hinton-2015-distillation
Treat every claim as provisional until source support and a local witness agree.
1 structured claim check on this concept.
Run the prediction or practice transfer before asking for a grounded review.
Publisher-side editorial review is not independent replication. Claims without it still need exact source-support review. 1 reference and 3 local witnesses are available for inspection.
Hinton et al. define softened class probabilities with temperature, train the distilled model to match teacher soft targets, say incorrect-answer probability ratios encode rich similarity structure, and mix...
This checks Hinton-style finite-class soft-target distillation. It does not check sequence-level LLM distillation recipes, speculative-decoding correctness, teacher quality, capacity matching, data filtering...
Hinton et al. support high-temperature soft targets, matching the teacher at the same temperature, incorrect-class probability ratios as similarity structure, and weighted soft-target plus hard-label cross-entropy with T^2 scaling. Oracle accepted the page's fixed-teacher KL form as cross-entropy-equivalent and the toy math/code/demo as witnesses for tau-softmax, tau^2 KL, non-label pull, and hard/KD mixing.
Reviewer: codex+oracle; reviewed 2026-05-07Practice notebook
Use the idea, then test it somewhere new
Train a smaller student to mimic a stronger teacher by matching soft probability distributions (often with temperature), transferring 'dark knowledge' beyond hard labels.
What is the smallest example that makes Knowledge Distillation: Learning from Teachers click without losing the math?
concept:efficiency/knowledge-distillationsources: hinton-2015-distillation
Use one state from Knowledge Distillation: Learning from Teachers to explain what changes, why it changes, and which assumption the explanation needs.
No learner move yet; no learning state is inferred.
Write first, use only the help you need, then try a new case without it.
Use one state from Knowledge Distillation: Learning from Teachers to explain what changes, why it changes, and which assumption the explanation needs.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Write an attempt before asking the companion.
0 of 3 progressive hints opened.
This draft and any AI response do not establish mastery; a later unassisted case can.
- ObjectConceptKnowledge Distillation: Learning from Teachers
- PredictBefore revealKnowledge Distillation: Learning from Teachers prediction
- WitnessCompare codeKnowledge Distillation: Learning from Teachers code witness 1
- RoomAsk groundedChecking local snapshot
Research Room
Attach the question to an exact object
Pick the concept, equation, source, code witness, claim, misconception, or demo state before asking for help. The handoff stays grounded to that object.Open the draft below to save one note and next action in this browser.
Knowledge Distillation: Learning from Teachers
What is the smallest example that makes Knowledge Distillation: Learning from Teachers click without losing the math?
These are fixed, deterministic perspectives derived from the selected object. They do not represent people, community contributions, or independent review.
Source ids hinton-2015-distillation must support the exact object, not just the surrounding topic.
Treat this as a mechanism object: connect the definition to one equation, code witness, or demo before broadening the discussion.
Ask the learner to perturb one representation, then check whether the same invariant survives in math, code, and demo.
The learner can state the mechanism in their own words
Local action draftNo local draft saved yetExpand only when ready to capture one local next action
This draft stays locally in this browser for concept:efficiency/knowledge-distillation.
- Source ids to inspect: hinton-2015-distillation
- Definition, prerequisite, and contrast concept links
- The equation or code witness that makes the concept operational
- One demo state that shows the invariant instead of a slogan
- The learner can state the mechanism in their own words
- The learner can name the prerequisite that would repair confusion
- The learner can predict how the mechanism changes under one perturbation
I am working in Continuous Function's research reading room. Object: concept - Knowledge Distillation: Learning from Teachers Object key: concept:efficiency/knowledge-distillation Context: Efficiency Anchor id: concept/concept-notebook/efficiency/knowledge-distillation Open question: What is the smallest example that makes Knowledge Distillation: Learning from Teachers click without losing the math? Evidence to inspect: - Source ids to inspect: hinton-2015-distillation - Definition, prerequisite, and contrast concept links - The equation or code witness that makes the concept operational - One demo state that shows the invariant instead of a slogan Deterministic role lenses for this object: - Boundary: fixed perspectives, not people, community contributions, or independent review - Source-checking summary: Treat this as a mechanism object: connect the definition to one equation, code witness, or demo before broadening the discussion. - Proposed experiment: Ask the learner to perturb one representation, then check whether the same invariant survives in math, code, and demo. - Teach/transfer move: Turn the mechanism into one sentence that predicts a neighboring concept. - Assumptions: - Source ids hinton-2015-distillation must support the exact object, not just the surrounding topic. - The stable content-object key lets local drafts, prompts, and route memory attach without changing the source page. - The concept explanation is local atlas prose until checked against its math, code, and source support. - Prerequisite gaps should become a repair route, not a reason to leave the object vague. - Role-lens requests: - Learner: ask for "Ask what would make "Knowledge Distillation: Learning from Teachers" feel predictable rather than familiar." | assumption: Source ids hinton-2015-distillation must support the exact object, not just the surrounding topic. | next action: The learner can state the mechanism in their own words - Researcher: ask for "Source ids to inspect: hinton-2015-distillation" | assumption: The stable content-object key lets local drafts, prompts, and route memory attach without changing the source page. | next action: The learner can name the prerequisite that would repair confusion - Experimenter: ask for "Choose one variable or condition to perturb before asking for an explanation." | assumption: The concept explanation is local atlas prose until checked against its math, code, and source support. | next action: The learner can predict how the mechanism changes under one perturbation - Professor: ask for "Find the smallest transferable rule a learner could reuse without the AI." | assumption: Prerequisite gaps should become a repair route, not a reason to leave the object vague. | next action: Teach or transfer: Turn the mechanism into one sentence that predicts a neighboring concept. What would resolve this: - The learner can state the mechanism in their own words - The learner can name the prerequisite that would repair confusion - The learner can predict how the mechanism changes under one perturbation Answer as a careful research tutor: stay source-grounded, separate verified evidence from assumptions, name the relevant math objects, and end with one next action. Current deterministic role lens for this object: - Role lens: Learner - Evidence request: Ask what would make "Knowledge Distillation: Learning from Teachers" feel predictable rather than familiar. - Assumption to keep visible: Source ids hinton-2015-distillation must support the exact object, not just the surrounding topic. - Proposed experiment: Ask the learner to perturb one representation, then check whether the same invariant survives in math, code, and demo. - Next action: The learner can state the mechanism in their own words
concept/concept-notebook/efficiency/knowledge-distillation
concept:efficiency/knowledge-distillation