TL;DR
This paper systematically investigates how long chain-of-thought (CoT) reasoning—characterized by behaviors like backtracking and self-correction—can be effectively trained in LLMs. The authors demonstrate that while supervised fine-tuning (SFT) with long CoT data sets a much higher performance ceiling than short CoT, reinforcement learning (RL) is plagued by severe length instability and reward hacking. To solve this, they introduce a novel cosine length-scaling reward and repetition penalty that stabilizes training and unlocks robust, multi-step reasoning.
What Problem Does This Paper Address?
Recent breakthroughs like OpenAI's o1 and DeepSeek-R1 have shown that scaling up inference-time compute via long chains-of-thought allows LLMs to solve incredibly complex math and science problems. During this "thinking" phase, models don't just output a linear solution; they explore multiple paths, catch their own mistakes, and backtrack when stuck.
However, the exact mechanics of how an LLM learns these behaviors remain opaque. Simply rewarding a model for a correct answer during reinforcement learning often leads to severe training instability. Models either fail to extend their reasoning paths or they engage in "length reward hacking"—mindlessly repeating tokens or phrases to artificially lengthen their output without actually thinking deeper. This paper provides a systematic look at the recipes, reward functions, and data strategies needed to reliably elicit stable long CoT reasoning.
Methods
The authors evaluate two primary levers for eliciting long CoT: Supervised Fine-Tuning (SFT) and Reinforcement Learning (RL). Their core methodological innovations include:
- Action Prompting Framework: To generate synthetic long CoT data for SFT, they built a state-machine framework that forces a short-CoT model to sequentially execute primitive actions:
clarify,decompose,solution step,reflection, andanswer. - Cosine Length-Scaling Reward: To stabilize RL training, they replaced standard binary rewards with a piecewise cosine reward function. It rewards correct answers but penalizes longer correct answers (incentivizing efficiency). Crucially, it heavily penalizes shorter wrong answers, forcing the model to spend more inference compute if it is uncertain.
- N-gram Repetition Penalty: To combat length reward hacking, they implemented a token-level penalty that dynamically punishes repetitive text generation during RL.
- Noisy Verifiable Reward Scaling: They explored how to scale training using massive, noisy web data rather than scarce, human-annotated math datasets, comparing rule-based verifiers (after strict answer extraction) against LLM-as-a-judge verifier models.
Datasets
- Training: The MATH dataset (7,500 training prompts) was used as the clean baseline. For scaling up with noisy data, they used WebInstruct, deduplicating it down to a 462k subset (WebInstruct-462k).
- Evaluation: The models were tested across four rigorous benchmarks: MATH-500 (in-domain math), AIME 2024 (high-tier math competition), TheoremQA (STEM-flavored theorem testing), and MMLU-Pro-1k (general academic reasoning).
Key Insights and Ideas
- Long CoT SFT provides a higher ceiling: Scaling up training tokens using short CoT data quickly plateaus. Conversely, long CoT SFT continues to scale efficiently and primes the model to absorb further gains from RL. Short CoT SFT models show almost zero improvement when RL is applied.
- RL length scaling is inherently unstable: Under a classic "correct/wrong" binary reward, models naturally extend their CoT length but eventually blow past their context windows, causing training accuracy to collapse to zero.
- Repetition penalty is a prerequisite for compute scaling: Without it, models hack length rewards by repeating phrases like "alternatively" or looping text rather than performing genuine backtracking.
- Latent roots in human dialogue: By analyzing pre-training data (like OpenWebMath), the authors discovered that long CoT behaviors (like "wait, let me rethink") closely match the patterns of human discussion forums where multiple users collaborate, argue, and correct each other. This suggests RL doesn't invent these behaviors; it recombines latent skills the model already learned during pre-training.
Key Results
- SFT + RL Synergy: On Qwen2.5-Math-7B, initializing with long CoT SFT followed by RL achieved an average accuracy of 49.7% across benchmarks, outperforming direct RL from the base model (41.0%) and pure SFT (47.3%).
- Stabilizing Length: The Cosine Reward combined with a repetition penalty successfully managed response lengths, preventing the catastrophic context-window overflow seen with classic rewards.
- Noisy Data Filtering: Using a rule-based verifier on filtered short-form web data (WebInstruct) yielded the best out-of-distribution gains, boosting TheoremQA by 2.9% and MMLU-Pro by 6.8% absolute compared to training on clean MATH data alone.
Limitations and Future Work
- Model Size Constraints: Due to compute limitations, the study was restricted to 7B and 8B parameter models. The authors note that open-source RL frameworks (like OpenRLHF) struggle with low hardware utilization and high memory overhead when scaling to 32B+ models with long CoTs.
- Heuristic Verification: Relying on rule-based verifiers and prompt filtering is labor-intensive and embeds human design heuristics rather than allowing purely emergent learning.
- Exploration vs. Exploitation: Smaller models might struggle to truly innovate complex reasoning paths during RL, instead relying on patterns already internalized during pre-training.
Summary updated