arXiv:1706.03762 · cs.CL · 2017
Attention Is All You Need
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, Illia Polosukhin
197,341 citations · 21,003 influential citations— Semantic Scholar
TL;DR · Semantic Scholar
A new simple network architecture, the Transformer, based solely on attention mechanisms, dispensing with recurrence and convolutions entirely is proposed, which generalizes well to other tasks by applying it successfully to English constituency parsing both with large and limited training data.
Saved summary
AI-generated while a reader studied this paper. Check the original source for accuracy.
Problem: Most competitive sequence transduction models rely on recurrent or convolutional neural networks with encoder-decoder architectures. However, the sequential nature of recurrent networks precludes parallelization within training examples, which becomes critical at longer sequence lengths. Convolutional neural networks also face difficulties learning dependencies between distant positions as the number of required operations grows with distance.
Method: The authors propose the Transformer, a sequence transduction model based entirely on attention mechanisms that completely dispenses with recurrence and convolutions. The model uses stacked self-attention and position-wise, fully connected layers in both the encoder and decoder. Key components include Scaled Dot-Product Attention, which scales dot products by the square root of the key dimension to prevent small gradients, and Multi-Head Attention, which allows the model to jointly attend to information from different representation subspaces.
Results: On the WMT 2014 English-to-German translation task, the big Transformer model achieves a state-of-the-art score of 28.4 BLEU, outperforming previous ensembles by over 2 BLEU. On the WMT 2014 English-to-French task, the model establishes a new single-model state-of-the-art BLEU score of 41.8 after training for 3.5 days on eight GPUs. Additionally, the Transformer generalizes successfully to English constituency parsing, outperforming several task-specific models even with limited training data.
Limitations: One drawback of self-attention is the reduced effective resolution due to averaging attention-weighted positions, although this is counteracted by Multi-Head Attention. Additionally, the computational complexity of self-attention can make it less efficient when the sequence length is larger than the representation dimensionality, prompting future investigation into restricted neighborhood attention for very long sequences. Finally, using label smoothing during training improves accuracy and BLEU score but hurts model perplexity.
Abstract
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.
Source: https://arxiv.org/abs/1706.03762 — Thank you to arXiv for use of its open access interoperability.
Papers citing this work · Semantic Scholar
- Evaluation of artificial neural network-based dose estimation models for emergency dose assessment in external exposure scenarios (2027) · 0 citations
- Degradation-consistent measurement learning for robust low-sampling single-pixel recognition (2027) · 0 citations
- Toward a Framework for Assessing Patient-Facing Gen AI Tools in Mental Healthcare. (2026) · 0 citations
- Orchard worker detection using spatial-context attention on 2D LiDAR data (2027) · 0 citations
- Physics-informed Perceiver IO: Scalable mesh-free solving of partial differential equations without supervision (2027) · 0 citations
Read the original paper, explore key passages and ask questions in AewolFlow.