SWE-Perf: 言語モデルは実世界のリポジトリにおけるコードパフォーマンスを最適化できるか?
SWE-Perf: Can Language Models Optimize Code Performance on Real-World Repositories?
July 16, 2025
著者: Xinyi He, Qian Liu, Mingzhe Du, Lin Yan, Zhijie Fan, Yiming Huang, Zejian Yuan, Zejun Ma
cs.AI
要旨
コードパフォーマンスの最適化は、実世界のソフトウェア工学において極めて重要であり、プロダクションレベルのシステムにとって不可欠です。大規模言語モデル(LLM)は、コード生成やバグ修正において印象的な能力を発揮していますが、リポジトリレベルでのコードパフォーマンス向上における熟練度は、まだほとんど検証されていません。このギャップを埋めるため、我々はSWE-Perfを導入します。これは、本物のリポジトリコンテキスト内でコードパフォーマンス最適化タスクにおけるLLMを体系的に評価するために特別に設計された初のベンチマークです。SWE-Perfは、人気のあるGitHubリポジトリからのパフォーマンス改善プルリクエストに基づいて厳選された140のインスタンスで構成されています。各ベンチマークインスタンスには、関連するコードベース、ターゲット関数、パフォーマンス関連のテスト、専門家が作成したパッチ、および実行可能な環境が含まれています。ファイルレベルおよびリポジトリレベルのアプローチ(例:AgentlessやOpenHands)を網羅する代表的な手法の包括的な評価を通じて、既存のLLMと専門家レベルの最適化パフォーマンスの間に大きな能力ギャップがあることを明らかにし、この新興分野における重要な研究機会を強調します。
English
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.