Direct manipulation of Self-Attention, QKV Projections, and Multi-Head Routing
Recurrent Neural Networks (RNNs & LSTMs) processed text sequentially token-by-token, creating an information bottleneck and preventing parallel training on GPUs. Self-attention connects every token to every other token in O(1) sequential steps, allowing massive web-scale dataset pretraining.
Think of Query (Q) as a search query you enter into YouTube. Keys (K) are the titles and tags of all videos in the archive. Values (V) are the actual video streams. The dot product (Q · K) measures keyword relevance; softmax turns it into a percentage, and we blend the corresponding videos together.
As vector dimension d_k increases, the magnitude of dot products grows large. In extreme magnitudes, the softmax function produces extremely small gradients (vanishing gradient problem), stopping the network from learning. Dividing by √d_k stabilizes variance at 1.0.