Demystifying Long Chain-of-Thought Reasoning in LLMs

AK's Picks LLM SFT RLHF Latent Reasoning CoT
扩展推理计算能力可以增强大型语言模型(LLMs)的推理能力,通过长链思考(CoTs)实现诸如回溯和错误纠正等策略。强化学习(RL)已成为发展这些能力的关键方法,但长链思考出现的条件仍不清楚,并且RL训练需要仔细的设计选择。在这项研究中,我们系统地研究了长链思考推理的机制,确定了使模型能够生成长链思考轨迹的关键因素。通过广泛的监督微调(SFT)和强化学习实验,我们提出了四个主要发现:(1)虽然SFT不是绝对必要的,但它简化了训练并提高了效率;(2)推理能力往往随着训练计算资源的增加而出现,但其发展并不保证,因此奖励塑形对于稳定链思考长度的增长至关重要;(3)可验证奖励信号的扩展对RL至关重要。我们发现,利用带有过滤机制的嘈杂、从网络提取的解决方案显示出强大的潜力,特别是在处理分布外(OOD)任务如STEM推理时;(4)像错误纠正这样的核心能力在基础模型中固有存在,但通过RL有效地激励这些技能以应对复杂任务需要大量的计算资源,并且衡量这些能力的出现需要细致的方法。这些见解为优化训练策略以增强LLMs中的长链思考推理提供了实际指导。我们的代码可在以下链接获取:https://github.com/eddycmu/demystify-long-cot。
Scaling inference compute enhances reasoning in large language models (LLMs), with long chains-of-thought (CoTs) enabling strategies like backtracking and error correction. Reinforcement learning (RL) has emerged as a crucial method for developing these capabilities, yet the conditions under which long CoTs emerge remain unclear, and RL training requires careful design choices. In this study, we systematically investigate the mechanics of long CoT reasoning, identifying the key factors that enable models to generate long CoT trajectories. Through extensive supervised fine-tuning (SFT) and RL experiments, we present four main findings: (1) While SFT is not strictly necessary, it simplifies training and improves efficiency; (2) Reasoning capabilities tend to emerge with increased training compute, but their development is not guaranteed, making reward shaping crucial for stabilizing CoT length growth; (3) Scaling verifiable reward signals is critical for RL. We find that leveraging noisy, web-extracted solutions with filtering mechanisms shows strong potential, particularly for out-of-distribution (OOD) tasks such as STEM reasoning; and (4) Core abilities like error correction are inherently present in base models, but incentivizing these skills effectively for complex tasks via RL demands significant compute, and measuring their emergence requires a nuanced approach. These insights provide practical guidance for optimizing training strategies to enhance long CoT reasoning in LLMs. Our code is available at: https://github.com/eddycmu/demystify-long-cot.