Log inStart free
LESSON 36.01 · 5 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Knowledge distillation with soft targets

A small net learns from a large net's softened guesses, not only from labels.


Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 36.01 · DISTILLATION BAYTEACHER · 99 PARAMS · 94% RIGHT
01
Stage 1 of 5 · The teacher
The teacher model is a trained net with 16 hidden units. Its guesses on 169 test points are 94% right.
Explain it simply

On the left you see 72 points in three classes: circles, squares and triangles. The teacher is a big net with 99 parameters. The small blue marks are its guesses on a grid of test points. Only 10 of them are wrong, in red.

A plane with 72 training points in 3 classes and a grid of 169 test guesses. The teacher net, 16 hidden units and 99 parameters, gets 159 of 169 right.

points x (circle 0, square 1, triangle 2)weights, temperature Tlogits, probabilities, guessesloss, wrong guessestrue class borders, the target (hard label or soft target)
−3−30033x₁x₂the teacherteacher's guesses on the test gridteacher · 16 hidden units · 99 parametersx₁, x₂−3−30033x₁x₂the teacherteacher's guesses on the test gridteacher · 16 hidden units · 99 parametersx₁, x₂
Toy: 72 points in 3 classes; teacher 2-16-3; the 2-4-3 student trains in the browser on 9 points
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
z=W2 tanh⁡(W1x+b1)+b2\sy{z}{out}{z} = \sy{w}{param}{W_2}\,\tanh(\sy{w}{param}{W_1}\sy{x}{data}{x} + b_1) + b_2
teacher: 99 parameters, 159/169=94%\text{teacher: } 99\text{ parameters, } 159/169 = 94\%

The net turns a point into three scores, one per class.

Common mix-ups

MYTHThe teacher's plain probabilities already show what it knows.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01Set T to 1. Does the student still beat the hard-label student by a wide margin?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
  • 4 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.