Daily Tech Briefing
AI 科技速览

每天 5 分钟内学习 AI。获取最新的人工智能新闻,理解其重要性,并学习如何将其应用于您的工作。

AI 快讯
arXiv Machine Learning · 2026/7/31 04:00:00

RLPF: Reinforcement Learning from Performance Feedback for Code Generation

AI 中文解读
RLPF这项新研究让AI写代码从“能跑就行”升级到“跑得快才行”。过去训练AI写程序只看结果对不对,两个程序都能通过测试,但运行速度可能天差地别。这次科学家设计了一套分阶段的奖励机制:程序没跑通时,按运行进度给分;跑通后,再对比基准版本和专家代码,鼓励AI优化效率。用这方法训练的模型,正确且可运行的代码从11.1%飙升到54.6%,效率也从8.1%提到38.6%。通俗地说,就像以前AI交作业只求答案正确,现在会主动检查自己的解法是不是最优、执行起来省不省时间。这对普通人意味着未来AI生成的软件、小程序会更快更流畅,手机App不卡顿,网页加载更迅速。而且这项技术还能迁移到其他任务上,意味着AI不仅能“帮你写代码”,还能“帮你把代码写漂亮”。虽然目前主要面向专业开发场景,但长远看,普通用户用的各类智能工具都会因此变得更好用。
arXiv:2607.27271v1 Announce Type: new Abstract: Code models are increasingly trained with execution feedback, but most training signals still stop at correctness. This leaves an important gap for systems code: two programs can pass the same tests while differing greatly in runtime. We study how to train code agents to prefer faster correct implementations, rather than treating efficiency only as an evaluation metric. The key difficulty is that runtime is a fragile reward. It is meaningful only after a program is correct, varies across tasks, and gives little guidance when most sampled programs fail to compile or run. We propose \textbf{RLPF}, reinforcement learning from performance feedback, which turns execution outcomes into a staged reward. Failed programs are ordered by execution progress, while correct programs are ranked by their relative improvement from the baseline toward the expert reference. This gives useful feedback before correctness and performance-sensitive feedback after correctness. Fine-tuning Qwen3-32B with RLPF on PerfCodeBench raises correct-and-runnable solutions from $11.1\%$ to $54.6\%$ and improves relative efficiency from $8.1\%$ to $38.6\%$. The trained model becomes competitive with stronger open-weight systems, and its optimization behavior transfers modestly to EffiBench-X. Additional studies show that model-generated references provide useful but weaker supervision, and that the full composite reward is more reliable than correctness-only or runtime-only baselines. These results suggest that code agents can be trained not only to pass tests, but also to optimize the programs they write.
分享
阅读原文