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

评估大语言模型在真实软件性能优化中的表现

SWE-Opt: A Benchmark for Evaluating LLMs on Performance-Oriented Repository-Level Optimization

Siemens AG(西门子公司);Technical University of Munich(慕尼黑技术大学);Heilbronn, Germany(德国海德堡);Munich, Germany(德国慕尼黑)

Ezgi Sarıkayak, Wenchao Gu, Hesham Ghonim, Chunyang Chen

AI总结:

针对现有基准过度简化性能优化的问题,提出基于102个专家优化的仓库级基准SWE-Pro,评估LLM在运行时、峰值内存和时间加权内存使用上的表现,发现LLM优化效果显著弱于专家。

摘要:

软件性能优化是一项众所周知的复杂且需要人工完成的任务。尽管大语言模型(LLMs)在代码优化中的应用日益增多,但我们仍然缺乏能够捕捉真实代码库中优化过程的基准。现有框架通常通过关注孤立函数或单一性能指标来过度简化问题,忽略了执行时间与内存占用之间的关键权衡、测量环境的固有噪声以及不同输入数据和执行条件带来的变异性。为了解决这一问题,我们引入了SWE-Pro,这是一个从开源项目中102个专家编写的优化中推导出的仓库级基准。与之前的基准不同,SWE-Pro为每个任务配对了参数化测试,以在考虑噪声的测量条件下,评估不同输入数据和执行环境下的运行时、峰值内存以及时间加权内存使用(TWMU)。我们的评估表明,当前的LLMs表现显著不足:运行时提升微乎其微,内存优化几乎不存在。这与专家实现形成鲜明对比,专家在基准任务上实现了15.5倍的总体加速和171.3倍的峰值内存减少。在91.2%的任务中观察到专家编写的运行时改进,在65.7%的任务中观察到峰值内存改进。我们的发现揭示了当前LLM能力与专家级工程需求之间的巨大差距。

英文摘要:

Software performance optimization is a notoriously complex and manual task. Despite the growing use of Large Language Models (LLMs) for code refinement, we still lack benchmarks that capture how optimization actually happens in real-world codebases. Existing frameworks often oversimplify the problem by focusing on isolated functions or a single performance metric, missing the critical trade-offs between execution time and memory footprint, the inherent noise of the measurement environment, and the variability introduced by different input data and execution conditions. We address this by introducing SWE-Opt, a repository-level benchmark derived from 102 expert-written optimizations from open-source projects. Unlike previous benchmarks, SWE-Opt pairs each task with parameterized tests to evaluate runtime, peak memory, and Time-Weighted Memory Usage (TWMU) across varying input data and execution conditions under noise-aware measurement conditions. Our evaluation shows that current LLMs struggle significantly: runtime gains are sparse and inconsistent, and memory optimizations are nearly non-existent. An agentic setting with iterative repository exploration improves patch correctness substantially but does not translate into performance gains. This stands in sharp contrast to expert implementations, which achieve an aggregate speedup of 15.5x and peak memory reduction of 171.3x over benchmark tasks. Expert-written improvements are observed in 93.1% of tasks for runtime and 70.6% for peak memory. Our findings expose a substantial gap between current LLM capabilities and the demands of expert-level engineering.

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

↑