arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.20127cs.SEcs.AIcs.CL
收藏

SoRFT:基于子任务导向的强化微调解决代码问题

SoRFT: Issue Resolving with Subtask-oriented Reinforced Fine-Tuning

School of Computer Science, Peking University(北京大学计算机学院);ByteDance(字节跳动)

Zexiong Ma, Chao Peng, Pengfei Gao, Xiangxin Meng, Yanzhen Zou, Bing Xie

AI总结:

SoRFT通过将问题解决分解为文件、函数、行定位及代码编辑生成等子任务,结合拒绝采样监督微调与基于规则的强化学习,在SWE-Bench上达到开源模型最优性能,提供低成本替代方案。

摘要:

主流的代码问题解决框架主要依赖商业模型,导致成本高昂并引发隐私担忧。现有的问题解决训练方法在泛化能力上表现不佳,且未能充分利用开源开发资源。我们提出了子任务导向的强化微调(SoRFT),一种新颖的训练方法,旨在增强大型语言模型(LLM)的问题解决能力。我们将问题解决分解为结构化的子任务:文件定位、函数定位、行定位和代码编辑生成。SoRFT包含两个训练阶段:(1)拒绝采样监督微调,在微调LLM之前,使用真实标签过滤思维链(CoT)数据;(2)基于规则的强化学习,利用带有真实标签奖励的PPO算法。我们在SWE-Bench Verified和SWE-Bench Lite上评估了SoRFT训练的模型,在开源模型中取得了最先进的(SOTA)性能(例如,SoRFT-Qwen-7B在SWE-Bench Verified上解决了21.4%的问题)。实验结果表明,SoRFT显著提升了问题解决性能,改善了模型泛化能力,并为商业模型提供了一种成本效益高的替代方案。

英文摘要:

Mainstream issue-resolving frameworks predominantly rely on commercial models, leading to high costs and privacy concerns. Existing training approaches for issue resolving struggle with poor generalization and fail to fully leverage open-source development resources. We propose Subtask-oriented Reinforced Fine-Tuning (SoRFT), a novel training approach to enhance the issue resolving capability of LLMs. We decomposes issue resolving into structured subtasks: file localization, function localization, line localization, and code edit generation. SoRFT consists of two training stages: (1) rejection-sampled supervised fine-tuning, Chain of Thought (CoT) data is filtered using ground-truth before fine-tuning the LLM, and (2) rule-based reinforcement learning, which leverages PPO with ground-truth based rewards. We evaluate the SoRFT-trained model on SWE-Bench Verified and SWE-Bench Lite, achieving state-of-the-art (SOTA) performance among open-source models (e.g., resolve 21.4% issues on SWE-Bench Verified with SoRFT-Qwen-7B). The experimental results demonstrate that SoRFT significantly enhances issue-resolving performance, improves model generalization, and provides a cost-efficient alternative to commercial models.

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

↑