Computational Circuit Stage
Click any token or matrix cell to inspectMathematical Inspector
Select elements to reveal real-time vector arithmetic.
Select elements to reveal real-time vector arithmetic.
Computes alignment weights: Softmax((Q·Kᵀ)/√d_k)·V. The scale factor √d_k prevents dot products from growing excessively large in high dimensions, preventing vanishing softmax gradients.
Multiple attention heads project representations into distinct subspaces, allowing the model to simultaneously attend to syntax, coreference, and positional dependencies.
Standard self-attention scales at O(N²) with sequence length N because each token computes pairwise dot products against every other token in the sequence.