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

Afterburner: Reinforcement Learning Facilitates Self-Improving Code Efficiency Optimization

这篇论文提出了一个基于强化学习的迭代优化框架,通过实时代码性能反馈来提高LLM生成代码的效率。

更新于 2025-05-30。作者:Mingzhe Du、Luu Tuan Tuan、Yue Liu、Yuhao Qing、Dong Huang、Xinyi He、Qian Liu、Zejun Ma、See-kiong Ng。

中文摘要

大型语言模型(LLMs)能够生成功能正确的解决方案,但往往在代码效率方面不足,这是实际部署中的关键瓶颈。在本文中,我们介绍了一种新颖的测试时迭代优化框架来解决这一问题,该框架采用闭环系统,其中LLMs根据执行沙箱提供的经验性能反馈迭代优化代码。我们探讨了三种训练策略:监督微调(SFT)、直接偏好优化(DPO)和组相对策略优化(GRPO)。在Venus数据集和APPS基准测试上的实验表明,SFT和DPO在效率提升方面迅速达到饱和。相比之下,GRPO利用强化学习(RL)和执行反馈,持续优化代码性能,显著提升了pass@1(从47%提升至62%)以及超越人类提交的效率可能性(从31%提升至45%)。我们的工作展示了有效的测试时代码效率提升,并关键性地揭示了RL在教会LLMs真正自我提升代码效率方面的力量。

英文摘要

Large Language Models (LLMs) generate functionally correct solutions but often fall short in code efficiency, a critical bottleneck for real-world deployment. In this paper, we introduce a novel test-time iterative optimization framework to address this, employing a closed-loop system where LLMs iteratively refine code based on empirical performance feedback from an execution sandbox. We explore three training strategies: Supervised Fine-Tuning (SFT), Direct Preference Optimization (DPO), and Group Relative Policy Optimization~(GRPO). Experiments on our Venus dataset and the APPS benchmark show that SFT and DPO rapidly saturate in efficiency gains. In contrast, GRPO, using reinforcement learning (RL) with execution feedback, continuously optimizes code performance, significantly boosting both pass@1 (from 47% to 62%) and the likelihood of outperforming human submissions in efficiency (from 31% to 45%). Our work demonstrates effective test-time code efficiency improvement and critically reveals the power of RL in teaching LLMs to truly self-improve code efficiency.

解读

一句话总结

这篇论文提出了一个基于强化学习的迭代优化框架,通过实时代码性能反馈来提高LLM生成代码的效率。

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

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

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

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

来源

机器可读索引:llms.txt