Inside the Transformer

Interactive Visual Deep-Dive into Self-Attention & Matrix Projections
1. Embeddings
1. Positional Embed
2. Q • K Projection
3. Softmax Matrix
4. V Context Output
Scaled Dot-Product Attention: Head 1 (Coreference)
Scale: √d_k = 2.0
Head 1 Specialty: Resolves long-range pronominal binding (e.g. mapping pronouns like "it" back to its antecedent "animal").
Tensor Inspector & Algebraic Breakdown
Select a cell
Current Token Vector Representation: Select token
Embedding Vector (Identity + Sinusoidal Positional):
Query (Q):
Key (K):
Value Context (V):
Hover over any cell in the Attention Matrix to see the live dot-product calculation: $$\text{Attention}(Q,K,V) = \text{softmax}\left(\frac{Q K^T}{\sqrt{d_k}}\right) V$$