Transformer可证明地内化思维链
Transformers Provably Learn to Internalize Chain-of-Thought
AI总结:
提出Log-ICoT课程训练,使L层Transformer用多项式样本学习k-奇偶性,匹配显式CoT的样本效率且消除推理开销。
摘要:
思维链提示显著提高了transformer的样本效率,将奇偶学习等任务的复杂度从输入长度的指数级降低到多项式级。然而,在推理时生成显式推理步骤的计算成本很高。隐式思维链作为一种有前景的经验性补救措施出现,它训练模型在隐藏状态内内化中间步骤,但其理论基础仍不清楚。我们首次对ICoT进行理论分析,证明在我们提出的Log-ICoT课程下训练的$L$层transformer可以用$\mathsf{poly}(n)$个样本和$L = \log_2 k$个训练阶段学习$k$-奇偶性。这匹配了显式CoT的样本效率,同时消除了其推理开销,并将先前的一层奇偶性保证扩展到多层架构。与每次移除一个思考令牌的标准ICoT相比,Log-ICoT以几何块的方式移除它们,将阶段数从$k$的线性减少到对数。多层transformer上的实验证实了该理论,并可视化了推理如何逐步被吸收到更深层中。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。