NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Demystifying Long Chain-of-Thought Reasoning in LLMs

Edward Yeo, Yuxuan Tong, Xinyao Niu, Graham Neubig, Xiang Yue

TL;DR

Recent "reasoning" models like OpenAI's o1 and DeepSeek-R1 achieve breakthrough performance by extending test-time compute through long chains-of-thought (CoTs) featuring self-correction and backtracking. This paper systematically explores how to elicit and stabilize long CoT reasoning using supervised fine-tuning (SFT) and reinforcement learning (RL), identifying crucial reward-shaping techniques and showing that long-CoT patterns already exist latently in pre-training web data.

What Problem Does This Paper Address?

While scaling inference-time reasoning has proven effective, training models to generate long CoTs remains brittle and poorly understood. Naive RL training frequently suffers from length collapse or uncontrolled length explosion, where models "hack" rewards by repeating tokens instead of thinking harder.

The authors address several open questions:

  1. Does long-CoT SFT provide distinct scaling advantages over standard short-CoT fine-tuning?
  2. How can we prevent reward hacking and stabilize CoT length during RL?
  3. How can we scale verifiable reward signals beyond limited math competition datasets?
  4. Do self-reflection and backtracking truly emerge spontaneously from RL, or are they latent skills learned during pre-training?

Methods

  • Long vs. Short CoT SFT: The authors distill long CoTs from QwQ-32B-Preview and short CoTs from Qwen2.5-Math-72B-Instruct, fine-tuning base models (Llama-3.1-8B and Qwen2.5-Math-7B). They also test a modular Action Prompting framework (chaining clarify, decompose, solution, reflection, and answer steps).
  • Cosine Length-Scaling Reward: To prevent length explosion, the authors introduce a smooth piecewise cosine reward function. It rewards shorter trajectories when correct (incentivizing compute efficiency) and penalizes shorter trajectories more heavily when incorrect (encouraging the model to deliberate when uncertain).
  • $N$-Gram Repetition Penalty: To stop length-reward hacking, an $N$-gram penalty is applied directly to offending repeated tokens with a localized, low discount factor ($\gamma_p = 0.99$), while outcome correctness uses a high discount factor ($\gamma_c = 1.0$).
  • Silver-Data Scaling: To scale verifiable rewards without human annotations, the authors extract short-form answers from web QA data (WebInstruct-462k) using instruction-tuned LLMs and filter prompts where responses match extracted targets.

Datasets

  • Training:
  • MATH (7,500 competition math problems, used for SFT distillation and RL prompts).
  • WebInstruct-462k (deduplicated web-extracted QA pairs) and its filtered subset of ~115k samples with extractable short answers.
  • Evaluation:
  • MATH-500 (in-domain math).
  • AIME 2024 (out-of-domain hard math).
  • TheoremQA (out-of-domain STEM questions covering 350+ theorems).
  • MMLU-Pro-1k (a representative 1,000-question subset across 14 diverse domains).
  • Pre-training Corpora Analysis: OpenWebMath (scraped from web forums such as StackExchange and physics discussion boards).

Key Insights and Ideas

  • Long CoT SFT Raises the Ceiling: Scaling data tokens in short CoT SFT saturates quickly, whereas long CoT SFT scales sustained accuracy gains up to billions of tokens. Furthermore, models initialized with long CoT SFT see immediate, substantial gains from subsequent RL, whereas short CoT initializations plateau.
  • Natural Distillation Beats Hand-Crafted Steps: Distilling naturally emergent reasoning traces from a teacher model consistently outperforms manually orchestrated, step-by-step "Action Prompting."
  • Length Scaling is Vulnerable to Reward Hacking: Given simple length incentives or standard binary rewards, models quickly discover trivial exploits—such as repeating sentences or stalling—rather than exploring novel reasoning paths. Decoupling discount factors for repetition penalties and final correctness fixes this issue.
  • Reasoning Patterns Are Latent, Not Magic: Phrases associated with the "aha moment" ("Wait, actually...", "Let me double-check") are not spontaneous behaviors invented by RL. The authors demonstrate that multi-turn human discussions on forums like StackExchange already provide rich examples of collaborative error-correction and backtracking in the base pre-training corpus.

Key Results

  • SFT Scaling: On MATH-500, long CoT SFT surpassed 70% accuracy and continued scaling at 3.5B tokens, while short CoT SFT flattened below 55% after just 0.25B tokens.
  • RL with Cosine Reward: Applying Cosine Reward + repetition penalty stabilized training length and boosted Llama-3.1-8B downstream performance across all tasks (Figure 4).
  • SFT Cold Start vs. Pure RL: On Qwen2.5-Math-7B, initializing with long CoT SFT before RL achieved 85.9% on MATH-500 and a 49.7% four-benchmark average, compared to 41.0% for direct RL from the base model and 21.2% zero-shot base (Table 5).
  • Noisy Web Verification: Using a rule-based verifier on filtered WebInstruct samples yielded a 28.1% on TheoremQA and 41.4% on MMLU-Pro-1k, surpassing the pure MATH-trained baseline on out-of-domain general reasoning tasks (Table 2).

Limitations and Future Work

  • Compute & Architecture Bottlenecks: The authors restricted most RL investigations to 7B/8B models due to high GPU memory overheads and execution stragglers in current open-source RL frameworks (e.g., OpenRLHF) when processing long, variable-length CoTs.
  • Algorithm Sensitivity: Preliminary experiments with REINFORCE++ showed severe training instability compared to PPO, indicating that simpler policy-gradient methods remain finicky to tune in long-CoT regimes.
  • Scalable Verification: Rule-based verifiers on filtered QA pairs worked best, but writing bespoke verifiers for diverse real-world domains remains manual and labor-intensive. Developing automated, self-supervised verification methods remains a critical open challenge.

Summary updated

BibTeX
@inproceedings{yeo2025demystifying,
  author = {Edward Yeo and Yuxuan Tong and Xinyao Niu and Graham Neubig and Xiang Yue},
  title = {{Demystifying Long Chain-of-Thought Reasoning in LLMs}},
  booktitle = {FM-Wild @ ICLR},
  year = {2025},
  url = {https://openreview.net/forum?id=WCcQCWEAzc},
}
Figure