Chain-of-Thought Gradient Descent
Hong-Yu Chen, Venkat Ganti, Hude Liu, Jerry Yao-Chieh Hu, Han Liu
Abstract
We show that Chain-of-Thought (CoT) expands the expressiveness of Transformer in-context learning (ICL). Specifically, we show CoT enable efficient simulation of In-Context Gradient Descent (ICGD) for -layer neural network. Different from CoT, a Transformer with fixed depth and hidden dimension has fixed ICL capacity in one forward pass. Simulating larger models or more optimization steps in-context requires deeper or wider Transformers. CoT removes this limitation by providing an expandable workspace via the sequence trajectory. This enables arbitrary-step and arbitrary-capacity ICGD within a constant-depth Transformer. Second, we provide a provable efficient guarantee unique to CoT through dynamical masking. The attention mechanism only process the relevant tokens for the current update step. This eliminates the redundant ``process everything'' cost of single-pass deep models. Specifically, we prove this CoT mechanism improves the computational cost of the prior best in-context result [Wu et al., ICML 2025] by . Numerical validations support our theory.
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.
3 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
- Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization cites Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective
- Optimality and NP-Hardness of Transformers in Learning Markovian Dynamical Functions cites Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection
- Optimality and NP-Hardness of Transformers in Learning Markovian Dynamical Functions cites Looped Transformers as Programmable Computers
- Optimality and NP-Hardness of Transformers in Learning Markovian Dynamical Functions cites Why Can GPT Learn In-Context? Language Models Secretly Perform Gradient Descent as Meta-Optimizers
- Optimality and NP-Hardness of Transformers in Learning Markovian Dynamical Functions cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection cites Looped Transformers as Programmable Computers
- Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection cites Why Can GPT Learn In-Context? Language Models Secretly Perform Gradient Descent as Meta-Optimizers
- Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Looped Transformers as Programmable Computers cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Provable Sample Efficiency of Curriculum Post-Training for Transformer Reasoning cites Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization
- Why Can GPT Learn In-Context? Language Models Secretly Perform Gradient Descent as Meta-Optimizers cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective cites Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection
- Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective cites Looped Transformers as Programmable Computers
- Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective cites Why Can GPT Learn In-Context? Language Models Secretly Perform Gradient Descent as Meta-Optimizers
- Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
Cited by top-tier papers3
- Transformers Provably Learn Chain-of-Thought Reasoning with Length GeneralizationYu Huang, Zixin Wen, Aarti Singh, Yuejie Chi et al.NeurIPS 2025 · 22 citations
- Optimality and NP-Hardness of Transformers in Learning Markovian Dynamical FunctionsYanna Ding, Songtao Lu, Yingdong Lu, Tomasz Nowicki et al.NeurIPS 2025 · 1 citation
- Provable Sample Efficiency of Curriculum Post-Training for Transformer ReasoningDake Bu, Wei Huang, Andi Han, Atsushi Nitanda et al.ICML 2026
Builds on8
- What Can Transformers Learn In-Context? A Case Study of Simple Function ClassesShivam Garg, Dimitris Tsipras, Percy Liang, Gregory ValiantNeurIPS 2022 · 883 citations
- Towards Revealing the Mystery behind Chain of Thought: A Theoretical PerspectiveGuhao Feng, Bohang Zhang, Yuntian Gu, Haotian Ye et al.NeurIPS 2023 · 470 citations
- Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm SelectionYu Bai, Fan Chen, Huan Wang, Caiming Xiong et al.NeurIPS 2023 · 356 citations
- Looped Transformers as Programmable ComputersAngeliki Giannou, Shashank Rajput, Jy-yong Sohn, Kangwook Lee et al.ICML 2023 · 175 citations
- Why Can GPT Learn In-Context? Language Models Secretly Perform Gradient Descent as Meta-OptimizersDamai Dai, Yutao Sun, Li Dong, Yaru Hao et al.ACL Findings 2023 · 154 citations
Related papers
- Transformers Learn to Implement Multi-step Gradient Descent with Chain of ThoughtJianhao Huang, Zixuan Wang, Jason D. LeeICLR 2025
- In-Context Deep Learning via Transformer ModelsWeimin Wu, Maojiang Su, Jerry Yao-Chieh Hu, Zhao Song et al.ICML 2025
- Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization AnalysisHongkang Li, Songtao Lu, Pin-Yu Chen, Xiaodong Cui et al.ICLR 2025
- Chain of Thought Empowers Transformers to Solve Inherently Serial ProblemsZhiyuan Liu, Hong Liu, Denny Zhou, Tengyu MaICLR 2024 · 259 citations
- Chain-of-Thought Provably Enables Learning the (Otherwise) UnlearnableChenxiao Yang, Zhiyuan Li, David WipfICLR 2025
