arXiv:2509.15690cs.AI2025-09

用强化学习提升C++编译错误修复质量,效果媲美大模型。

CCrepairBench: A High-Fidelity Benchmark and Reinforcement Learning Framework for C++ Compilation Repair

  • 构建大规模高保真数据集CCrepair,支持真实场景训练。
  • 设计混合奖励机制,使修复结果既通过编译又保持语义正确。
  • 采用大模型判官评估,适合研究自动化编程助手的团队使用。

自动化修复C++编译错误对提升开发效率至关重要,但受限于高质量数据稀缺和传统监督方法难以生成语义正确的补丁。本文提出三项核心贡献:首先,构建基于生成-验证流水线的大型C++编译错误数据集CCrepair;其次,设计一种由混合奖励信号引导的强化学习范式,从仅保证可编译转向追求修复的语义质量;最后,建立两阶段评估系统,以经人类专家验证的大模型作为评判标准。实验表明,经该框架训练的Qwen2.5-1.5B-Instruct模型性能接近未微调的Qwen2.5-14B-Instruct模型,验证了训练范式的高效性。本工作为研究社区提供了新数据集与更有效的训练评估范式,推动更实用可靠的自动编程助手发展。

原文摘要 · Abstract (English)

The automated repair of C++ compilation errors presents a significant challenge, the resolution of which is critical for developer productivity. Progress in this domain is constrained by two primary factors: the scarcity of large-scale, high-fidelity datasets and the limitations of conventional supervised methods, which often fail to generate semantically correct patches.This paper addresses these gaps by introducing a comprehensive framework with three core contributions. First, we present CCrepair, a novel, large-scale C++ compilation error dataset constructed through a sophisticated generate-and-verify pipeline. Second, we propose a Reinforcement Learning (RL) paradigm guided by a hybrid reward signal, shifting the focus from mere compilability to the semantic quality of the fix. Finally, we establish the robust, two-stage evaluation system providing this signal, centered on an LLM-as-a-Judge whose reliability has been rigorously validated against the collective judgments of a panel of human experts. This integrated approach aligns the training objective with generating high-quality, non-trivial patches that are both syntactically and semantically correct. The effectiveness of our approach was demonstrated experimentally. Our RL-trained Qwen2.5-1.5B-Instruct model achieved performance comparable to a Qwen2.5-14B-Instruct model, validating the efficiency of our training paradigm. Our work provides the research community with a valuable new dataset and a more effective paradigm for training and evaluating robust compilation repair models, paving the way for more practical and reliable automated programming assistants.

编译修复强化学习代码生成

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