ChatPaper.aiChatPaper

SWE-fficiency:言語モデルは実世界のリポジトリを実ワークロードで最適化できるか?

SWE-fficiency: Can Language Models Optimize Real-World Repositories on Real Workloads?

November 8, 2025
著者: Jeffrey Jian Ma, Milad Hashemi, Amir Yazdanbakhsh, Kevin Swersky, Ofir Press, Enhui Li, Vijay Janapa Reddi, Parthasarathy Ranganathan
cs.AI

要旨

大規模ソフトウェアリポジトリの性能最適化には、プログラムの正確性を維持しながら実行時間を短縮するための、コード推論とソフトウェア工学(SWE)に関する専門知識が求められる。しかし、既存のベンチマークの多くは、コードを「何を」修正すべきかに重点を置き、「どのように」修正すべきかについては軽視しがちである。本研究では、実ワークロードに対するリポジトリレベルの性能最適化を評価するベンチマーク「SWE-fficiency」を提案する。この評価スイートは、広く利用されているデータサイエンス、機械学習、HPCの9つのリポジトリ(numpy、pandas、scipyなど)から計498のタスクを収録している。各タスクでは、完全なコードベースと低速なワークロードが与えられ、エージェントはコードの意味を調査し、ボトルネックと関連するテストを特定し、単体テストを通過しつつ専門家の高速化効果に匹敵するかそれを上回るパッチを生成しなければならない。この「どのように修正するか」の評価を可能にするため、自動化パイプラインを構築した。これはGitHubのプルリクエストから性能改善編集を収集し、キーワードフィルタリング、静的解析、カバレッジツール、実行検証を組み合わせて、専門家の高速化ベースラインを確認するとともに、関連するリポジトリの単体テストを特定する。最先端のエージェントによる実証評価では、著しい性能不足が明らかになった。エージェントが達成した高速化は、専門家の効果の平均0.15倍未満であった。エージェントは、最適化の機会を特定すること、関数を跨ぐ実行について推論すること、提案された編集で正確性を維持することに苦戦している。自動性能エンジニアリングと長期的なソフトウェア推論に関する研究を促進するため、ベンチマークと付随するデータパイプラインを公開する。
English
Optimizing the performance of large-scale software repositories demands expertise in code reasoning and software engineering (SWE) to reduce runtime while preserving program correctness. However, most benchmarks emphasize what to fix rather than how to fix code. We introduce SWE-fficiency, a benchmark for evaluating repository-level performance optimization on real workloads. Our suite contains 498 tasks across nine widely used data-science, machine-learning, and HPC repositories (e.g., numpy, pandas, scipy): given a complete codebase and a slow workload, an agent must investigate code semantics, localize bottlenecks and relevant tests, and produce a patch that matches or exceeds expert speedup while passing the same unit tests. To enable this how-to-fix evaluation, our automated pipeline scrapes GitHub pull requests for performance-improving edits, combining keyword filtering, static analysis, coverage tooling, and execution validation to both confirm expert speedup baselines and identify relevant repository unit tests. Empirical evaluation of state-of-the-art agents reveals significant underperformance. On average, agents achieve less than 0.15x the expert speedup: agents struggle in localizing optimization opportunities, reasoning about execution across functions, and maintaining correctness in proposed edits. We release the benchmark and accompanying data pipeline to facilitate research on automated performance engineering and long-horizon software reasoning.
PDF42December 2, 2025