Understanding the Out-of-Distribution Generalization of Chain-of-Thought Reasoning in LLMs
Abstract
Chain-of-Thought (CoT) reasoning substantially improves Large Language Models (LLMs), yet its out-of-distribution (OOD) generalization mechanism remains theoretically underexplored. We study CoT as compositional OOD generalization: the target task lacks complete reasoning trajectories or direct input-output pairs, while training provides only in-distribution (ID) atomic step data. We show that CoT generalizes by repeatedly applying a shared single-step predictor to compose reusable ID transitions. Theoretically, let denote the number of reasoning steps in the target task, the number of training samples per sub-task, and the number of output tokens per step; then the OOD task risk is controlled by the sum of the ID sub-task risks, scaled by a coefficient of order that is independent of , although the summed risk itself may still grow with . A Rademacher-complexity analysis further shows that the estimation term is of order , rather than linear in , due to predictor sharing under a uniform capacity control on the shared class. For autoregressive Next-Token Prediction, the final-task risk is bounded by the best-in-class step-level risk scaled by the same coefficient of order , plus an estimation term of order . A parity-coupled construction further shows that, for the sub-task empirical risk minimizer, the expected final-task risk is at least the best in-class risk plus when . Experiments on Atom-Task and GSM8K support the theory: CoT enables short-to-long and compositional generalization, while explicit state tracking is crucial. Our code is available at https://github.com/maxliang114514/CoT-OOD.
Create a lesson
Metadata
- Categories
- cs.LG, stat.ML
Related papers
Action-Conditioned Transition Irreversibility for Out-of-Distribution Detection in Reinforcement Learning
Shared title terminologycs.LGEmil Mittag, Richard Dazeley, Peter Vamplew
A trust layer for fast pedestal-stability surrogates: calibrated error bars, out-of-distribution alarms and few-shot recalibration
Shared title terminologycs.LGAmin Vakhshouri
Attraction-Ranking Mismatch in Out-of-Distribution Detection: Theory and Evidence from Hamiltonian Feature Dynamics
Shared title terminologycs.LGZilin Wang, Lianghai Xiao
Recursive Self-Editing: LLMs Program Their Own Weight Edits for Self-Improvement
Shared title terminologycs.LGLinghua Zhang, Yunhe Li
RumiFold: Teaching an LLM to Natively Fold Proteins and Reason About Their Function
Shared title terminologycs.LGKevin Lu, David Bau, Wengong Jin
On the Interplay between Backtracking and Latent Confidence Directions in Reasoning Models
Shared title terminologycs.LGStephen Cheng, Zahra Sodagar, Sandeep Soni et al.