How to Capture Higher-order Correlations? Generalizing Matrix Softmax Attention to Kronecker Computation
Josh Alman, Zhao Song
摘要
In the classical transformer attention scheme, we are given three size matrices (the query, key, and value tokens), and the goal is to compute a new size matrix where . In this work, we study a generalization of attention which captures triple-wise correlations. This generalization is able to solve problems about detecting triple-wise connections that were shown to be impossible for transformers. The potential downside of this generalization is that it appears as though computations are even more difficult, since the straightforward algorithm requires cubic time in . However, we show that in the bounded-entry setting (which arises in practice, and which is well-studied in both theory and practice), there is actually a near-linear time algorithm. More precisely, we show that bounded entries are both necessary and sufficient for quickly performing generalized computations: On the positive side, if all entries of the input matrices are bounded above by then we show how to approximate the ``tensor-type'' attention matrix in time. On the negative side, we show that if the entries of the input matrices may be as large as , then there is no algorithm that runs faster than (assuming the Strong Exponential Time Hypothesis from fine-grained complexity theory). We also show that our construction, algorithms, and lower bounds naturally generalize to higher-order tensors and correlations. Interestingly, the higher the order of the tensors, the lower the bound on the entries needs to be for an efficient algorithm. Our results thus yield a natural tradeoff between the boundedness of the entries, and order of the tensor one may use for more expressive, efficient attention computation.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 19 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 引用了 Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 引用了 Language Models are Few-Shot Learners
- SmoothQuant: Accurate and Efficient Post-Training Quantization for Large Language Models 引用了 Language Models are Few-Shot Learners
- 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 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models 引用了 SmoothQuant: Accurate and Efficient Post-Training Quantization for Large Language Models
- 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
- FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning 引用了 Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- 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 引用了 Outlier-Efficient Hopfield Layers for Large Transformer-Based Models
- The Closeness of In-Context Learning and Weight Shifting for Softmax Regression 引用了 On Statistical Rates and Provably Efficient Criteria of Latent Diffusion Transformers (DiTs)
- The Closeness of In-Context Learning and Weight Shifting for Softmax Regression 引用了 On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis
- Outlier-Efficient Hopfield Layers for Large Transformer-Based Models 引用了 Language Models are Few-Shot Learners
- Outlier-Efficient Hopfield Layers for Large Transformer-Based Models 引用了 On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis
- On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis 引用了 Outlier-Efficient Hopfield Layers for Large Transformer-Based Models
- On Statistical Rates and Provably Efficient Criteria of Latent Diffusion Transformers (DiTs) 引用了 Language Models are Few-Shot Learners
- On Statistical Rates and Provably Efficient Criteria of Latent Diffusion Transformers (DiTs) 引用了 Outlier-Efficient Hopfield Layers for Large Transformer-Based Models
- On Statistical Rates and Provably Efficient Criteria of Latent Diffusion Transformers (DiTs) 引用了 On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis
- On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis 引用了 Language Models are Few-Shot Learners
引用它的顶会 Paper19
- H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language ModelsZhenyu Zhang, Ying Sheng, Tianyi Zhou, Tianlong Chen 等NeurIPS 2023 · 1,003 次引用
- The Closeness of In-Context Learning and Weight Shifting for Softmax RegressionShuai Li, Zhao Song, Yu Xia, Tong Yu 等NeurIPS 2024 · 53 次引用
- On Statistical Rates and Provably Efficient Criteria of Latent Diffusion Transformers (DiTs)Jerry Yao-Chieh Hu, Weimin Wu, Zhuoru Li, Sophia Pi 等NeurIPS 2024 · 49 次引用
- On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity AnalysisJerry Yao-Chieh Hu, Thomas Lin, Zhao Song, Han LiuICML 2024 · 47 次引用
- Outlier-Efficient Hopfield Layers for Large Transformer-Based ModelsJerry Yao-Chieh Hu, Pei-Hsuan Chang, Haozheng Luo, Hong-Yu Chen 等ICML 2024 · 46 次引用
它引用的 Paper18
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra 等NeurIPS 2022 · 5,493 次引用
- Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 次引用
- FlashAttention-2: Faster Attention with Better Parallelism and Work PartitioningTri DaoICLR 2024 · 2,600 次引用
- SmoothQuant: Accurate and Efficient Post-Training Quantization for Large Language ModelsGuangxuan Xiao, Ji Lin, Mickaël Seznec, Hao Wu 等ICML 2023 · 1,493 次引用
相关 Paper
- Fast Attention Requires Bounded EntriesJosh Alman, Zhao SongNeurIPS 2023 · 115 次引用
- Poly-attention: a general scheme for higher-order self-attentionSayak Chakrabarti, Toniann Pitassi, Josh AlmanICLR 2026 · 3 次引用
- Subquadratic Algorithms and Hardness for Attention with Any TemperatureShreya Gupta, Boyang Huang, Barna Saha, Yinzhan Xu 等ICLR 2026 · 5 次引用
- Representational Strengths and Limitations of TransformersClayton Sanford, Daniel J. Hsu, Matus TelgarskyNeurIPS 2023 · 162 次引用
- Conv-Basis: A New Paradigm for Efficient Attention Inference and Gradient Computation in TransformersYingyu Liang, Heshan Liu, Zhenmei Shi, Zhao Song 等EMNLP Findings 2025
