arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2504.20571cs.LGcs.AIcs.CL
收藏

强化学习用于仅含一个训练示例的大语言模型推理

Reinforcement Learning for Reasoning in Large Language Models with One Training Example

University of Washington(华盛顿大学);University of Southern California(南加州大学);Microsoft(微软);University of California, Santa Cruz(加州大学圣克鲁兹分校);Georgia Institute of Technology(佐治亚理工学院)

Yiping Wang, Qing Yang, Zhiyuan Zeng, Liliang Ren, Liyuan Liu, Baolin Peng, Hao Cheng, Xuehai He, Kuan Wang, Jianfeng Gao, Weizhu Chen, Shuohang Wang, Simon Shaolei Du, Yelong Shen

AI总结:

本研究证明仅用一个训练示例的可验证奖励强化学习即可显著提升大语言模型的数学推理能力,在多个基准上接近甚至超过大规模数据训练效果,并揭示了其机制与泛化现象。

摘要:

我们证明,使用一个训练示例的可验证奖励强化学习(1-shot RLVR)能有效激励大语言模型(LLMs)的数学推理能力。将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%)。此外,仅使用两个示例的RLVR甚至略微超过这些结果(MATH500:74.8%,平均:36.6%)。类似的大幅改进在多种模型(Qwen2.5-Math-7B、Llama3.2-3B-Instruct、DeepSeek-R1-Distill-Qwen-1.5B)、RL算法(GRPO和PPO)以及不同的数学示例中均被观察到。此外,我们发现了1-shot RLVR训练中的一些有趣现象,包括跨类别泛化、自我反思频率增加,以及在训练准确率饱和后测试性能仍持续提升,我们将这一现象称为“饱和后泛化”。进一步,我们验证了1-shot RLVR的有效性主要源于策略梯度损失,这使其区别于“grokking”现象。我们还展示了促进探索(例如,通过引入适当系数的熵损失)在1-shot RLVR训练中的关键作用。我们还进一步讨论了关于格式修正、标签鲁棒性和提示修改的相关观察。这些发现可为未来RLVR效率研究提供启发,并鼓励重新审视RLVR的最新进展及其潜在机制。所有资源已在https://github.com/ypwang61/One-Shot-RLVR开源。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑