FDEInterviews logo
★ Read firstNeurIPS 2017

Attention Is All You Need

The 2017 Google paper that introduced the Transformer: attention and position information in place of recurrent and convolutional layers.

Breakdown by FDE Interviews · 12 min read · Updated

About the original · 2017
AUTHORS
Vaswani, Shazeer, Parmar, Uszkoreit, Jones, Gomez, Kaiser, Polosukhin
FROM
Google Brain, Google Research
PUBLISHED
Jun 2017 · NeurIPS 2017
CITED BY
197,225Semantic Scholar · Oct 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 19% of this breakdown.

01

The paper in one minute

In 2017 the best translation systems were recurrent networks. They read a sentence the way you read a news ticker: one word, then the next, carrying a running summary forward. That design had two costs. Training could not be spread across the words of a sentence, because step nine needs step eight. And a word at the start of a long sentence had to survive every step in between before it could shape a word near the end.

Eight researchers at Google removed the recurrence. Their model, the Transformer, lets every word look directly at every other word through attention, a learned and weighted lookup, and it does this for all the words at the same moment. Stack six of those layers, add a signal for word order, and that is most of the model.

It won on quality and on cost together, which almost never happens. The big model set a new English-to-German record of 28.4 BLEU, more than 2 points above every earlier system including ensembles. The small base model also beat every earlier system, and by the paper's own Table 2 it used about a twenty-third of the training compute of the previous best.

Nobody reading it in 2017 knew the same blocks would become GPT, BERT and the models behind today's chat assistants. That is why it sits near the top of this list: almost every paper after it assumes you know it.

THE IDEA, VISUALLY
BEFORE · A RECURRENT NETWORK READS IN ORDER The step 1 customer step 2 returned step 3 the step 4 laptop step 5 because step 6 it step 7 was step 8 broken step 9 Nine steps, one after another. What "laptop" means can reach "it" only by surviving the step in between, and the next step cannot start until the last one finishes, so training cannot run the words in parallel. THIS PAPER · SELF-ATTENTION: EVERY WORD LOOKS AT EVERY WORD, ALL AT ONCE 0.03 0.08 0.09 0.03 0.55 0.05 query ↓ 0.03 0.14 How much "it" draws on each word: mostly "laptop", in one step. The customer returned the laptop because it was broken attention weights for one head, illustrative
The idea in one picture. A recurrent network passes meaning along one word at a time; self-attention lets every word consult every other word in a single step.
Research notes: the problem, approach and results
28.4BLEU

English to German, over 2 points above every earlier system, ensembles included

23×

less training compute than the previous best, for the smaller base model that still beat it

3.5days

to train the big model, on one machine with 8 P100 GPUs

THE PROBLEM

Translation models read one word at a time. Training could not use the GPU's parallelism, and distant words struggled to influence each other.

THE IDEA

Remove recurrence. Let every word attend directly to every other word, for all words at once, and stack that six times.

THE RESULT

Better translation than any earlier system at a fraction of the training cost. The design became the base of every modern LLM.

02

Why it matters to an FDE

Three questions you will get on a deployment come straight out of this paper.

"Why did doubling our prompt slow everything down so much?" The paper's Table 1 puts self-attention at O(n² · d) per layer for n tokens. Going from 8,000 to 32,000 tokens multiplies the attention score work by 16, while everything else in each layer grows by 4. Providers mostly bill per token, so customers feel this first as latency and context limits, not on the invoice.

"Why is the first word slow and the rest steady?" The paper trains on whole sentences in parallel, but its decoder writes one token at a time, each depending on the last. Reading the prompt is one parallel pass; writing the answer is a loop. Every latency conversation splits along that line.

"Isn't attention supposed to be the efficient option?" It was, for the inputs the authors had. Section 4 argues self-attention is cheaper than recurrence when the sequence is shorter than the model's vector width, which held for 2017 sentences against widths of 512 or 1,024. A 100,000-token context breaks that assumption by two orders of magnitude, and much of the serving work in this list exists to pay down the difference.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 49 more papers.

Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.

6 months · One payment · No auto-renewal

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • ◎1 interactive widget
  • </>1 runnable code experiment
  • ▦2 results tables
  • ?4 interview questions with answers
  1. 03Key takeaways

    The five ideas to keep, attention worked by hand, and the misreadings to avoid

    Free account
  2. 04How it works

    The architecture, block by block, with a diagram and a live widget

    Premium
  3. 05The numbers that matter

    The results table, the cost comparison, and one number the paper contradicts

    Premium
  4. 06Try it yourself

    Fifteen lines of attention, and a ten-second experiment that shows the cost curve

    Premium
  5. 07Where it breaks

    The limit the authors flagged, and three they could not have seen

    Premium
  6. 08Using it on a deployment

    How this paper turns into budget and latency advice a customer can use

    Premium
  7. 09Interview angles

    Four questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →