Transformer: Attention Is All You Need (2017, Vaswani et al.)
arXiv: 1706.03762v7
The Core Problem
In machine translation, an RNN behaves like a word-by-word interpreter—each token must wait for the previous one to be processed. This sequential dependency makes training slow, and information from early tokens degrades by the time it reaches long-range positions. CNNs offer some parallelism but need many stacked layers to connect distant words. Is there a way for all tokens to "see each other" at once—parallel, fast, and without losing long-range information?
Method and Innovations
The paper's answer is the attention mechanism: instead of passing information like a relay baton layer by layer, every token directly "converses" with every other token. Like a meeting where everyone speaks at once but a scoring system (softmax) makes each participant focus only on the most relevant speakers.
Three key architectural designs:
1. Multi-Head Attention (MHA): Each token's representation is split into 8 heads that independently learn different relation types—one captures syntax, another semantics, another coreference—like 8 experts analyzing the same text simultaneously. 2. Positional Encoding (PE): Since attention is position-agnostic, the paper uses sine/cosine encodings of different frequencies, giving each position a "fingerprint" added to the token embedding. High-frequency waves distinguish nearby positions; low-frequency waves distinguish distant ones. 3. Residual Connections + LayerNorm: Information can take a "shortcut" (residual) or undergo "deep processing" (attention/FFN), with LayerNorm preventing numerical instability.
Key Numbers
- WMT 2014 English-German: 28.4 BLEU, beating the previous best (including ensembles) by 2 BLEU
- WMT 2014 English-French: 41.8 BLEU, single-model SOTA
- Training cost: 8 GPUs, 3.5 days—a fraction of the previous best models
- Parameters: 65M (base), 213M (large)—tiny by today's standards, enormous at the time
Impact
This paper defined the entire LLM era. GPT, BERT, T5, LLaMA, DeepSeek—every modern large model is built on the Transformer skeleton. It proved that "attention is all you need": no recurrence, no convolution, just attention plus feed-forward layers can do anything.
Feynman-Style Commentary
> The paper's real value isn't inventing attention—that existed in earlier work. Its true contribution is proving one thing: when you design a sufficiently general "mutual attention" mechanism, add "position labels" and an "information highway" (residuals), both recurrence and convolution become unnecessary. It makes you rethink: is deep learning's core about step-by-step processing or global association? The answer is the latter.
---
arXiv: 1706.03762v7