2025-07-17 · 专家 · 数据科学 · 机器学习

SWE-Perf: Can Language Models Optimize Code Performance on Real-World Repositories?

SWE-Perf提出了一个针对代码性能优化的基准,旨在评估大型语言模型在真实世界代码库中的性能优化能力。

更新于 2025-07-17。作者:Xinyi He、Qian Liu、Mingzhe Du、Lin Yan、Zhijie Fan、Yiming Huang、Zejian Yuan、Zejun Ma。

中文摘要

代码性能优化在现实世界的软件工程中至关重要,对于生产级系统尤为关键。虽然大型语言模型(LLMs)在代码生成和错误修复方面已展现出令人印象深刻的性能,但它们在提升代码库级别性能方面的能力仍鲜有探讨。为了填补这一空白,我们引入了SWE-Perf,这是第一个专门设计来系统评估LLMs在真实代码库环境中进行代码性能优化任务的基准。SWE-Perf包含140个精心挑选的实例,每个实例均来自来自流行的GitHub仓库的性能提升合并请求。每个基准实例包括相关的代码库、目标函数、性能相关测试、专家编写的补丁和可执行环境。通过对跨越文件级和仓库级方法(例如无代理和OpenHands)的代表性方法的全面评估,我们发现现有LLMs与专家级优化性能之间存在显著的差距,突显了这一新兴领域中的关键研究机遇。

英文摘要

Code performance optimization is paramount in real-world software engineering and critical for production-level systems. While Large Language Models (LLMs) have demonstrated impressive capabilities in code generation and bug fixing, their proficiency in enhancing code performance at the repository level remains largely unexplored. To address this gap, we introduce SWE-Perf, the first benchmark specifically designed to systematically evaluate LLMs on code performance optimization tasks within authentic repository contexts. SWE-Perf comprises 140 carefully curated instances, each derived from performance-improving pull requests from popular GitHub repositories. Each benchmark instance includes the relevant codebase, target functions, performance-related tests, expert-authored patches, and executable environments. Through a comprehensive evaluation of representative methods that span file-level and repo-level approaches (e.g., Agentless and OpenHands), we reveal a substantial capability gap between existing LLMs and expert-level optimization performance, highlighting critical research opportunities in this emerging field.

解读

一句话总结

SWE-Perf提出了一个针对代码性能优化的基准,旨在评估大型语言模型在真实世界代码库中的性能优化能力。

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

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

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

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

来源

机器可读索引:llms.txt