arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.12853cs.CLcs.LG
收藏

S²R:通过强化学习教 LLM 自我验证与自我纠正

S$^2$R: Teaching LLMs to Self-verify and Self-correct via Reinforcement Learning

Tencent(腾讯);Tsinghua University(清华大学);The University of Hong Kong(香港大学);Fudan University(复旦大学);The Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州))

Ruotian Ma, Peisong Wang, Cheng Liu, Xingyan Liu, Jiaqi Chen, Bang Zhang, Xin Zhou, Nan Du, Jia Li

AI总结:

提出 S²R 框架,以少量监督样本初始化自我验证与自我纠正行为,再结合结果级和过程级强化学习,显著提升基础 LLM 的推理性能。

摘要:

近期研究已经证明了 LLM 测试时扩展的有效性。然而,现有用于激发 LLM 深度思考能力的方法通常需要大规模数据或大量训练投入。同时,如何提升能力较弱的基础模型的思考能力仍不明确。在本工作中,我们提出 S²R,这是一个高效框架,通过教模型在推理期间进行自我验证和自我纠正来增强 LLM 推理能力。具体而言,我们首先利用精心筛选的数据进行监督微调,使 LLM 初始化迭代式自我验证和自我纠正行为。随后,通过结果级和过程级强化学习进一步强化自我验证与自我纠正技能,并将资源需求降至最低,使模型能够在推理期间自适应地精炼其推理过程。结果表明,仅使用 3.1k 个自我验证和自我纠正行为初始化样本,Qwen2.5-math-7B 的准确率就从 51.0% 提升至 81.6%,优于使用等量 long-CoT 蒸馏数据训练的模型。基于三个基础模型在域内和域外基准上的大量实验与分析验证了 S²R 的有效性。代码和数据可在 https://github.com/NineAbyss/S2R 获取。

英文摘要:

Recent studies have demonstrated the effectiveness of LLM test-time scaling. However, existing approaches to incentivize LLMs' deep thinking abilities generally require large-scale data or significant training efforts. Meanwhile, it remains unclear how to improve the thinking abilities of less powerful base models. In this work, we introduce S$^2$R, an efficient framework that enhances LLM reasoning by teaching models to self-verify and self-correct during inference. Specifically, we first initialize LLMs with iterative self-verification and self-correction behaviors through supervised fine-tuning on carefully curated data. The self-verification and self-correction skills are then further strengthened by both outcome-level and process-level reinforcement learning, with minimized resource requirements, enabling the model to adaptively refine its reasoning process during inference. Our results demonstrate that, with only 3.1k self-verifying and self-correcting behavior initialization samples, Qwen2.5-math-7B achieves an accuracy improvement from 51.0\% to 81.6\%, outperforming models trained on an equivalent amount of long-CoT distilled data. Extensive experiments and analysis based on three base models across both in-domain and out-of-domain benchmarks validate the effectiveness of S$^2$R. Our code and data are available at https://github.com/NineAbyss/S2R.

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

↑