LESSON 9.01 · 6 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW
Queries, keys, values and attention scores
Watch one token's query score every key, then mix the values.
Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 2 controls and 3 checks, in this lesson and every other.
Go Pro · $8.25/moEXPLAINER · 9.01 · ATTENTION BAYQUERY SAT · 4 NUMBERS PER TOKEN
01
Stage 1 of 6 · Queries
W_Q turns each token vector into a query. The query says what the token looks for.
Explain it simply
Each row on the left is one word as 4 numbers. Multiply a row by the ochre grid, W Q, and you get its query. A query is like a search phrase: it says what this word looks for. These grids hold seeded random numbers; a trained model learns its own.
Six token rows of 4 cells. Each row times W Q gives a query row. The query of “sat” is marked.
token vectorsweight matricesscores and output
Toy: 6 tokens, width 4, seeded weights (not trained)
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
The query is the token vector times the query weights.
PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
- 5 more stages and 2 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.