1. Query & Key Projections
Each token vector generates a Query ($Q$), Key ($K$), and Value ($V$). The dot product $Q \cdot K^T$ measures conceptual alignment and relevance between pairs of tokens regardless of spatial distance.
2. Scaled Softmax Normalization
Dividing by $\sqrt{d_k}$ prevents large magnitude vectors from pushing the Softmax function into regions with near-zero gradients. Softmax normalizes row weights into a valid probability distribution summing to 1.
3. Multi-Head Specialization
Parallel attention heads compute distinct subspace representations simultaneously: one head captures pronoun coreference, another tracks syntax, and others retain local or long-range dependencies.