LESSON 9.02 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW
Softmax and its numerics
Watch 6 scores turn into weights, and see why softmax subtracts the max first.
Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.
Go Pro · $8.25/moEXPLAINER · 9.02 · SOFTMAX BAY6 SCORES · MAX 2.89 · FLOAT32
01
Stage 1 of 6 · The scores
The query "sat" gives 6 scores s, one per key (9.01). Softmax turns them into weights that add up to 1.
Explain it simply
Each row is one key. Its bar is the score: how well that key matches the query "sat". A score can be negative or large. Here the largest is 2.89, on "the". Softmax turns the row into positive weights that add up to one. Scores are rounded to 2 decimals, so weights may differ from 9.01 in the third decimal.
Six rows, one per key. The scores are 2.89, 1.52, −1.50, −0.96, −0.29, 0.62. The largest is on "the".
scores, terms and weights amax minf and NaNrounds to 0
Toy: the query "sat" of 9.05's 6 tokens · 1 head · scores to 2 decimals · random weights, not trained
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
Each score says how well key i matches the query.
PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
- 5 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.