Transformer Self-Attention: Query/Key/Value Heatmap (2D)
2D self-attention lab: real query/key/value matrix projections, scaled dot-product scores and a live softmax heatmap over a token sequence — click a token to see exactly what it attends to.
This 2D companion runs the exact scaled-dot-product self-attention computation behind the 3D scene on a plain canvas built for reading the math rather than orbiting a scene: fixed token embeddings are projected through real query, key and value weight matrices, attention scores are computed as Q·Kᵀ divided by √d_k, and a genuine softmax turns them into a token-by-token attention-weight heatmap — click any token to make it the active query and see precisely which other tokens it attends to, with every row's weights verified to sum to 1.0 regardless of the temperature setting.
2D self-attention lab with real query/key/value matrix projections, scaled dot-product scores and a live softmax heatmap over an adjustable-length token sequence, recomputed on every parameter change.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install