cs.LGJan 21, 2026

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

Authors: Yuval Ran-Milo, Yotam Alexander, Shahar Mendel, Nadav Cohen

Organizations: Tel Aviv University

Abstract

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 linear 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.

Figures & tables

Appendix figures & tables6 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Transformers Provably Learn to Internalize Chain-of-Thought

    May 27, 2026Yixiao Huang, Hanlin Zhu, Zixuan Wang +4TransformerCoT Reasoning

  2. Transformers with CoT Discover Heavy-Ball Acceleration Through Training

    Oct 22, 2026Yuxuan Cai, Yuan CaoCoT ReasoningNeural Algorithmic Reasoning