arXiv:2511.07378cs.LGcs.AI2025-11NeurIPS被引 20

证明了Transformer通过注意力机制可外推长链推理,解决更复杂问题。

Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization

  • 基于注意力集中机制分析模型外推能力
  • 理论证明可处理比以往复杂得多的逻辑问题
  • 适合关注大模型推理能力与可解释性的研究者

推理能力是人工智能的核心,复杂问题往往需要更深入、更长的思维链(CoT)来解决。一个关键问题是:模型能否将已学的推理模式外推到更难、更长的任务中?本文通过梯度下降在合成状态追踪任务上的理论分析,数学证明了状态追踪问题的代数结构如何决定学习到的CoT的外推程度。具体而言,理论揭示了注意力集中机制对长上下文推理的控制作用,将注意力层的鲁棒性与状态追踪任务结构关联起来。对于推理长度有限的Transformer,我们证明递归自训练方案可逐步扩展可解问题的长度范围。据我们所知,这是首个关于常深Transformer以CoT形式可证明学习$ extsf{NC}^1$-完备问题的优化保证,显著超越以往局限于$ extsf{TC}^0$的工作,除非广泛接受的猜想$ extsf{TC}^0 eq extsf{NC}^1$不成立。最后,大量实验验证了理论结果,确认了长度外推行为及注意力集中的机制。

原文摘要 · Abstract (English)

The ability to reason lies at the core of artificial intelligence (AI), and challenging problems usually call for deeper and longer reasoning to tackle. A crucial question about AI reasoning is whether models can extrapolate learned reasoning patterns to solve harder tasks with longer chain-of-thought (CoT). In this work, we present a theoretical analysis of transformers learning on synthetic state-tracking tasks with gradient descent. We mathematically prove how the algebraic structure of state-tracking problems governs the degree of extrapolation of the learned CoT. Specifically, our theory characterizes the length generalization of transformers through the mechanism of attention concentration, linking the retrieval robustness of the attention layer to the state-tracking task structure of long-context reasoning. Moreover, for transformers with limited reasoning length, we prove that a recursive self-training scheme can progressively extend the range of solvable problem lengths. To our knowledge, we provide the first optimization guarantee that constant-depth transformers provably learn $\mathsf{NC}^1$-complete problems with CoT, significantly going beyond prior art confined in $\mathsf{TC}^0$, unless the widely held conjecture $\mathsf{TC}^0 \neq \mathsf{NC}^1$ fails. Finally, we present a broad set of experiments supporting our theoretical results, confirming the length generalization behaviors and the mechanism of attention concentration.

Transformer链式推理理论分析长度外推

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。