Pay Less Attention with Lightweight and Dynamic Convolutions

Felix Wu, Angela Fan, Alexei Baevski, Yann N. Dauphin, Michael Auli
1/29/2019
670 citations
cs.CL
transformer-attention

Official code: facebookresearch/fairseq (32,206 stars, Python, MIT, PyTorch, last commit 2025-09-30).

Abstract

Self-attention is a useful mechanism to build generative models for language and images. It determines the importance of context elements by comparing each element to the current time step.

Show full abstract

In this paper, we show that a very lightweight convolution can perform competitively to the best reported self-attention results. Next, we introduce dynamic convolutions which are simpler and more efficient than self-attention. We predict separate convolution kernels based solely on the current time-step in order to determine the importance of context elements. The number of operations required by this approach scales linearly in the input length, whereas self-attention is quadratic. Experiments on large-scale machine translation, language modeling and abstractive summarization show that dynamic convolutions improve over strong self-attention models. On the WMT'14 English-German test set dynamic convolutions achieve a new state of the art of 29.7 BLEU.

View on arXivView PDF

Code Implementations(1)

PyTorchMIT

Facebook AI Research Sequence-to-Sequence Toolkit written in Python.

32,2066,661Python, CudaAug 29, 20171 years agoMIT
artificial-intelligencepythonpytorch

Similar Papers

Cite this paper

@article{wu2019less,
  title  = {Pay Less Attention with Lightweight and Dynamic Convolutions},
  author = {Felix Wu and Angela Fan and Alexei Baevski and Yann N. Dauphin and Michael Auli},
  year   = {2019},
  eprint = {1901.10430},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1901.10430}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1901.10430.svg)](https://codeofpaper.com/paper/1901.10430)

Discussion