This page assumes you have seen nothing. Before you can read the parent note Knowledge Distillation, every letter and squiggle it uses is built here, one at a time, each earning its place before the next arrives.
A model looking at a photo of {cat, dog, car} produces three raw numbers — one per option. These raw, unbounded numbers are called logits.
Figure s01 — reading the logits. Three bars, one per option: magenta = cat, violet = dog, orange = car. Their heights are the logit values (z=4,1,−2), printed above each bar. Notice the car bar dips below the zero line drawn in navy — logits are allowed to be negative, as the arrow annotation points out. But we cannot use raw scores as probabilities, because probabilities must (a) never be negative and (b) add up to exactly 1. That is the job of the next tool.
To turn any score into something never-negative, we need a function that:
takes any real number in, and
always spits out a positive number.
The exponential function ex does exactly this. Here e≈2.718 is a fixed constant (just a number, like π).
Figure s02 — the exponential curve. The magenta curve is ex; the violet dots mark the sample values above. Read two things off it: (1) the curve never touches the navy zero line — output is always positive, highlighted by the orange "always > 0" arrow; (2) it climbs steeply on the right — small increases in x cause large increases in ex.
The parent note writes ∑jezj. That big Greek letter Σ (sigma) is just a compact way to say "add up a list".
Why do we need it? Because to make probabilities add to 1, we must divide each positive score by the total of all positive scores — and ∑ is how we write "the total".
Now we can read the parent note's central formula:
pi=∑jezjezi
Read it left to right in plain words:
pi = the probability the model assigns to option i (a number between 0 and 1).
Top (ezi): make this option's score positive.
Bottom (∑jezj): the total of all options' positive scores.
Divide → each option's share of the total. By construction they now add to 1.
Figure s03 — the softmax pipeline. For each option (cat, dog, car) three bars stand side by side: orange = the raw logit z, violet = its exponential ez (now all positive), magenta = the final probability (scaled ×60 just so the tiny values are visible). Follow one option left-to-right and you see the machine work: a possibly-negative score becomes positive, then the navy arrow "divide by the sum → adds to 1" turns the violet bars into the magenta shares printed above them (p=0.950,0.047,0.0023). That exponential middle step is why a trained model looks overconfident — the tiny probabilities on "dog" and "car" get crushed. Distillation's whole trick, temperature, is about un-crushing them.
Recall Why is the biggest logit still the biggest probability?
Because ex is increasing: a bigger input always gives a bigger output. So softmax preserves the ranking of the logits — it only re-scales how confident each one looks, never who wins. ::: Softmax preserves ranking; only the confidence spread changes.
We keep saying distribution. It just means "the full list of probabilities across all options", e.g. [0.9,0.099,0.001]. The parent uses K for how many options there are (3 for {cat,dog,car}; ~50,000 for an LLM's vocabulary). When the parent writes 1/K for the uniform case, that is "everyone gets an equal slice".
To train, we need a single number that says how far apart two distributions are. The building block is the logarithm log (specifically ln, the natural log — the inverse of ex).
Now the parent's loss line reads cleanly. Recall from §4 that qi is the student's probability for option i:
Lsoft=−∑ipilogqi
means: for every option i, take the teacher's opinion pi, multiply by the student's surprise −logqi, and add them up. Small when the student's distribution matches where the teacher put its weight.
y — the hard target / true label as a list with a single 1: for a real cat, y=[1,0,0]. This is a "one-hot" vector.
α (alpha) — a mixing weight between 0 and 1: how much to trust soft targets vs. hard labels. α=0.5 means "half and half".
T (temperature) — the star of the show, defined and pictured in Softmax and Temperature. Here just know: T is a positive number you divide every logit by before softmax, to flatten the distribution.
∂L/∂zi — the gradient: "if I nudge logit zi up a tiny bit, how much does the loss L change?" This is what training uses to improve the student. The curly ∂ just means "rate of change with respect to one variable while holding the others still".
Every node above is a symbol the parent uses. Follow the arrows: scores become probabilities, probabilities feed a "how-wrong" measure, temperature reshapes them, and the mixing weight and gradient assemble the final distillation loss.