Why Softmax Attention Outperforms Linear Attention

Yichuan Deng, Zhao Song, Kaijun Yuan, Tianyi Zhou
10/18/2023
cs.CLcs.LG

No confident code implementation found for this paper.

Abstract

Large transformer models have achieved state-of-the-art results in numerous natural language processing tasks. Among the pivotal components of the transformer architecture, the attention mechanism plays a crucial role in capturing token interactions within sequences through the utilization of softmax function. Conversely, linear attention presents a more computationally efficient alternative by approximating the softmax operation with linear complexity. However, it exhibits substantial performance degradation when compared to the traditional softmax attention mechanism. In this paper, we bridge the gap in our theoretical understanding of the reasons behind the practical performance gap between softmax and linear attention. By conducting a comprehensive comparative analysis of these two attention mechanisms, we shed light on the underlying reasons for why softmax attention outperforms linear attention in most scenarios.

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. Any repos shown below are weak matches — 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{deng2023softmax,
  title  = {Why Softmax Attention Outperforms Linear Attention},
  author = {Yichuan Deng and Zhao Song and Kaijun Yuan and Tianyi Zhou},
  year   = {2023},
  eprint = {2310.11685},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2310.11685v2}
}

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

Discussion