Attention Is All You Need is the 2017 research paper by eight researchers working mostly at Google that introduced the Transformer, a neural network architecture for sequence processing built entirely on attention mechanisms and without recurrence or convolution. Presented at the NIPS 2017 conference, it showed that attention alone could match and exceed the best machine translation systems of the time while training far faster on parallel hardware.
In AI history, the paper marks the turning point between the era of recurrent neural networks and the era of large language models. Almost every major language system that followed, including BERT, the GPT series, GPT-3 and GPT-4, uses the Transformer or a close descendant, which makes the paper one of the most cited works in computer science.
The problem the paper set out to solve
Before 2017, the leading approach to machine translation was the sequence-to-sequence model built from recurrent networks, usually LSTM or GRU layers, often combined with an attention mechanism introduced in 2014. Recurrent networks process tokens one step at a time, so each step must wait for the previous one. This sequential bottleneck limited how well training could use GPUs and made long-range dependencies hard to learn.
Convolutional alternatives such as ByteNet and ConvS2S improved parallelism, but the number of operations needed to relate two distant positions still grew with their distance. The authors proposed removing recurrence altogether and letting every position attend directly to every other position in a single layer.
| Layer type | Sequential operations | Maximum path length | Main drawback |
|---|---|---|---|
| Recurrent | Grows with sequence length | Grows with sequence length | Little parallelism |
| Convolutional | Constant | Grows logarithmically or linearly | Needs deep stacks for long range |
| Self-attention | Constant | Constant | Cost grows quadratically with length |
Core ideas of the Transformer architecture
The Transformer keeps the familiar encoder-decoder structure but builds both halves from stacked attention and feed-forward layers. Its central operation is scaled dot-product attention: each token produces a query, a key and a value vector, and the output is a weighted sum of values, with weights computed from query-key similarity and divided by the square root of the key dimension to keep gradients stable.
Multi-head attention runs several attention operations in parallel, letting the model capture different kinds of relationships at once. Because attention ignores word order, the paper adds sinusoidal positional encodings to the input embeddings. Residual connections and layer normalization around every sublayer make the deep stack trainable.
| Component | Function | Base model setting |
|---|---|---|
| Scaled dot-product attention | Weights values by query-key similarity | Key dimension 64 |
| Multi-head attention | Parallel attention subspaces | 8 heads |
| Positional encoding | Injects token order | Sine and cosine functions |
| Position-wise feed-forward network | Transforms each token independently | Inner size 2,048 |
| Encoder and decoder stacks | Build representations and generate output | 6 layers each, model width 512 |
| Masked self-attention | Prevents the decoder from seeing future tokens | Applied in every decoder layer |
Results reported in 2017
The paper evaluated the Transformer on the WMT 2014 translation benchmarks. The large model reached 28.4 BLEU on English-to-German, more than 2 BLEU above the previous best results including ensembles, and 41.8 BLEU on English-to-French, a new single-model state of the art.
Equally important was the training cost. The large model trained in about 3.5 days on eight GPUs, a small fraction of the compute used by competing systems. The authors also applied the model to English constituency parsing with strong results, an early sign that the architecture generalized beyond translation.
| Measure | Base model | Big model |
|---|---|---|
| Parameters | About 65 million | About 213 million |
| English-German BLEU | 27.3 | 28.4 |
| English-French BLEU | 38.1 | 41.8 |
| Training time on 8 GPUs | About 12 hours | About 3.5 days |
Influence on later AI systems
The paper’s impact came less from translation scores than from scalability. Because self-attention parallelizes well, Transformers could be trained on far larger data sets and with far more parameters than recurrent models. Within two years, encoder-only models such as BERT and decoder-only models such as GPT showed that pretraining a Transformer on unlabeled text produced powerful general-purpose language representations.
The architecture then spread beyond text into vision, speech, protein structure prediction and multimodal systems. The scaling behavior it enabled led directly to models such as GPT-3, instruction-tuned assistants and open models such as Alpaca and Vicuna, and it underpins the AI boom of the 2020s.
| Lineage | Uses which part | Representative systems |
|---|---|---|
| Decoder-only language models | Decoder stack | GPT-3, GPT-4, LaMDA |
| Encoder-only models | Encoder stack | BERT, RoBERTa |
| Encoder-decoder models | Full architecture | T5, modern translation systems |
| Vision Transformers | Encoder on image patches | ViT and successors |
Common misreadings of the paper
The paper did not invent attention; attention for neural translation dates to 2014, and the contribution was showing that attention could replace recurrence entirely. The title is a claim about one architecture for sequence transduction, not a general statement that other mechanisms are obsolete.
- Quadratic cost remains: self-attention scales with the square of sequence length, which later work on efficient attention tries to reduce.
- Positional encoding has evolved: most current models use learned or rotary position schemes rather than the original sinusoids.
- Normalization placement changed: later models usually apply layer normalization before each sublayer for more stable training.
Another frequent misreading treats the 2017 Transformer as identical to the models built on it. The original design was a translation model trained on paired sentences, with no large-scale pretraining and no instruction tuning. The idea of pretraining on vast unlabeled text and the scaling laws that guide modern model sizes came from later research that adopted the architecture, not from the paper itself.
A non-technical view
Older translation programs read a sentence one word at a time, like a person following text with a finger. That was slow, and they often forgot the beginning of a long sentence.
This paper proposed a different design. The new model looks at all the words at once and decides which words matter most for each other word. It is like reading a whole page and drawing lines between related words. This design was faster to train and gave better results. It became the foundation of today’s chatbots and many other AI tools.
A concrete example
Consider the English sentence “The trophy did not fit in the suitcase because it was too big.” To translate it into German, a system must decide whether “it” refers to the trophy or the suitcase, because German uses different pronouns for different grammatical genders. A recurrent model had to carry that information through many sequential steps and often lost it.
In a Transformer, the attention heads processing “it” can assign high weight directly to “trophy” in a single layer, regardless of the distance between the words. Analyses of trained models show individual heads specializing in such pronoun resolution. A translation team that replaced a recurrent system with a Transformer in the late 2010s would typically see both higher translation quality and much shorter training runs, which is why the architecture spread across the industry within a few years of the paper.