the.ai

Attention / Core

verified

Query, Key, Value

Attention borrows its vocabulary from databases. Each position emits a query — what am I looking for — and every position also offers a key, advertising what it has. Queries and keys are matched to decide where to look; the value is what actually gets read once the match is made. Splitting the three lets a position advertise something different from what it delivers.

Viz primitive · attention-heatmaptokens = 8 · heads = 1
query ↓key →

8 queries against 8 keys; a brighter cell means more of that query's attention went to that key. Nothing is masked: every position can read every other, itself included.

Query rows against key columns, with weight shown by cell brightness. Drag the sequence length to see how many pairings the projection has to score.

8

Reviewed by opendroid · 2026-08-04