Inspect self-attention mechanisms, multi-head routing, QKV projections, and residual transformations step by step.
Every token is mapped into an initial embedding $E_i \in \mathbb{R}^{d}$ and added with a sinusoidal positional vector $P_i$.
X[i] = TokenEmbedding(t_i) + PositionalEncoding(i, d)
Linear projections transform input $X$ into Query (Q) (what token seeks), Key (K) (what token contains), and Value (V) (content broadcasted).
Contextual output $Z = A \cdot V$ passes through a Residual Connection ($X + Z$), LayerNorm, and a 2-layer Feed-Forward Network (FFN).
Inspect how token representations change from isolated static embeddings to fully contextualized vectors.
The final token's contextualized vector is projected via Language Model head ($W_{vocab}$) to compute next-token probabilities.