用批判性强化学习提升代码模型的推理与纠错能力
Critique-Coder: Enhancing Coder Models by Critique Reinforcement Learning
- 让模型生成对代码解法的批判性意见,以判断是否正确来获得奖励
- 在LiveCodeBench上达到60%以上准确率,优于同类模型
- 适合需要高质量代码生成与逻辑推理的任务场景
强化学习(RL)在训练推理模型中广泛应用,但主要关注生成响应,缺乏显式培养批判或反思能力的机制。近期研究如批判性微调(CFT)和批判引导蒸馏(CGD)表明,教会大模型如何批判具有显著优势。受此启发,本文提出批判性强化学习(CRL),要求模型针对给定的(问题,解法)对生成批判意见,奖励仅基于生成批判的最终判断标签 $c$ 是否与真实标签 $c^*$ 一致。在此基础上,我们构建了混合训练的Critique-Coder,将20%的标准RL数据替换为CRL数据。通过在多个模型上微调并评估,结果表明Critique-Coder在所有评测基准上均优于纯RL模型。特别地,Critique-Coder-8B在LiveCodeBench(v5)上超过60%,优于DeepCoder-14B和GPT-o1。此外,该模型在BBEH数据集的逻辑推理任务中也表现更优,表明在代码数据上应用CRL可提升通用推理与批判能力,并具备跨任务迁移潜力。因此,我们认为CRL是标准强化学习在大语言模型推理中的有力补充。
原文摘要 · Abstract (English)
Reinforcement Learning (RL) has emerged as a popular training paradigm, particularly when paired with reasoning models. While effective, it primarily focuses on generating responses and lacks mechanisms to explicitly foster critique or reflection. Several recent studies, like Critique-Fine-Tuning (CFT) and Critique-Guided-Distillation (CGD) have shown the benefits of explicitly teaching LLMs how to critique. Motivated by them, we propose Critique Reinforcement Learning (CRL), where the model is tasked with generating a critique for a given (question, solution) pair. The reward is determined solely by whether the final judgment label $c \in \{\texttt{True}, \texttt{False}\}$ of the generated critique aligns with the ground-truth judgment $c^*$. Building on this point, we introduce Critique-Coder, which is trained on a hybrid of RL and CRL by substituting 20% of the standard RL data with CRL data. We fine-tune multiple models (Critique-Coder) and evaluate them on different benchmarks to show their advantages over RL-only models. We show that Critique-Coder consistently outperforms RL-only baselines on all the evaluated benchmarks. Notably, our Critique-Coder-8B can reach over 60% on LiveCodeBench (v5), outperforming other reasoning models like DeepCoder-14B and GPT-o1. Beyond code generation, Critique-Coder also demonstrates enhanced general reasoning abilities, as evidenced by its better performance on logic reasoning tasks from the BBEH dataset. This indicates that the application of CRL on coding datasets enhances general reasoning and critique abilities, which are transferable across a broad range of tasks. Hence, we believe that CRL works as a great complement to standard RL for LLM reasoning.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。