2025-02-26 · 专家 · 机器学习 · 计算机视觉 · 数据科学

SWE-RL: Advancing LLM Reasoning via Reinforcement Learning on Open Software Evolution

该论文提出了一种名为SWE-RL的强化学习方法,通过在开源软件演化数据上训练,显著提升了大型语言模型在软件工程任务中的推理能力。

更新于 2025-02-26。作者:Yuxiang Wei、Olivier Duchenne、Jade Copet、Quentin Carbonneaux、Lingming Zhang、Daniel Fried、Gabriel Synnaeve、Rishabh Singh、Sida I. Wang。

中文摘要

近期DeepSeek-R1的发布展示了强化学习(RL)在提升大型语言模型(LLM)的通用推理能力方面的巨大潜力。虽然DeepSeek-R1以及其他后续工作主要专注于将RL应用于竞争性编程和数学问题,但本文介绍了SWE-RL,这是首个将基于RL的LLM推理扩展到实际软件工程的方案。利用轻量级的基于规则的奖励(例如,真实解与LLM生成的解决方案之间的相似度分数),SWE-RL能够通过学习大量开源软件演化数据——软件整个生命周期的记录,包括代码快照、代码变更以及诸如问题和拉取请求等事件——使LLM能够自主恢复开发者的推理过程和解决方案。在Llama 3之上进行训练,我们得到的推理模型Llama3-SWE-RL-70B在SWE-bench Verified上实现了41.0%的解决率——这是一个由人类验证的现实世界GitHub问题的集合。据我们所知,这是迄今为止中等规模(<100B)LLM的最佳性能报告,甚至可以与领先的专有LLM如GPT-4o相媲美。令人惊讶的是,尽管仅使用软件演化数据进行RL,Llama3-SWE-RL甚至表现出了通用的推理技能。例如,它在五个领域外的任务上显示出改进的结果,包括函数编码、库使用、代码推理、数学和一般语言理解,而监督式微调基线甚至平均导致性能下降。总的来说,SWE-RL为通过在大量软件工程数据上进行强化学习来提升LLM的推理能力开辟了新的方向。

英文摘要

The recent DeepSeek-R1 release has demonstrated the immense potential of reinforcement learning (RL) in enhancing the general reasoning capabilities of large language models (LLMs). While DeepSeek-R1 and other follow-up work primarily focus on applying RL to competitive coding and math problems, this paper introduces SWE-RL, the first approach to scale RL-based LLM reasoning for real-world software engineering. Leveraging a lightweight rule-based reward (e.g., the similarity score between ground-truth and LLM-generated solutions), SWE-RL enables LLMs to autonomously recover a developer's reasoning processes and solutions by learning from extensive open-source software evolution data -- the record of a software's entire lifecycle, including its code snapshots, code changes, and events such as issues and pull requests. Trained on top of Llama 3, our resulting reasoning model, Llama3-SWE-RL-70B, achieves a 41.0% solve rate on SWE-bench Verified -- a human-verified collection of real-world GitHub issues. To our knowledge, this is the best performance reported for medium-sized (&lt;100B) LLMs to date, even comparable to leading proprietary LLMs like GPT-4o. Surprisingly, despite performing RL solely on software evolution data, Llama3-SWE-RL has even emerged with generalized reasoning skills. For example, it shows improved results on five out-of-domain tasks, namely, function coding, library use, code reasoning, mathematics, and general language understanding, whereas a supervised-finetuning baseline even leads to performance degradation on average. Overall, SWE-RL opens up a new direction to improve the reasoning capabilities of LLMs through reinforcement learning on massive software engineering data.

解读

一句话总结

该论文提出了一种名为SWE-RL的强化学习方法,通过在开源软件演化数据上训练,显著提升了大型语言模型在软件工程任务中的推理能力。

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

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

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

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

来源