arXiv:2601.15158cs.LGcs.AI2026-01被引 1

用结果奖励训练的Transformer能自发推理,但需合适数据

Outcome-Based RL Provably Leads Transformers to Reason, but Only With the Right Data

  • 通过最终答案正确性引导梯度,让模型自发生成逐步推理
  • 仅当训练数据包含简单例题时,模型才能学会可外推的推理策略
  • 理论与实验结合,揭示了真实模型推理能力的关键条件

通过结果导向的强化学习训练的Transformer能够自发生成中间推理步骤(思维链)。然而,稀疏奖励如何驱动策略梯度发现系统性推理机制仍不明确。本文在一项无需思维链无法解决但存在简单迭代解法的合成图遍历任务上,分析单层Transformer的策略梯度动态。证明尽管仅基于最终答案正确性进行训练,策略梯度仍会引导Transformer收敛到一种结构化、可解释的逐顶点遍历算法。我们刻画了该现象出现所需的分布特性,指出‘简单例题’——即所需推理步骤较少的样本——起关键作用。当训练分布中此类简单例题占比足够高时,Transformer能学到可泛化的遍历策略并推广至更长链;若该比例消失,策略梯度学习将不可行。我们在合成数据及真实语言模型的数学推理任务上验证了理论结果,表明其在实际场景中依然成立。

原文摘要 · Abstract (English)

Transformers trained via Reinforcement Learning (RL) with outcome-based supervision can spontaneously develop the ability to generate intermediate reasoning steps (Chain-of-Thought). Yet the mechanism by which sparse rewards drive policy gradient to discover such systematic reasoning remains poorly understood. We address this by analyzing the policy gradient dynamics of single-layer Transformers on a synthetic graph traversal task that cannot be solved without Chain-of-Thought but admits a simple iterative solution. We prove that despite training solely on final-answer correctness, policy gradient drives the Transformer to converge to a structured, interpretable algorithm that iteratively traverses the graph vertex-by-vertex. We characterize the distributional properties required for this emergence, identifying the critical role of "simple examples": instances requiring fewer reasoning steps. When the training distribution places sufficient mass on these simpler examples, the Transformer learns a generalizable traversal strategy that extrapolates to longer chains; when this mass vanishes, policy gradient learning becomes infeasible. We corroborate our theoretical results through experiments on synthetic data and with real-world language models on mathematical reasoning tasks, validating that our theoretical findings carry over to practical settings.

强化学习思维链Transformer推理机制

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