Attention Is All You Need

Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez and 2 more

Published
Lab
Google
Citations
205,712

TL;DR

The Transformer is a sequence model built only from attention, with no recurrence or convolutions. On machine translation it was more accurate than the previous best systems, more parallelizable, and faster to train.

Read this as a

Why builders care

Editor's note

This is the architecture almost every modern language, vision and multimodal model is built on. The original evidence is translation quality at a fraction of earlier training cost, plus a transfer result on constituency parsing.

How to apply it

Editor's note
  1. 1If you need to understand why today's models look the way they do, start here: attention over the whole sequence, and no recurrent state.
  2. 2The original numbers: 28.4 BLEU on WMT 2014 English-to-German, beating the previous best including ensembles by over 2 BLEU, and 41.8 BLEU on English-to-French after 3.5 days on eight GPUs.

Code

Not found

No verified code link yet. We checked the abstract, arXiv comments and Hugging Face; if the authors release code later it will show up here.

Practical notes

AI-generated
  • Build sequence models using only attention mechanisms, dispensing entirely with recurrence and convolutions.
  • Process entire sequences using attention without relying on recurrent states.

Key results

From the abstract
  1. 1

    Our model achieves 28.4 BLEU on the WMT 2014 English-to-German translation task, improving over the existing best results, including ensembles by over 2 BLEU.

  2. 2

    On the WMT 2014 English-to-French translation task, our model establishes a new single-model state-of-the-art BLEU score of 41.8 after training for 3.5 days on eight GPUs, a small fraction of the training costs of the best models from the literature.

  3. 3

    We show that the Transformer generalizes well to other tasks by applying it successfully to English constituency parsing both with large and limited training data.

  • The dominant sequence transduction models are based on complex recurrent or convolutional neural networks in an encoder-decoder configuration.
  • The best performing models also connect the encoder and decoder through an attention mechanism.

  • We propose a new simple network architecture, the Transformer, based solely on attention mechanisms, dispensing with recurrence and convolutions entirely.
  • Experiments on two machine translation tasks show these models to be superior in quality while being more parallelizable and requiring significantly less time to train.

The dominant sequence transduction models are based on complex recurrent or convolutional neural networks in an encoder-decoder configuration. The best performing models also connect the encoder and decoder through an attention mechanism. We propose a new simple network architecture, the Transformer, based solely on attention mechanisms, dispensing with recurrence and convolutions entirely. Experiments on two machine translation tasks show these models to be superior in quality while being more parallelizable and requiring significantly less time to train. Our model achieves 28.4 BLEU on the WMT 2014 English-to-German translation task, improving over the existing best results, including ensembles by over 2 BLEU. On the WMT 2014 English-to-French translation task, our model establishes a new single-model state-of-the-art BLEU score of 41.8 after training for 3.5 days on eight GPUs, a small fraction of the training costs of the best models from the literature. We show that the Transformer generalizes well to other tasks by applying it successfully to English constituency parsing both with large and limited training data.

Everything on this page is written from this abstract. For methods and full results, read the paper PDF.

Ask the paper

Answers come from the paper summary and abstract.

Ask anything about “Attention Is All You Need”, or start with one of these:

Closest matches across the feed and every collection, by shared words in titles, topics and abstracts.