"Attention Is All You Need": The Paper Behind ChatGPT

In 2017, eight Google researchers published a short paper introducing the Transformer. Here is what it said, why it mattered and how it led to GPT, BERT and today's chatbots.

Short answer

"Attention Is All You Need" is the 2017 Google research paper that introduced the Transformer, the design behind GPT and BERT. Instead of reading text one word at a time, it uses "attention" to compare every word with every other word at once. That made models faster to train on graphics chips and better at understanding context. The "T" in ChatGPT stands for Transformer.

In this article 8 sections
  1. The paper in a nutshell
  2. The problem it solved: reading one word at a time
  3. What "attention" actually means
  4. Where the name came from
  5. From translation to GPT and BERT
  6. Why it still matters
  7. Common questions
  8. The short version
Google company sign on Charleston Road in Mountain View, California
Google, where the eight authors of the 2017 transformer paper worked, is headquartered in Mountain View, California. Photo: Dietmar Rabich / Wikimedia Commons, CC BY-SA 4.0

In June 2017, eight researchers working at Google posted a short paper with a playful title: "Attention Is All You Need". It described a new way of building language AI called the Transformer. Its ideas went on to power OpenAI's GPT models and Google's BERT, which is why the paper is often seen as a turning point for modern AI. Here is what it said, why it mattered and how it led to GPT and BERT, in plain English.1,4

The paper in a nutshell

The paper was first posted to arXiv, a free online library of research papers, on 12 June 2017. Its authors were Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin. It was later published in the proceedings of NIPS 2017 (now called NeurIPS), one of the biggest yearly conferences in machine learning.1,2

  • What it proposed: a model "based solely on attention", dropping the two techniques most language models relied on at the time.
  • What it was tested on: translating news text from English to German and from English to French.
  • The headline result: the final version reports 28.4 BLEU (a standard score for translation quality) on English-to-German, and 41.8 on English-to-French after training for 3.5 days on eight graphics chips (GPUs).
  • Beyond translation: the authors showed it could also break English sentences down into their grammatical parts.1

If terms such as "model" and "training" are new to you, our guide to AI, machine learning and deep learning explains the basics.

The problem it solved: reading one word at a time

Before 2017, the leading language systems were mostly recurrent neural networks (RNNs). An RNN reads a sentence in order, one word after another, carrying a running summary as it goes. That has two drawbacks. First, linking two words that sit far apart takes many steps. Second, because each step waits for the previous one, the work is hard to split across the thousands of tiny calculators inside modern chips such as GPUs and Google's TPUs.3

Google's own explanation, published in August 2017 by co-author Jakob Uszkoreit, used a simple example: "I arrived at the bank after crossing the river." To know that "bank" means a riverbank rather than a place for money, a system needs to connect "bank" with "river". An RNN gets there step by step; the Transformer can look straight at "river" in a single step.3

What "attention" actually means

Attention, also called self-attention, is a way for a model to work out how much each word in a passage should influence every other word. Instead of reading left to right, the model compares all the words with each other at once and gives more weight to the ones that matter for the meaning.4

A classic case is the word "it". In a sentence about a cup and a pitcher, the model has to decide which object "it" refers to. Attention lets it weigh the options using the rest of the sentence. The paper's design runs several of these attention calculations side by side, a trick called multi-headed attention, so the model can track different kinds of relationships at the same time.4,1

Because these comparisons can all be done together rather than in a queue, the maths suits parallel processing, which is exactly what GPUs are good at.4 Google reported that the Transformer beat both older types of model on its translation tests while training up to ten times faster.3

Diagram of the Transformer encoder-decoder architecture from the paper Attention Is All You Need
The original Transformer diagram from the 2017 paper: an encoder stack (left) reads the input, a decoder stack (right) writes the output, and both are built from attention layers. Diagram: Google (Vaswani et al.) / Wikimedia Commons, CC BY-SA 4.0

Where the name came from

According to an NVIDIA explainer, the team first considered calling it something like "Attention Net", which Ashish Vaswani said did not sound very exciting. Jakob Uszkoreit came up with the name Transformer; Vaswani has said he argued the model was "transforming representations", while admitting that was mostly playing with words.4

From translation to GPT and BERT

The paper was about translation, but others quickly saw that the same building blocks could learn language in general.

  • GPT (June 2018). OpenAI described a two-stage method: first train a Transformer on lots of ordinary text so it learns how language works, then fine-tune it on smaller, specific tasks. The first model was trained on BooksCorpus, a collection of more than 7,000 unpublished books, and used a 12-layer, decoder-only version of the Transformer. Pre-training took a month on eight GPUs.5,6
  • BERT (November 2018). Google released BERT, short for Bidirectional Encoder Representations from Transformers. It reads words in both directions at once and, at launch, set new records on 11 language tasks, including a question-answering test where it scored higher than the human benchmark.4,7
  • Google Search (October 2019). Google said it was applying BERT to Search ranking and to featured snippets, and that it would help it better understand about one in ten English-language searches in the US.8

GPT stands for Generative Pretrained Transformer, so the "T" in ChatGPT points straight back to the 2017 design. OpenAI's later models grew much larger: NVIDIA notes that GPT-2 had 1.5 billion parameters (the adjustable numbers inside a model) and GPT-3 had 175 billion.4 To see how that same story played out at another lab, read our history of Claude's models.

Why it still matters

The Transformer did not just win a translation contest; it became a general recipe. By 2022, NVIDIA reported that 70% of AI papers posted to arXiv in the previous two years mentioned transformers, and the approach had spread from text to areas such as protein research, drug discovery and medical records.4 In an August 2021 paper, Stanford researchers called these large, general-purpose systems "foundation models".4

What this means for you

When you type into a chatbot, it splits your words into small pieces called tokens and uses attention to weigh them against each other before predicting a reply, one token at a time. That design is powerful but not magic: it predicts likely text rather than checking facts, which is one reason AI sometimes makes things up.

It also puts the paper in a longer line of history. Early chatbots such as ELIZA followed hand-written rules; Transformer-based systems learn patterns from huge amounts of text instead.

Common questions

Who wrote "Attention Is All You Need"?

Eight researchers: Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin, working at Google.1,3

When was it published?

It first appeared on arXiv on 12 June 2017 and was presented at the NIPS 2017 conference.1,2

Is ChatGPT a Transformer?

Yes, in the sense that GPT stands for Generative Pretrained Transformer: the GPT family builds on the architecture introduced in the 2017 paper.4,6

What is the difference between GPT and BERT?

GPT uses the decoder half of the design and is trained to predict the next piece of text, which suits generating writing. BERT uses the encoder half and reads text in both directions, which made it strong at understanding tasks such as search and answering questions.6,7

The short version

  • In June 2017, eight Google researchers introduced the Transformer in "Attention Is All You Need".1
  • It replaced word-by-word reading with attention, which links any two words directly and runs fast on GPUs.3,4
  • OpenAI's GPT and Google's BERT, both from 2018, built on it, and BERT reached Google Search in 2019.5,7,8
  • GPT stands for Generative Pretrained Transformer, so the "T" in ChatGPT points back to the 2017 paper.4

ByteExplained is written with help from Claude, Anthropic's AI model, and checked against the listed sources.

Sources and further reading

  1. Attention Is All You Need (arXiv:1706.03762) — arXiv2017-06-12
  2. Attention is All you Need — Advances in Neural Information Processing Systems 30 (NIPS 2017) — NeurIPS Proceedings
  3. Transformer: A Novel Neural Network Architecture for Language Understanding — Google Research2017-08-31
  4. What Is a Transformer Model? — NVIDIA2022-03-25
  5. Improving language understanding with unsupervised learning — OpenAI2018-06-11
  6. Improving Language Understanding by Generative Pre-Training (paper) — OpenAI
  7. Open Sourcing BERT: State-of-the-Art Pre-training for Natural Language Processing — Google Research2018-11-02
  8. Understanding searches better than ever before — Google2019-10-25

Was this article helpful?

Comments

No comments yet. Questions and tips from readers are welcome.