Fundamental Limitations on Subquadratic Alternatives to Transformers
摘要
The Transformer architecture is widely deployed in many popular and impactful Large Language Models. At its core is the attention mechanism for calculating correlations between pairs of tokens. Performing an attention computation takes quadratic time in the input size, and had become the time bottleneck for transformer operations. In order to circumvent this, researchers have used a variety of approaches, including designing heuristic algorithms for performing attention computations faster, and proposing alternatives to the attention mechanism which can be computed more quickly. For instance, state space models such as Mamba were designed to replace attention with an almost linear time alternative. In this paper, we prove that any such approach cannot perform important tasks that Transformer is able to perform (assuming a popular conjecture from fine-grained complexity theory). We focus on document similarity tasks, where one is given as input many documents and would like to find a pair which is (approximately) the most similar. We prove that Transformer is able to perform this task, and we prove that this task cannot be performed in truly subquadratic time by any algorithm. Thus, any model which can be evaluated in subquadratic time - whether because of subquadratic-time heuristics for attention, faster attention replacements like Mamba, or any other reason - cannot perform this task. In other words, in order to perform tasks that (implicitly or explicitly) involve document similarity, one may as well use Transformer and cannot avoid its quadratic running time.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 11 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention 引用了 Reformer: The Efficient Transformer
- Fast attention mechanisms: a tale of parallelism 引用了 Reformer: The Efficient Transformer
- Fast attention mechanisms: a tale of parallelism 引用了 Language Models are Few-Shot Learners
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale 引用了 Language Models are Few-Shot Learners
- Subquadratic Algorithms and Hardness for Attention with Any Temperature 引用了 Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- Subquadratic Algorithms and Hardness for Attention with Any Temperature 引用了 Reformer: The Efficient Transformer
- Subquadratic Algorithms and Hardness for Attention with Any Temperature 引用了 Language Models are Few-Shot Learners
- DeltaFormer: Unlock the state space of Transformer 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- DeltaFormer: Unlock the state space of Transformer 引用了 Language Models are Few-Shot Learners
- Attention Mechanism, Max-Affine Partition, and Universal Approximation 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Attention Mechanism, Max-Affine Partition, and Universal Approximation 引用了 Language Models are Few-Shot Learners
- Poly-attention: a general scheme for higher-order self-attention 引用了 Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- Poly-attention: a general scheme for higher-order self-attention 引用了 Reformer: The Efficient Transformer
- Poly-attention: a general scheme for higher-order self-attention 引用了 Language Models are Few-Shot Learners
- Poly-attention: a general scheme for higher-order self-attention 引用了 Synthesizer: Rethinking Self-Attention for Transformer Models
- Synthesizer: Rethinking Self-Attention for Transformer Models 引用了 Reformer: The Efficient Transformer
引用它的顶会 Paper11
- Attention Mechanism, Max-Affine Partition, and Universal ApproximationHude Liu, Jerry Yao-Chieh Hu, Zhao Song, Han LiuNeurIPS 2025 · 12 次引用
- Subquadratic Algorithms and Hardness for Attention with Any TemperatureShreya Gupta, Boyang Huang, Barna Saha, Yinzhan Xu 等ICLR 2026 · 5 次引用
- DeltaFormer: Unlock the state space of TransformerMingyu Xu, Tenglong Ao, Jiaao He, Jianqiao Lu 等NeurIPS 2025 · 3 次引用
- Poly-attention: a general scheme for higher-order self-attentionSayak Chakrabarti, Toniann Pitassi, Josh AlmanICLR 2026 · 3 次引用
- Fast attention mechanisms: a tale of parallelismJingwen Liu, Hantao Yu, Clayton Sanford, Alexandr Andoni 等NeurIPS 2025 · 2 次引用
它引用的 Paper21
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn 等ICLR 2021 · 21,477 次引用
- Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 次引用
- Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 次引用
- Synthesizer: Rethinking Self-Attention for Transformer ModelsYi Tay, Dara Bahri, Donald Metzler, Da-Cheng Juan 等ICML 2021 · 399 次引用
相关 Paper
- Demystify Mamba in Vision: A Linear Attention PerspectiveDongchen Han, Ziyi Wang, Zhuofan Xia, Yizeng Han 等NeurIPS 2024 · 287 次引用
- Achilles' Heel of Mamba: Essential difficulties of the Mamba architecture demonstrated by synthetic dataTianyi Chen, Pengxiao Lin, Zhiwei Wang, Zhi-Qin John XuNeurIPS 2025 · 4 次引用
- Snakes and Ladders: Two Steps Up for VideoMambaHui Lu, Albert Ali Salah, Ronald PoppeICCV 2025 · 1 次引用
- Transformers to SSMs: Distilling Quadratic Knowledge to Subquadratic ModelsAviv Bick, Kevin Y. Li, Eric P. Xing, J. Zico Kolter 等NeurIPS 2024 · 78 次引用
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space DualityTri Dao, Albert GuICML 2024 · 1,407 次引用
