LESSON 9.03 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW
Masking and causal masking
Watch a mask stop each token from reading later tokens and pad tokens.
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.03 · ATTENTION BAY6 TOKENS · SCORES −7.46 TO 3.39
01
Stage 1 of 6 · Raw scores
Each cell scores how strongly a query token looks at a key token.
Explain it simply
Each row is a token that asks, and each column is a token it could read. The number in a cell is the score: the dot product of the query and the key, divided by 2. A higher score means a stronger pull. Nothing yet stops a token from reading the tokens after it.
A grid of 6 by 6 scores. Rows are queries and columns are keys. The scores run from −7.46 to 3.39.
Weights are random, not trained.
values Vpositive scores, weights, outputs znegative scores, leaked weight, gapblocked cell
Toy: 6 tokens, width 4, one head
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
Each score is a query times a key, divided by the root of 4.
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.