证明Transformer可内部化思维链,提升推理效率
Transformers Provably Learn to Internalize Chain-of-Thought

- 设计分阶段删除思维步骤的Log-ICoT训练法
- 用多项式样本数实现k-奇偶性任务的高效学习
- 适合研究大模型内在推理机制的研究者
思维链(CoT)提示显著提升Transformer的样本效率,使奇偶性学习任务的复杂度从指数级降至多项式级。但推理时显式生成思维步骤成本高。隐式思维链(ICoT)通过训练模型将中间步骤内化至隐藏状态,成为有前景的解决方案,但其理论基础尚不清晰。本文首次对ICoT进行理论分析,证明在提出的Log-ICoT课程下,一个L层Transformer可使用poly(n)样本完成k-奇偶性任务,且L = log₂k。该方法在保持显式CoT的样本效率的同时,消除了推理开销,并将多层架构下的理论保证扩展至前人仅限单层的结果。相比标准ICoT逐个移除思考标记,Log-ICoT采用几何级数方式移除,将训练阶段数从O(k)降至O(log k)。多层Transformer实验验证了理论结果,并可视化了推理过程逐步被深层吸收的现象。
原文摘要 · Abstract (English)
Chain-of-Thought (CoT) prompting substantially improves the sample efficiency of transformers, reducing the complexity of tasks like parity learning from exponential to polynomial in the input length. However, generating explicit reasoning steps at inference is computationally expensive. Implicit Chain-of-Thought (ICoT) has emerged as a promising empirical remedy that trains models to internalize intermediate steps within their hidden states, but its theoretical foundations remain poorly understood. We give the first theoretical analysis of ICoT, proving that an $L$-layer transformer trained under our proposed Log-ICoT curriculum learns $k$-parity with $\mathsf{poly}(n)$ samples and $L = \log_2 k$ training stages. This matches the sample efficiency of explicit CoT while eliminating its inference overhead, and extends prior one-layer parity guarantees to multi-layer architectures. Compared to standard ICoT, which removes thinking tokens one at a time, Log-ICoT removes them in geometric chunks, reducing the number of stages from linear in $k$ to logarithmic. Experiments on multi-layer transformers confirm the theory and visualize how reasoning is progressively absorbed into deeper layers.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。