思维链(Chain-of-Thought, CoT)推理可大幅提升大型语言模型(Large Language Models, LLMs)的性能,但其分布外(Out-of-Distribution, OOD)泛化机制仍缺乏理论层面的深入探索。本研究将CoT视为组合式分布外泛化问题:目标任务缺乏完整推理轨迹或直接的输入-输出对,而训练仅提供分布内(In-Distribution, ID)的原子步骤数据。研究表明,CoT通过反复应用共享的单步预测器来组合可复用的分布内转移实现泛化。理论层面,设T为目标任务的推理步骤数,n为每个子任务的训练样本数,k为每步的输出标记数,则分布外任务风险由各分布内子任务风险之和控制,缩放系数为O(k)阶且与T无关,尽管风险总和本身仍可能随T增长。拉德马赫复杂度分析进一步显示,由于共享类在统一容量控制下的预测器共享,估计项为O(√(T/n))阶,而非与T线性相关。对于自回归下一个标记预测,最终任务风险受限于最优单步风险乘以相同的O(k)阶系数,加上O~(k√(T/n))阶的估计项。奇偶耦合构造进一步表明,对于子任务经验风险最小化器,当T≤n时,期望最终任务风险至少为最优单步风险加上Ω(√(T/n))。在Atom-Task和GSM8K上的实验验证了该理论:CoT可实现短到长及组合式泛化,而显式状态跟踪至关重要。本研究代码可在该https URL获取。
英文摘要:
Chain-of-Thought (CoT) reasoning substantially improves Large Language Models (LLMs), yet its out-of-distribution (OOD) generalization mechanism remains theoretically underexplored. We study CoT as compositional OOD generalization: the target task lacks complete reasoning trajectories or direct input-output pairs, while training provides only in-distribution (ID) atomic step data. We show that CoT generalizes by repeatedly applying a shared single-step predictor to compose reusable ID transitions. Theoretically, let $T$ denote the number of reasoning steps in the target task, $n$ the number of training samples per sub-task, and $k$ the number of output tokens per step; then the OOD task risk is controlled by the sum of the ID sub-task risks, scaled by a coefficient of order $\mathcal{O}(k)$ that is independent of $T$, although the summed risk itself may still grow with $T$. A Rademacher-complexity analysis further shows that the estimation term is of order $\mathcal{O}(\sqrt{T/n})$, rather than linear in $T$, due to predictor sharing under a uniform capacity control on the shared class. For autoregressive Next-Token Prediction, the final-task risk is bounded by the best-in-class step-level risk scaled by the same coefficient of order $\mathcal{O}(k)$, plus an estimation term of order $\widetilde{\mathcal{O}}\big(k\sqrt{T/n}\big)$. A parity-coupled construction further shows that, for the sub-task empirical risk minimizer, the expected final-task risk is at least the best in-class risk plus $Ω(\sqrt{T/n})$ when $T\le n$. Experiments on Atom-Task and GSM8K support the theory: CoT enables short-to-long and compositional generalization, while explicit state tracking is crucial.
Our code is available at https://github.com/maxliang114514/CoT-OOD.
Retrieval-of-Thought: Efficient Reasoning via Reusing Thoughts
Department of Computer Science and Engineering, University of Minnesota(明尼苏达大学计算机科学与工程系);Department of Computer Science and Engineering, University of California Santa Cruz(加州大学圣克鲁兹分校计算机科学与工程系);Argonne National Laboratory(阿贡国家实验室)
Training Multimodal Large Reasoning Models Needs Better Thoughts: A Three-Stage Framework for Long Chain-of-Thought Synthesis and Selection
School of Computer Science and Engineering(计算机科学与工程学院);Key Laboratory of Computer Network and Information Integration (SEU), Ministry of Education(计算机网络与信息集成重点实验室(SEU))
Landscape of Thoughts: Visualizing the Reasoning Process of Large Language Models
TMLR Group, Hong Kong Baptist University(香港 Baptist 大学 TMLR 团体);Stanford University(斯坦福大学);Mila - Québec AI Institute(魁北克 AI 院);Université de Montréal(蒙特利尔大学);HEC Montréal(蒙特利尔 HEC 学院);Intel AI Lab(英特尔 AI 实验室)
Spectral-Progressive Thought Flow for Lightweight Multimodal Reasoning
Informatics Institute, University of Amsterdam, Amsterdam, The Netherlands(阿姆斯特丹大学信息学院);Department of Computer Science, University College London(伦敦大学学院计算机科学系);University of Thessaly, Volos, Greece(塞萨洛尼基大学);Department of Electronic and Electrical Engineering, Trinity College Dublin, Dublin, Ireland(都柏林信任学院电子与电气工程系);School of Information Technology, Halmstad University, Halmstad, Sweden(哈姆斯塔德大学信息科技学院);Amazon AGI, Seattle, USA(亚马逊人工智能研究部)
Thought Purity: A Defense Framework For Chain-of-Thought Attack
Huzhou University(湖州大学);Zhejiang Key Laboratory of Intelligent Education Technology and Application(浙江智能教育技术与应用重点实验室);University of Science and Technology of China(中国科学技术大学);Alibaba Group(阿里巴巴集团);Zhejiang University of Technology(浙江工业大学)
Think Consistently, Reason Efficiently: Energy-Based Calibration for Implicit Chain-of-Thought
University of Oxford(牛津大学);Tsinghua University(清华大学);Tencent(腾讯);Southern University of Science and Technology(南方科技大学);National University of Singapore(新加坡国立大学)
Understanding Reasoning in Chain-of-Thought from the Hopfieldian View
King Abdullah University of Science and Technology(阿卜杜拉国王科技大学);Soochow University(苏州大学);University of Southampton(南安普顿大学);Arizona State University(亚利桑那州立大学)