2025-02-21 · 专家 · 自然语言处理 · 机器学习

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

S2R通过强化学习训练LLM进行自我验证和自我纠正,有效提升了LLM的推理能力。

更新于 2025-02-21。作者:Ruotian Ma、Peisong Wang、Cheng Liu、Xingyan Liu、Jiaqi Chen、Bang Zhang、Xin Zhou、Nan Du、Jia Li。

中文摘要

近期的研究证明了LLM测试时缩放的有效性。然而,现有的激励LLM深度思考能力的方法通常需要大规模数据或显著的训练努力。同时,如何提高较弱的基础模型的思考能力仍然不明确。在这项工作中,我们引入了S^2R,这是一个高效的框架,通过教授模型在推理过程中进行自我验证和自我校正,从而增强LLM的推理能力。具体来说,我们首先通过在精心挑选的数据上进行监督微调,初始化LLM以迭代地进行自我验证和自我校正行为。然后,通过结果级和过程级的强化学习进一步强化自我验证和自我校正技能,同时最小化资源需求,使模型能够在推理过程中自适应地优化其推理过程。我们的结果表明,仅使用3.1k个自我验证和自我校正行为初始化样本,Qwen2.5-math-7B的准确率从51.0%提高到了81.6%,超过了在等量的长CoT蒸馏数据上训练的模型。基于三个基础模型,在领域内和领域外基准上的大量实验和分析验证了S^2R的有效性。我们的代码和数据可在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^2R, 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^2R. Our code and data are available at https://github.com/NineAbyss/S2R.

解读

一句话总结

S2R通过强化学习训练LLM进行自我验证和自我纠正,有效提升了LLM的推理能力。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源