arXiv:2502.12853cs.CLcs.LG2025-02ACL被引 21

让大模型推理时自我检查修正,仅用3100样本就大幅提升数学解题准确率。

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

  • 通过监督微调教会模型自验证自修正,再用强化学习优化推理过程。
  • 7B模型在数学任务上准确率从51.0%提升至81.6%,超越同等数据量的长思维链训练。
  • 方法轻量高效,适合资源有限但需提升推理能力的基座模型使用。

近期研究证实了大模型测试时扩展的有效性。然而,现有激励深度思考的方法通常需要大规模数据或大量训练成本。此外,如何提升较弱基座模型的推理能力仍不明确。本文提出S²R框架,通过强化学习教导大模型在推理过程中自我验证与自我修正。首先,利用精心构建的数据对模型进行监督微调,使其具备迭代自验证和自修正能力;随后,通过结果层面与过程层面的强化学习进一步强化该能力,且资源开销极小,支持推理阶段动态优化。实验表明,仅需3100个初始化样本,Qwen2.5-math-7B在数学任务上的准确率从51.0%提升至81.6%,优于使用等量长思维链蒸馏数据训练的模型。在三个基座模型上,涵盖领域内与跨领域基准的广泛实验验证了S²R的有效性。代码与数据已公开于https://github.com/NineAbyss/S2R。

原文摘要 · Abstract (English)

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.

大模型推理自修正强化学习

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。