用一个例子的强化学习,让大模型数学推理能力翻倍
Reinforcement Learning for Reasoning in Large Language Models with One Training Example
- 仅用一个数学题示例,通过可验证奖励优化模型
- 数学推理准确率从36%提升至73.6%,超越格式修正效果
- 适用于多种模型与算法,适合研究高效强化学习者
我们证明,使用可验证奖励的单样本强化学习(1-shot RLVR)能有效提升大语言模型的数学推理能力。在基础模型Qwen2.5-Math-1.5B上,仅需一个示例,即可将MATH500测试集表现从36.0%提升至73.6%(超出格式修正带来的8.6%提升),六项常见数学推理基准平均分从17.6%升至35.7%(非格式修正增益7.0%)。该结果与使用1.2k DeepScaleR子集(MATH500: 73.6%,平均: 35.9%)相当。仅用两个示例时,性能进一步提升至MATH500: 74.8%,平均: 36.6%。在多个模型(Qwen2.5-Math-7B、Llama3.2-3B-Instruct、DeepSeek-R1-Distill-Qwen-1.5B)、RL算法(GRPO、PPO)及不同示例中均观察到显著提升。还发现跨类别泛化、自省频率上升及训练精度饱和后仍持续提升的现象(称作后饱和泛化)。验证其有效性主要来自策略梯度损失,而非“悟出”现象。强调探索促进(如引入合适系数的熵损失)的关键作用。同时讨论了格式修正、标签鲁棒性与提示修改的相关观察。所有资源开源于https://github.com/ypwang61/One-Shot-RLVR。
原文摘要 · Abstract (English)
We show that reinforcement learning with verifiable reward using one training example (1-shot RLVR) is effective in incentivizing the math reasoning capabilities of large language models (LLMs). Applying RLVR to the base model Qwen2.5-Math-1.5B, we identify a single example that elevates model performance on MATH500 from 36.0% to 73.6% (8.6% improvement beyond format correction), and improves the average performance across six common mathematical reasoning benchmarks from 17.6% to 35.7% (7.0% non-format gain). This result matches the performance obtained using the 1.2k DeepScaleR subset (MATH500: 73.6%, average: 35.9%), which contains the aforementioned example. Furthermore, RLVR with only two examples even slightly exceeds these results (MATH500: 74.8%, average: 36.6%). Similar substantial improvements are observed across various models (Qwen2.5-Math-7B, Llama3.2-3B-Instruct, DeepSeek-R1-Distill-Qwen-1.5B), RL algorithms (GRPO and PPO), and different math examples. In addition, we identify some interesting phenomena during 1-shot RLVR, including cross-category generalization, increased frequency of self-reflection, and sustained test performance improvement even after the training accuracy has saturated, a phenomenon we term post-saturation generalization. Moreover, we verify that the effectiveness of 1-shot RLVR primarily arises from the policy gradient loss, distinguishing it from the "grokking" phenomenon. We also show the critical role of promoting exploration (e.g., by incorporating entropy loss with an appropriate coefficient) in 1-shot RLVR training. We also further discuss related observations about format correction, label robustness and prompt modification. These findings can inspire future work on RLVR efficiency and encourage a re-examination of recent progress and the underlying mechanisms in RLVR. All resources are open source at https://github.com/ypwang61/One-Shot-RLVR.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。