Archive of AI

Source Snapshot / 2017-06-12-google-deepmind-transformer-architecture-3

Attention Is All You Need - Wikipedia

Linked event: 2017-06-12 · Google Research Team Publishes "Attention Is All You Need," Introducing the Transformer Architecture Behind Modern Foundation Models

Publisher
Wikipedia
Archived
2026-11-23
Capture Method
Direct page capture
HTTP / SHA-256
200 / d448bd4365739c46
Original URL
Open source ↗
Wayback Backup
Not archived
This page preserves a plain-text static snapshot against link rot. When citing figures, tables, or full legal terms, verify against the original URL and Wayback Machine archive.

[来源关键摘录] 详述 Transformer 论文的核心设计、对现代大语言模型架构的深远影响及八位作者后续创办多项头部研究团队的行业轨迹。

[正文前段节选] Jump to content

Attention Is All You Need

17 languages

Српски / srpski

From Wikipedia, the free encyclopedia

2017 paper conceptualizing the transformer-based deep learning architecture

"Attention Is All You Need"

An illustration of main components of the transformer model from the paper

Project typeArtificial intelligence research

SponsorsGoogle

ObjectiveProvide a novel approach to train AI

DurationJune 12, 2017; 9 years ago (2017-06-12) –

Websiteproceedings.neurips.cc/paper/2017/hash/3f5ee243547dee91fbd053c1c4a845aa-Abstract.html

"Attention Is All You Need"[1] is a 2017 research paper on machine learning authored by eight scientists and engineers working at Google. The paper introduced a new deep learning architecture known as the transformer, based on the attention mechanism proposed in 2014 by Bahdanau et al.[2] The transformer approach it describes has become the main architecture of a wide variety of artificial intelligence systems, including large language models.[3][4] At the time, the focus of the research was on improving Seq2seq techniques for machine translation, but the authors went further in the paper, foreseeing the technique's potential for other tasks like question answering and what is now known as multimodal generative AI.[1]

Some early examples on which the team tried their Transformer architecture included English-to-German translation, generating Wikipedia articles on "The Transformer", and parsing. These convinced the team that the Transformer is a general-purpose language model, and not just good for translation.[5]

As of 2026,[update] the paper has been cited more than 150,000 times, placing it among the top ten most-cited papers of the 21st century.[6] After the paper was published by Google, each of the eight authors left the company to join other companies or to found startups.

The authors of the paper are Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan Gomez, Łukasz Kaiser, and Illia Polosukhin. All eight authors were "equal contributors" to the paper; the listed order was randomized (according to the paper itself). After the paper, each of the authors left Google to join other companies or to found startups.[7][8]

The paper's title is a reference to the song "All You Need Is Love" by the Beatles.[9] The name "Transformer" was picked because Jakob Uszkoreit, one of the paper's authors, liked the sound of that word.[5] An early design document was titled "Transformers: Iterative Self-Attention and Processing for Various Tasks", and included an illustration of six characters from the Transformers franchise. The team was named Team Transformer.[9]

Methods discussed and introduced

The paper is best known for introducing the Transformer architecture, which underlies most modern large language models (LLMs).[10] A key reason why the architecture is preferred by most modern LLMs is the parallelizability of the architecture over its predecessors. This ensures that the operations necessary for training can be accelerated on a GPU, allowing both faster training times and models of bigger sizes to be trained.

The paper introduced the following mechanisms as part of the development of the transformer architecture.

Scaled dot-product attention and self-attention

The use of the scaled dot-product attention and self-attention mechanism instead of a recurrent neural network (RNN) or long short-term memory (which rely on recurrence) allows for better performance as described in the following paragraph. The paper described the scaled dot-product attention as follows:

Attention(Query,Key,Value):=softmax(Query×KeyTdk)×Value

where Query, Key, Value are respectively the query, key, value matrices, and dk is the dimension of the queries and keys, corresponding to the number of columns in their matrices.

Here, the softmax function is applied row-wise: let Score:=Query×KeyT/dk and Weight:=softmax(Score), then the element at row i and column j in the Weight matrix is calculated as

Weightij=exp⁡(Scoreij)∑k=1mexp⁡(Scoreik),

where m is the number of columns and rows in the Score and Weight matrices, respectively, corresponding to the length of the context window.

Since the model relies on Query, Key, and Value matrices that come from the same source (i.e., the input sequence or context window), this eliminates the need for RNNs, completely ensuring parallelizability for the architecture. This differs from the original form of the Attention mechanism introduced in 2014. Additionally, the paper discusses the use of an additional scaling factor that was found to be most effective with respect to the dimension of the key vectors (represented as dk and initially set to 64 within the paper) in the manner shown above.

Cross-attention

In the specific context of translation, which the paper focused on, the Query matrix is usually represented in embeddings corresponding to the target language, while the Key and Value matrices correspond to the source language. In the paper, this form of attention is called encoder-decoder attention; another common name is cross-attention. More specifically, the authors state that “in ‘encoder-decoder attention’ layers, the queries come from the previous decoder layer, and the memory keys and values come from the output of the encoder”. In analogy with the seq2seq approach (see below), the encoder hereby consumes the source language sequence, while the decoder autoregressively consumes and produces the target language sequence.

Multi-head attention

In the self-attention mechanism, queries (Q), keys (K), and values (V) are dynamically generated for each input sequence (typically limited by the size of the context window), allowing the model to focus on different parts of the input sequence at different steps. Multi-head attention enhances this process by introducing multiple parallel attention heads. Each attention head learns different linear projections of the Q, K, and V matrices. This allows the model to capture different aspects of the relationships between words in the sequence simultaneously, rather than focusing on a single aspect.

By doing this, multi-head attention ensures that the input embeddings are updated from a more varied and diverse set of perspectives. After the attention outputs from all heads are calculated, they are concatenated and passed through a final linear transformation to generate the output.

Positional encoding

Main article: Positional encoding

Since the Transformer does not rely on recurrence or convolution of the text in order to perform encoding and decoding, the paper relied on the use of sine and cosine wave functions to encode the position of the token into the embedding. The methods introduced in the paper are discussed below:

PE(pos,2i)=sin⁡(pos/100002i/dmodel)

PE(pos,2i+1)=cos⁡(pos/100002i/dmodel)

wherein pos, i, dmodel correspond to the position of the word, the current dimension index, and the dimension of the model, respectively. The sine function is used for even indices of the embedding while the cosine function is used for odd indices. The resultant PE embedding is then added to the word at that corresponding position with respect to the current context window. The paper specifically comments on why this method was chosen describing:

We chose the sinusoidal version because it may allow the model to extrapolate to sequence lengths longer than the ones encountered during training.[1]

Historical context

Main articles: Transformer (deep learning) § History, and Seq2seq § History

This section's style of writing may not reflect the encyclopedic tone used on Wikipedia. See Wikipedia's guide to writing better articles for suggestions. (February 2026) (Learn how and when to remove this message)

See also: Timeline of machine learning

Predecessors

[...内容已截断,完整版请查看原文或 Wayback 快照]