The Fine-Grained Complexity of Gradient Computation for Training Large Language Models
Josh Alman, Zhao Song
Abstract
Large language models (LLMs) have made fundamental contributions over the last a few years. To train an LLM, one needs to alternatingly run forward' computations and backward' computations. The forward computation can be viewed as attention function evaluation, and the backward computation can be viewed as a gradient computation. In previous work by [Alman and Song, NeurIPS 2023], it was proved that the forward step can be performed in almost-linear time in certain parameter regimes, but that there is no truly sub-quadratic time algorithm in the remaining parameter regimes unless the popular hypothesis SETH is false. In this work, we show nearly identical results for the harder-seeming problem of computing the gradient of loss function of one layer attention network, and thus for the entire process of LLM training. This completely characterizes the fine-grained complexity of every step of LLM training.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
16 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- A Simple and Effective Pruning Approach for Large Language Models cites Language Models are Few-Shot Learners
- A Simple and Effective Pruning Approach for Large Language Models cites SparseGPT: Massive Language Models Can be Accurately Pruned in One-Shot
- Fine-Tuning Language Models with Just Forward Passes cites Language Models are Few-Shot Learners
- The Closeness of In-Context Learning and Weight Shifting for Softmax Regression cites Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Models
- The Closeness of In-Context Learning and Weight Shifting for Softmax Regression cites Language Models are Few-Shot Learners
- The Closeness of In-Context Learning and Weight Shifting for Softmax Regression cites Outlier-Efficient Hopfield Layers for Large Transformer-Based Models
- The Closeness of In-Context Learning and Weight Shifting for Softmax Regression cites On Statistical Rates and Provably Efficient Criteria of Latent Diffusion Transformers (DiTs)
- The Closeness of In-Context Learning and Weight Shifting for Softmax Regression cites On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis
- Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Models cites Outlier-Efficient Hopfield Layers for Large Transformer-Based Models
- Outlier-Efficient Hopfield Layers for Large Transformer-Based Models cites Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Models
- Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Models cites On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis
- On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis cites Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Models
- Outlier-Efficient Hopfield Layers for Large Transformer-Based Models cites Language Models are Few-Shot Learners
- Outlier-Efficient Hopfield Layers for Large Transformer-Based Models cites On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis
- On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis cites Outlier-Efficient Hopfield Layers for Large Transformer-Based Models
- On Statistical Rates and Provably Efficient Criteria of Latent Diffusion Transformers (DiTs) cites Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Models
- On Statistical Rates and Provably Efficient Criteria of Latent Diffusion Transformers (DiTs) cites Language Models are Few-Shot Learners
- On Statistical Rates and Provably Efficient Criteria of Latent Diffusion Transformers (DiTs) cites Outlier-Efficient Hopfield Layers for Large Transformer-Based Models
- On Statistical Rates and Provably Efficient Criteria of Latent Diffusion Transformers (DiTs) cites On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis
- On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis cites Language Models are Few-Shot Learners
Cited by top-tier papers16
- The Closeness of In-Context Learning and Weight Shifting for Softmax RegressionShuai Li, Zhao Song, Yu Xia, Tong Yu et al.NeurIPS 2024 · 53 citations
- On Statistical Rates and Provably Efficient Criteria of Latent Diffusion Transformers (DiTs)Jerry Yao-Chieh Hu, Weimin Wu, Zhuoru Li, Sophia Pi et al.NeurIPS 2024 · 49 citations
- On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity AnalysisJerry Yao-Chieh Hu, Thomas Lin, Zhao Song, Han LiuICML 2024 · 47 citations
- Outlier-Efficient Hopfield Layers for Large Transformer-Based ModelsJerry Yao-Chieh Hu, Pei-Hsuan Chang, Haozheng Luo, Hong-Yu Chen et al.ICML 2024 · 46 citations
- Uniform Memory Retrieval with Larger Capacity for Modern Hopfield ModelsDennis Wu, Jerry Yao-Chieh Hu, Teng-Yun Hsiao, Han LiuICML 2024 · 44 citations
Builds on31
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 citations
- SparseGPT: Massive Language Models Can be Accurately Pruned in One-ShotElias Frantar, Dan AlistarhICML 2023 · 1,240 citations
- A Simple and Effective Pruning Approach for Large Language ModelsMingjie Sun, Zhuang Liu, Anna Bair, J. Zico KolterICLR 2024 · 794 citations
- Fine-Tuning Language Models with Just Forward PassesSadhika Malladi, Tianyu Gao, Eshaan Nichani, Alex Damian et al.NeurIPS 2023 · 495 citations
Related papers
- Subquadratic Algorithms and Hardness for Attention with Any TemperatureShreya Gupta, Boyang Huang, Barna Saha, Yinzhan Xu et al.ICLR 2026 · 5 citations
- Fast Attention Requires Bounded EntriesJosh Alman, Zhao SongNeurIPS 2023 · 115 citations
- How to Protect Copyright Data in Optimization of Large Language Models?Timothy Chu, Zhao Song, Chiwun YangAAAI 2024 · 42 citations
- Algorithm and Hardness for Dynamic Attention Maintenance in Large Language ModelsJan van den Brand, Zhao Song, Tianyi ZhouICML 2024 · 35 citations
- Universal One-third Time Scaling in Learning Peaked DistributionsYizhou Liu, Ziming Liu, Cengiz Pehlevan, Jeff GoreICML 2026 · 6 citations
