Understanding the Out-of-Distribution Generalization of Chain-of-Thought Reasoning in LLMs

Nuo-Jing Liang, Xiao-Tong Yuan, Pan Zhou
11/4/2026
1 citation
cs.LGstat.ML

Official code: maxliang114514/CoT-OOD (0 stars, Python, last commit 2026-08-21).

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.

Show full abstract

We show that CoT generalizes by repeatedly applying a shared single-step predictor to compose reusable ID transitions. Theoretically, let $T$ denote the number of reasoning steps in the target task, $n$ the number of training samples per sub-task, and $k$ 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 $\mathcal{O}(k)$ that is independent of $T$, although the summed risk itself may still grow with $T$. A Rademacher-complexity analysis further shows that the estimation term is of order $\mathcal{O}(\sqrt{T/n})$, rather than linear in $T$, 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 $\mathcal{O}(k)$, plus an estimation term of order $\widetilde{\mathcal{O}}\big(k\sqrt{T/n}\big)$. 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 $Ω(\sqrt{T/n})$ when $T\le n$. 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.

View on arXivView PDF

Code Implementations(1)

00Python, ShellMay 6, 20263 months ago

Similar Papers

Cite this paper

@article{liang2026understanding,
  title  = {Understanding the Out-of-Distribution Generalization of Chain-of-Thought Reasoning in LLMs},
  author = {Nuo-Jing Liang and Xiao-Tong Yuan and Pan Zhou},
  year   = {2026},
  eprint = {2611.06438},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2611.06438v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2611.06438.svg)](https://codeofpaper.com/paper/2611.06438)

Discussion