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

*Yuval Ran-Milo, ‪Yotam Alexander‬‏, Shahar Mendel, Nadav Cohen*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/151111) · [OpenReview](https://openreview.net/forum?id=ctcKsexBkZ) · [alphaXiv](https://www.alphaxiv.org/abs/2601.15158) · [Open on the map](../papers.html#p151111)

Category: [Interpretability & Model Adaptation](../pcat/15.md) › [Chain-of-Thought Reasoning in Transformers](../pgroup/310.md) · Type: theory · Keywords: outcome-based reinforcement learning, policy gradient, chain-of-thought reasoning, Transformer dynamics, simple examples, graph traversal

Areas: [LLM Reasoning](../areas/reasoning.md) › Reasoning Mechanisms › Looped Reasoning; [RL for LLMs & Agents](../areas/llm-rl.md) › LLM Reasoning Reinforcement Learning › Reinforcement Learning for Language Models

## Summary
The paper theoretically shows that outcome-based RL can cause Transformers to learn chain-of-thought reasoning, but only when the training data contains enough simple examples.

## Explained to a 5-year-old
A robot learns to solve puzzles by getting rewards only when it finishes correctly. It sometimes figures out step-by-step how to get there by thinking out loud. This happens when the robot sees many easy puzzles first. If it only sees hard puzzles, it gets stuck. The researchers proved why this works and tested it on simple games.

## Explained to a 5-year-old, longer
Imagine a computer program that tries to solve a puzzle. It only gets a reward when it finishes the puzzle correctly. Sometimes it learns to think about each step before moving to the next. This thinking is like talking to itself out loud. The researchers looked at a special kind of computer called a transformer. They gave it a simple graph puzzle that needs step-by-step solving. They proved that if the program sees many easy puzzles first, it will learn a good way to solve harder ones. If the easy puzzles are missing, the program cannot learn at all. They tested their ideas on made-up puzzles and on real language models doing math problems. The results show that having simple examples is key to getting the program to reason. This helps us understand how AI can be taught to think clearly. It also suggests that when we train AI, we should include easy examples to help it learn better.

## For a technical reader
We study how Transformers trained with outcome-based RL can develop chain-of-thought reasoning. By analyzing policy gradient dynamics on a synthetic graph traversal task, we prove convergence to an interpretable algorithm when the training data contains enough simple examples. Empirical validation on synthetic data and real language models confirms the theory. The work highlights the importance of data distribution in enabling systematic reasoning.

## Problem
Understanding how policy gradient with only final-answer rewards leads Transformers to spontaneously generate intermediate reasoning steps is unclear, and the conditions under which such systematic reasoning emerges are unknown.

## Method
The authors analyze the policy gradient dynamics of single-layer Transformers on a synthetic graph traversal task, proving that the Transformer converges to an interpretable vertex-by-vertex algorithm under certain data distributions. They characterize how the presence of simple examples (fewer reasoning steps) in the training data is critical for learning a generalizable strategy. Empirical experiments on synthetic data and real language models validate the theory.

## Contributions
Provides a theoretical analysis of how outcome-based RL leads Transformers to develop chain-of-thought reasoning, identifies the crucial role of simple examples in the training distribution, and validates the findings empirically on synthetic and real language models.

## Limitations and assumptions
The analysis relies on a simplified single-layer Transformer and a synthetic graph task; real models may have additional complexities.

## Practical relevance
The findings guide the design of RL-trained language models to reliably induce chain-of-thought reasoning by ensuring diverse, simple examples in training.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/151111)
