Select a sentence and watch the attention heatmap light up. Step through Query, Key, and Value vectors to see how transformers resolve word ambiguity through context.
Sign in to save progress
Click a row to highlight that token's attention pattern. Hover a cell to inspect the weight.
Y-axis: attending token (Query) · X-axis: attended-to token (Key) · Color intensity = attention weight
Query (Q)
What am I looking for?
Each token projects itself into "query space", essentially asking: what context do I need to understand myself?
Scaling by √dₖ prevents vanishing gradients in high dimensions.
Multiple heads run in parallel, each learning different relationship types simultaneously.
Head 1: Syntactic
Head 2: Semantic
Head 3: Positional
Multiple heads capture different relationships simultaneously.
The attention mechanism runs in O(n²) time: processing a 10K token sequence requires 100M attention computations. This is why context window scaling is challenging.