The breakthrough behind the Transformer is almost embarrassingly simple to state: let every token directly attend to every other token, no matter how far apart they are. No recurrence, no convolution window, no sequential state. Just a learned similarity function between every pair of positions.
This single move is what unlocks everything else. It is why the architecture parallelizes across positions, why long-range dependencies stop suffering from gradient decay, and why the same architecture transfers from text to images to audio to protein sequences without changing.
The three-line core
You will see this formula every track from now on. Memorize the shape:
scores = Q @ K.T / sqrt(d_k)— every pair (i, j) gets a similarity score.weights = softmax(scores)— each row becomes a probability distribution over positions.output = weights @ V— each position's output is a weighted blend of all values.
Three matmuls and a softmax. That's the entire mechanism. Everything else in modern Transformer architecture — multi-head, positional encoding, KV-cache, GQA, RoPE, Flash Attention — is engineering polish on top of this core.
Where the cost lives
The price of "every token sees every token" is the (n × n) score matrix: O(n²) compute and memory in sequence length. For sequences up to a few thousand tokens this is cheap. For 1M tokens it isn't, and that's why a sub-industry exists around making attention efficient (Track 4).