Lune

ICLR2026顶会

Subquadratic Algorithms and Hardness for Attention with Any Temperature

Shreya Gupta, Boyang Huang, Barna Saha, Yinzhan Xu, Christopher Ye

摘要

Despite the popularity of the Transformer architecture, the standard algorithm for computing Attention suffers from quadratic time complexity in context length nn. Alman and Song showed that when the head dimension d=Θ(log⁡n)d = \Theta(\log n), subquadratic Attention is possible if and only if the inputs have small entries bounded by B=o(log⁡n)B = o(\sqrt{\log n}) in absolute values, under the Strong Exponential Time Hypothesis (SETH\mathsf{SETH}). Equivalently, subquadratic Attention is possible if and only if the softmax is applied with high temperature for d=Θ(log⁡n)d=\Theta(\log n). Running times of these algorithms depend exponentially on BB and thus they do not lead to even a polynomial-time algorithm outside the specific range of BB.

This naturally leads to the question: when can Attention be computed efficiently without strong assumptions on temperature? Are there fast attention algorithms that scale polylogarithmically with entry size BB? In this work, we resolve this question and characterize when fast Attention for arbitrary temperatures is possible. First, for all constant d=O(1)d = O(1), we give the first subquadratic O~(n2−1/d⋅polylog(B))\tilde{O}(n^{2 - 1/d} \cdot \mathrm{polylog}(B)) time algorithm for Attention with large BB. Our result holds even for matrices with large head dimension if they have low rank. Combined with a reduction from Gradient Computation to Attention, we obtain a subquadratic algorithm for the full LLM training process. Furthermore, we show that any substantial improvement on our algorithm is unlikely. In particular, we show that even when d=2Θ(log⁡∗n)d = 2^{\Theta(\log^* n)}, Attention requires n2−o(1)n^{2 - o(1)} time under SETH\mathsf{SETH}.

Finally, in the regime where d=poly(n)d = \mathrm{poly}(n), the standard algorithm requires O(n2d)O(n^{2} d) time while previous lower bounds only ruled out algorithms with truly subquadratic time in nn. We close this gap and show that the standard algorithm is optimal under popular fine-grained complexity assumptions.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 1 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention 引用了 Reformer: The Efficient Transformer
  • On the Computational Hardness of Transformers 引用了 Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • On the Computational Hardness of Transformers 引用了 Big Bird: Transformers for Longer Sequences
  • On the Computational Hardness of Transformers 引用了 Reformer: The Efficient Transformer
  • On the Computational Hardness of Transformers 引用了 Language Models are Few-Shot Learners
  • Big Bird: Transformers for Longer Sequences 引用了 Reformer: The Efficient Transformer
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper1

  1. On the Computational Hardness of TransformersBarna Saha, Yinzhan Xu, Christopher Ye, Hantao YuSTOC 2026

它引用的 Paper24

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
  2. A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 次引用
  3. Big Bird: Transformers for Longer SequencesManzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie 等NeurIPS 2020 · 3,159 次引用
  4. Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 次引用
  5. Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 次引用

相关 Paper

  1. Fast Attention Requires Bounded EntriesJosh Alman, Zhao SongNeurIPS 2023 · 115 次引用
  2. The Fine-Grained Complexity of Gradient Computation for Training Large Language ModelsJosh Alman, Zhao SongNeurIPS 2024 · 33 次引用
  3. How to Capture Higher-order Correlations? Generalizing Matrix Softmax Attention to Kronecker ComputationJosh Alman, Zhao SongICLR 2024 · 53 次引用
  4. Improved Algorithms for Kernel Matrix-Vector Multiplication Under Sparsity AssumptionsPiotr Indyk, Michael Kapralov, Kshiteej Sheth, Tal WagnerICLR 2025
  5. HyperAttention: Long-context Attention in Near-Linear TimeInsu Han, Rajesh Jayaram, Amin Karbasi, Vahab Mirrokni 等ICLR 2024 · 104 次引用
黄昏的海面,两侧是细线勾勒的悬崖