Evaluating LLMs on Real-World Software Performance Optimization
作者: Ezgi Sarıkayak, Wenchao Gu, Hesham Ghonim, Chunyang Chen
分类: cs.SE, cs.AI, cs.CL
发布日期: 2026-06-24
💡 一句话要点
提出SWE-Pro基准以解决软件性能优化评估问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 软件性能优化 大型语言模型 基准评估 参数化测试 性能指标
📋 核心要点
- 现有的性能优化方法往往过于简化,无法真实反映复杂的实际代码库中的优化过程。
- 本文提出SWE-Pro基准,通过结合参数化测试,全面评估软件性能优化的多维度指标。
- 实验结果显示,当前LLMs在性能优化方面的表现远不及专家实现,存在显著差距。
📝 摘要(中文)
软件性能优化是一项复杂且手动的任务。尽管大型语言模型(LLMs)在代码优化中越来越多地被使用,但我们仍缺乏能够真实反映优化过程的基准。现有框架往往过于简化,忽视了执行时间与内存占用之间的关键权衡,以及测量环境的噪声和不同输入数据及执行条件带来的变异。为此,本文提出了SWE-Pro,一个基于102个专家编写的开源项目优化的仓库级基准。SWE-Pro为每个任务配备参数化测试,以在噪声感知测量条件下评估运行时、峰值内存和时间加权内存使用(TWMU)。我们的评估显示,当前的LLMs在性能优化上表现不佳:运行时提升微乎其微,内存优化几乎不存在,而专家实现则在基准任务上实现了15.5倍的速度提升和171.3倍的峰值内存减少。
🔬 方法详解
问题定义:本文旨在解决现有基准无法真实反映软件性能优化过程的问题。现有方法往往只关注孤立的函数或单一性能指标,忽视了执行时间与内存占用之间的权衡,以及测量环境的噪声和输入数据的变异性。
核心思路:论文提出SWE-Pro基准,通过结合参数化测试,评估运行时、峰值内存和时间加权内存使用(TWMU),以更全面地反映优化效果。这样的设计旨在捕捉真实环境中的复杂性和多样性。
技术框架:SWE-Pro的整体架构包括任务定义、参数化测试设计和性能评估三个主要模块。每个任务都与多个输入数据和执行条件相结合,以便在噪声感知的环境下进行评估。
关键创新:SWE-Pro的最大创新在于其综合考虑了多种性能指标和环境因素,克服了现有基准的局限性,提供了更真实的性能评估。
关键设计:在参数设置上,SWE-Pro采用了多种输入数据和执行条件,确保评估的全面性。同时,设计了噪声感知的测量条件,以提高评估结果的可靠性。实验中使用的性能指标包括运行时、峰值内存和TWMU,确保了对优化效果的全面评估。
📊 实验亮点
实验结果表明,当前的LLMs在性能优化方面的表现显著低于专家实现,运行时提升微乎其微,内存优化几乎不存在。相比之下,专家实现的基准任务平均实现了15.5倍的速度提升和171.3倍的峰值内存减少,显示出显著的优化效果。
🎯 应用场景
该研究的潜在应用领域包括软件开发、性能调优和机器学习模型优化等。通过提供一个真实的评估基准,开发者可以更有效地利用LLMs进行代码优化,从而提升软件性能,降低资源消耗。未来,该基准有望推动LLMs在软件工程领域的进一步应用与发展。
📄 摘要(原文)
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-Pro, a repository-level benchmark derived from 102 expert-written optimizations from open-source projects. Unlike previous benchmarks, SWE-Pro 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 negligible, and memory optimizations are nearly non-existent. 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 91.2% of tasks for runtime and 65.7% for peak memory. Our findings expose a substantial gap between current LLM capabilities and the demands of expert-level engineering.