Momentum Transformer: Closing the Performance Gap Between Self-attention and Its Linearization

Tan Nguyen, Richard G. Baraniuk, Robert M. Kirby, Stanley J. Osher, Bao Wang
8/1/2022
cs.LGmath.NA
transformer-attention

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Transformers have achieved remarkable success in sequence modeling and beyond but suffer from quadratic computational and memory complexities with respect to the length of the input sequence. Leveraging techniques include sparse and linear attention and hashing tricks; efficient transformers have been proposed to reduce the quadratic complexity of transformers but significantly degrade the accuracy.

Show full abstract

In response, we first interpret the linear attention and residual connections in computing the attention map as gradient descent steps. We then introduce momentum into these components and propose the \emph{momentum transformer}, which utilizes momentum to improve the accuracy of linear transformers while maintaining linear memory and computational complexities. Furthermore, we develop an adaptive strategy to compute the momentum value for our model based on the optimal momentum for quadratic optimization. This adaptive momentum eliminates the need to search for the optimal momentum value and further enhances the performance of the momentum transformer. A range of experiments on both autoregressive and non-autoregressive tasks, including image generation and machine translation, demonstrate that the momentum transformer outperforms popular linear transformers in training efficiency and accuracy.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{nguyen2022momentum,
  title  = {Momentum Transformer: Closing the Performance Gap Between Self-attention and Its Linearization},
  author = {Tan Nguyen and Richard G. Baraniuk and Robert M. Kirby and Stanley J. Osher and Bao Wang},
  year   = {2022},
  eprint = {2208.00579},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2208.00579v1}
}

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/2208.00579.svg)](https://codeofpaper.com/paper/2208.00579)

Discussion