Algorithm and Hardness for Dynamic Attention Maintenance in Large Language Models
Jan van den Brand, Zhao Song, Tianyi Zhou
摘要
Large language models (LLMs) have made fundamental changes in human life. The attention scheme is one of the key components over all the LLMs, such as BERT, GPT-1, Transformers, GPT-2, 3, 3.5 and 4. Inspired by previous theoretical study of static version of the attention multiplication problem [Zandieh, Han, Daliri, and Karbasi arXiv 2023, Alman and Song arXiv 2023]. In this work, we formally define a dynamic version of attention matrix multiplication problem. There are matrices , they represent query, key and value in LLMs. In each iteration we update one entry in or . In the query stage, we receive as input, and want to answer , where is a square matrix and is a diagonal matrix. Here denote a length- vector that all the entries are ones. We provide two results: an algorithm and a conditional lower bound. On one hand, inspired by the lazy update idea from [Demetrescu and Italiano FOCS 2000, Sankowski FOCS 2004, Cohen, Lee and Song STOC 2019, Brand SODA 2020], we provide a data-structure that uses amortized update time, and worst-case query time. On the other hand, show that unless the hinted matrix vector multiplication conjecture [Brand, Nanongkai and Saranurak FOCS 2019] is false, there is no algorithm that can use both amortized update time, and worst query time. In conclusion, our algorithmic result is conditionally optimal unless hinted matrix vector multiplication conjecture is false.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 16 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Deja Vu: Contextual Sparsity for Efficient LLMs at Inference Time 引用了 The Closeness of In-Context Learning and Weight Shifting for Softmax Regression
- The Closeness of In-Context Learning and Weight Shifting for Softmax Regression 引用了 Deja Vu: Contextual Sparsity for Efficient LLMs at Inference Time
- Deja Vu: Contextual Sparsity for Efficient LLMs at Inference Time 引用了 Language Models are Few-Shot Learners
- Inductive Biases and Variable Creation in Self-Attention Mechanisms 引用了 Language Models are Few-Shot Learners
- Inductive Biases and Variable Creation in Self-Attention Mechanisms 引用了 Are Transformers universal approximators of sequence-to-sequence functions?
- H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models 引用了 Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models 引用了 Inductive Biases and Variable Creation in Self-Attention Mechanisms
- H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models 引用了 The Closeness of In-Context Learning and Weight Shifting for Softmax Regression
- H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models 引用了 Language Models are Few-Shot Learners
- H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models 引用了 How to Protect Copyright Data in Optimization of Large Language Models?
- The Closeness of In-Context Learning and Weight Shifting for Softmax Regression 引用了 Inductive Biases and Variable Creation in Self-Attention Mechanisms
- The Closeness of In-Context Learning and Weight Shifting for Softmax Regression 引用了 Language Models are Few-Shot Learners
- The Closeness of In-Context Learning and Weight Shifting for Softmax Regression 引用了 Are Transformers universal approximators of sequence-to-sequence functions?
- The Closeness of In-Context Learning and Weight Shifting for Softmax Regression 引用了 On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis
- How to Protect Copyright Data in Optimization of Large Language Models? 引用了 Deja Vu: Contextual Sparsity for Efficient LLMs at Inference Time
- How to Protect Copyright Data in Optimization of Large Language Models? 引用了 The Closeness of In-Context Learning and Weight Shifting for Softmax Regression
- How to Protect Copyright Data in Optimization of Large Language Models? 引用了 Language Models are Few-Shot Learners
- On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis 引用了 Language Models are Few-Shot Learners
引用它的顶会 Paper16
- 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 次引用
- The Closeness of In-Context Learning and Weight Shifting for Softmax RegressionShuai Li, Zhao Song, Yu Xia, Tong Yu 等NeurIPS 2024 · 53 次引用
- On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity AnalysisJerry Yao-Chieh Hu, Thomas Lin, Zhao Song, Han LiuICML 2024 · 47 次引用
- How to Protect Copyright Data in Optimization of Large Language Models?Timothy Chu, Zhao Song, Chiwun YangAAAI 2024 · 42 次引用
它引用的 Paper19
- 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 次引用
- Are Transformers universal approximators of sequence-to-sequence functions?Chulhee Yun, Srinadh Bhojanapalli, Ankit Singh Rawat, Sashank J. Reddi 等ICLR 2020 · 481 次引用
- A Refined Laser Method and Faster Matrix MultiplicationJosh Alman, Virginia Vassilevska WilliamsSODA 2021 · 275 次引用
- Inductive Biases and Variable Creation in Self-Attention MechanismsBenjamin L. Edelman, Surbhi Goel, Sham M. Kakade, Cyril ZhangICML 2022 · 154 次引用
相关 Paper
- Fast Attention Requires Bounded EntriesJosh Alman, Zhao SongNeurIPS 2023 · 115 次引用
- Sublinear Time Quantum Algorithm for Attention ApproximationZhao Song, Jianfei Xue, Jiahao Zhang, Lichen ZhangICLR 2026 · 2 次引用
- The Fine-Grained Complexity of Gradient Computation for Training Large Language ModelsJosh Alman, Zhao SongNeurIPS 2024 · 33 次引用
- HyperAttention: Long-context Attention in Near-Linear TimeInsu Han, Rajesh Jayaram, Amin Karbasi, Vahab Mirrokni 等ICLR 2024 · 104 次引用
- Subquadratic Algorithms and Hardness for Attention with Any TemperatureShreya Gupta, Boyang Huang, Barna Saha, Yinzhan Xu 等ICLR 2026 · 5 次引用
