Fast Attention Requires Bounded Entries
Josh Alman, Zhao Song
摘要
In modern machine learning, inner product attention computation is a fundamental task for training large language models such as Transformer, GPT-1, BERT, GPT-2, GPT-3 and ChatGPT. Formally, in this problem, one is given as input three matrices , and the goal is to construct the matrix , where is the `attention matrix', and is applied entry-wise. Straightforward methods for this problem explicitly compute the attention matrix , and hence require time even when is small. In this paper, we investigate whether faster algorithms are possible by implicitly making use of the matrix . We present two results, showing that there is a sharp transition at . If and , there is an time algorithm to approximate up to additive error. If and , assuming the Strong Exponential Time Hypothesis from fine-grained complexity theory, it is impossible to approximate up to additive error in truly subquadratic time . This gives a theoretical explanation for the phenomenon observed in practice that attention computation is much more efficient when the input matrices have smaller entries.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper47
- H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language ModelsZhenyu Zhang, Ying Sheng, Tianyi Zhou, Tianlong Chen 等NeurIPS 2023 · 被引用 1,003 次
- Deja Vu: Contextual Sparsity for Efficient LLMs at Inference TimeZichang Liu, Jue Wang, Tri Dao, Tianyi Zhou 等ICML 2023 · 被引用 318 次
- HyperAttention: Long-context Attention in Near-Linear TimeInsu Han, Rajesh Jayaram, Amin Karbasi, Vahab Mirrokni 等ICLR 2024 · 被引用 104 次
- The Hedgehog & the Porcupine: Expressive Linear Attentions with Softmax MimicryMichael Zhang, Kush Bhatia, Hermann Kumbong, Christopher RéICLR 2024 · 被引用 103 次
- On the Role of Attention Masks and LayerNorm in TransformersXinyi Wu, Amir Ajorlou, Yifei Wang, Stefanie Jegelka 等NeurIPS 2024 · 被引用 54 次
它引用的顶会 Paper6
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 被引用 64,255 次
- Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 被引用 2,665 次
- Deja Vu: Contextual Sparsity for Efficient LLMs at Inference TimeZichang Liu, Jue Wang, Tri Dao, Tianyi Zhou 等ICML 2023 · 被引用 318 次
- Pixelated Butterfly: Simple and Efficient Sparse training for Neural Network ModelsBeidi Chen, Tri Dao, Kaizhao Liang, Jiaming Yang 等ICLR 2022 · 被引用 94 次
- Kernel Density Estimation through Density Constrained Near Neighbor SearchMoses Charikar, Michael Kapralov, Navid Nouri, Paris SiminelakisFOCS 2020 · 被引用 9 次
相关 Paper
- Subquadratic Algorithms and Hardness for Attention with Any TemperatureShreya Gupta, Boyang Huang, Barna Saha, Yinzhan Xu 等ICLR 2026 · 被引用 5 次
- How to Capture Higher-order Correlations? Generalizing Matrix Softmax Attention to Kronecker ComputationJosh Alman, Zhao SongICLR 2024 · 被引用 53 次
- Algorithm and Hardness for Dynamic Attention Maintenance in Large Language ModelsJan van den Brand, Zhao Song, Tianyi ZhouICML 2024 · 被引用 35 次
- Improved Algorithms for Kernel Matrix-Vector Multiplication Under Sparsity AssumptionsPiotr Indyk, Michael Kapralov, Kshiteej Sheth, Tal WagnerICLR 2025
- Sublinear Time Quantum Algorithm for Attention ApproximationZhao Song, Jianfei Xue, Jiahao Zhang, Lichen ZhangICLR 2026 · 被引用 2 次
