Skip to main content

Ask your PDF, check the answer in the source

Upload a paper PDF and ask about it: the answer comes with citations, and the supporting passage is highlighted in the PDF. Figure explanations, translation, citation previews and a summary sit right beside the PDF.

No credit card · Free plan available

Trusted by students and researchers across the world

Emory University
UT Austin
Texas A&M
Seoul National University
University of Tokyo
Stanford University
University of Cambridge
UCL
Emory University
UT Austin
Texas A&M
Seoul National University
University of Tokyo
Stanford University
University of Cambridge
UCL
Emory University
UT Austin
Texas A&M
Seoul National University
University of Tokyo
Stanford University
University of Cambridge
UCL
Emory University
UT Austin
Texas A&M
Seoul National University
University of Tokyo
Stanford University
University of Cambridge
UCL

Ask your PDF and check every answer in the source

Upload a PDF and ask about the paper: the answer comes with citations. Click Open quote and the PDF opens with the supporting passage highlighted, so you see exactly which part of the paper the answer came from. You can also select text in the PDF to have it explained, translated or asked about.

attention-is-all-you-need.pdf

Attention Is All You Need

Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Łukasz Kaiser, Illia Polosukhin

Abstract

The dominant sequence transduction models are based on complex recurrent or convolutional neural networks that include an encoder and a decoder. 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.

1 Introduction

Recurrent neural networks, long short-term memory [13] and gated recurrent [7] neural networks in particular, have been firmly established as state of the art approaches in sequence modeling and transduction problems such as language modeling and machine translation [35, 2, 5].

Recurrent models typically factor computation along the symbol positions of the input and output sequences. Aligning the positions to steps in computation time, they generate a sequence of hidden states, as a function of the previous hidden state and the input for that position. This inherently sequential nature precludes parallelization within training examples, which becomes critical at longer sequence lengths, as memory constraints limit batching across examples.

2 Background

3 Model Architecture

SoftmaxLinear
N×
Feed ForwardMulti-Head Attention
Feed ForwardMulti-Head AttentionMasked Multi-Head Attention
N×
InputsOutputs (shifted right)

Figure 1: The Transformer - model architecture.

3.1 Encoder and Decoder Stacks

3.2 Attention

1/ 15
AI Chat

Upload a PDF and start chatting

LibraryOn
Ask for anything — drafts, papers, reviews

Click a figure to have it explained

Hover over a figure or chart in the PDF and click Explain figure: the cropped figure and its whole page go to the chat beside it, and you get an explanation of what the figure shows in the context of the paper.

Attention Is All You Need

Attention Is All You Need

Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Łukasz Kaiser, Illia Polosukhin

Abstract

The dominant sequence transduction models are based on complex recurrent or convolutional neural networks that include an encoder and a decoder. 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.

1 Introduction

Recurrent neural networks, long short-term memory [13] and gated recurrent [7] neural networks in particular, have been firmly established as state of the art approaches in sequence modeling and transduction problems such as language modeling and machine translation [35, 2, 5].

Recurrent models typically factor computation along the symbol positions of the input and output sequences. Aligning the positions to steps in computation time, they generate a sequence of hidden states, as a function of the previous hidden state and the input for that position. This inherently sequential nature precludes parallelization within training examples, which becomes critical at longer sequence lengths, as memory constraints limit batching across examples.

2 Background

3 Model Architecture

SoftmaxLinear
N×
Feed ForwardMulti-Head Attention
Feed ForwardMulti-Head AttentionMasked Multi-Head Attention
N×
InputsOutputs (shifted right)

Figure 1: The Transformer - model architecture.

3.1 Encoder and Decoder Stacks

3.2 Attention

3/ 15
AI Chat
Vaswani et al., 2017

Why does this paper drop recurrence and use only attention?

The authors argue that recurrent models compute one position after another, which precludes parallelization within training examples (Vaswani et al., 2017). The Transformer therefore drops recurrence and convolutions and relies on attention alone, which they report is more parallelizable and takes significantly less time to train (Vaswani et al., 2017).

V1 sourceAPA (7th ed.)
LibraryOn
Ask for anything — drafts, papers, reviews

Translation, references and a summary beside the PDF

Translate in two ways: layout-preserving translation keeps the shape of the original page, and page translation lets you read each page as translated text. Both sit beside the original and follow the same page. Hover over a citation number to see a card for that reference, and click Summarize to have the chat sum up the paper at a glance.

Attention Is All You Need

Attention Is All You Need

Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Łukasz Kaiser, Illia Polosukhin

Abstract

The dominant sequence transduction models are based on complex recurrent or convolutional neural networks that include an encoder and a decoder. 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.

1 Introduction

Recurrent neural networks, long short-term memory [13] and gated recurrent [7] neural networks in particular, have been firmly established as state of the art approaches in sequence modeling and transduction problems such as language modeling and machine translation [35, 2, 5].

Recurrent models typically factor computation along the symbol positions of the input and output sequences. Aligning the positions to steps in computation time, they generate a sequence of hidden states, as a function of the previous hidden state and the input for that position. This inherently sequential nature precludes parallelization within training examples, which becomes critical at longer sequence lengths, as memory constraints limit batching across examples.

2 Background

3 Model Architecture

SoftmaxLinear
N×
Feed ForwardMulti-Head Attention
Feed ForwardMulti-Head AttentionMasked Multi-Head Attention
N×
InputsOutputs (shifted right)

Figure 1: The Transformer - model architecture.

3.1 Encoder and Decoder Stacks

3.2 Attention

1/ 15
AI Chat

Explain this figure from p. 3 of "Attention Is All You Need". I attached the figure and its whole page.

Figure 1 shows the full Transformer architecture. The encoder on the left stacks N = 6 identical layers, each with multi-head self-attention and a position-wise feed-forward network. The decoder on the right masks its self-attention so each position sees only earlier ones, adds a sub-layer that attends to the encoder output, and ends with Linear and Softmax layers that give next-token probabilities.

LibraryOn
Ask for anything — drafts, papers, reviews

How It Works

  1. 01

    Upload a PDF

    Upload a PDF from the Paper analysis tab on Home or with the paperclip button in chat. Papers saved in your library open right away too.

  2. 02

    Ask and read

    Ask in the chat beside the PDF, or click Explain figure, Translate or Summarize.

  3. 03

    Check the source

    Click Open quote on a citation in the answer to see the supporting passage highlighted in the PDF.

FAQ

Frequently Asked Questions

Common questions about this feature

Paper PDFs you upload and papers saved in your library. Scanned PDFs are read with OCR for questions and summaries. Layout-preserving translation and page translation work only on PDFs that contain text.

Start analyzing a paper with one PDF

No credit card · Free plan available