論文解説
SWE-bench: Can Language Models Resolve Real-World GitHub Issues?
SWE-bench:言語モデルは実際のGitHubイシューを解決できるか?
- 課題 言語モデルが実際のGitHubリポジトリのイシューをパッチで解決できるかを評価するため、SWE-benchを提案します。
- 手法 マージされたプルリクエストと実際のイシューからタスクを作り、生成されたパッチをリポジトリのテストで実行して解決の可否を判定します。
- 結果 BM25検索の設定で最も良かったClaude 2の解決率は1.96%で、現在のモデルは実際のイシューの大半を解決できないことが分かります。
既存のコードベンチマークの限界と実際のソフトウェア工学タスク
既存のコードベンチマークは、多くの場合、数行で解ける自己完結型の問題を扱います。実際のリポジトリでバグを修正するには、大規模なリポジトリを探索し、複数ファイルにまたがる関数同士の相互作用を理解し、複雑なコードの中から小さなエラーを見つける必要があります。SWE-benchは、このギャップを埋めるために、実際のGitHubイシューとそれに対応するマージ済みプルリクエストをもとに、言語モデルがリポジトリレベルのパッチを生成してイシューを解決できるかを問います。評価に使われるタスクインスタンスは2,294個で、12個の人気Pythonリポジトリから取得しています。

Figure 1 : SWE-bench sources task instances from real-world Python repositories by connecting GitHub issues to merged pull request solutions that resolve related tests. Provided with the issue text and a codebase snapshot, models generate a patch that is evaluated against real tests.
出典 · CC BY 4.0 · Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik Narasimhan · SWE-bench: Can Language Models Resolve Real-World GitHub Issues? · 論文の図を引用 · 元のPDFの1ページ目から図の部分を抽出しています。タスクインスタンスの収集と実行ベースの検証
タスクインスタンスは、マージ済みプルリクエストのうち、イシューを解決し、リポジトリのテストファイルを変更し、インストールと実行に成功するものから作られます。候補は属性ベースのフィルタリングと実行ベースのフィルタリングを経ます。実行ベースのフィルタリングでは、適用の前後でテスト結果が失敗から成功に変わるFAIL_TO_PASSテストが、少なくとも1つ必要です。モデルが生成したパッチはベースコミットに適用され、関連する単体テストとシステムテストを実行します。パッチが適用され、すべてのテストが通ったとき、そのタスクは解決されたとみなされます。評価指標は、解決されたタスクインスタンスの割合です。

Figure 2 : SWE-bench task instances are created from merged pull requests that resolve an issue, contributes tests, and install successfully.
出典 · CC BY 4.0 · Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik Narasimhan · SWE-bench: Can Language Models Resolve Real-World GitHub Issues? · 論文の図を引用 · 元のPDFの2ページ目から図の部分を抽出しています。
Figure 7 : SWE-bench task instance example. Problem statement P is an aggregation of the issues related to the pull request. Codebase C corresponds to a repository and base commit. The tests T and solutionD are derived from the original PR’s associated code changes. Stylized for readability.
出典 · CC BY 4.0 · Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik Narasimhan · SWE-bench: Can Language Models Resolve Real-World GitHub Issues? · 論文の図を引用 · 元のPDFの17ページ目から図の部分を抽出しています。
Table 10 : Statistics for how many candidate task instances were kept after the completion of a stage across the construction and validation procedures.
出典 · CC BY 4.0 · Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik Narasimhan · SWE-bench: Can Language Models Resolve Real-World GitHub Issues? · 論文の図を引用 · 元のPDFの20ページ目から図の部分を抽出しています。
Figure 8 : Visualization of the evaluation pipeline at an individual task instance level. During evalua- tion, the Patch is model generated. A prediction .patch must be applied successfully and produce the same results as the corresponding task instance’sD for task completion.
出典 · CC BY 4.0 · Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik Narasimhan · SWE-bench: Can Language Models Resolve Real-World GitHub Issues? · 論文の図を引用 · 元のPDFの20ページ目から図の部分を抽出しています。SWE-Llamaの学習データとファインチューニング
著者らは、SWE-benchの収集手順を37個の別の人気Pythonリポジトリに適用し、SWE-bench-trainを構成しています。このデータには、テストの変更を必要としなかった19,000組のイシュー・プルリクエストのペアが含まれます。学習データのリポジトリは、評価ベンチマークのリポジトリと重ならないように分けられました。SWE-Llamaは、CodeLlama-Python 7Bと13BをLoRAでファインチューニングしたモデルで、イシューのテキストと関連するコードファイルを入力として受け取り、参照パッチを生成するように学習されます。長いコンテキストのため、30,000トークンを超える学習シーケンスは除外され、有効な学習規模は10,000個のインスタンスに減ります。
BM25検索とoracle検索の設定
コードベース全体は、多くの言語モデルのコンテキストウィンドウに収まらないため、実験ではコンテキストの選び方を2つに分けています。疎な検索では、BM25でイシューの説明に関連するファイルを選び、コンテキストの上限内で与えます。oracle検索は、参照パッチが編集したファイルを与える分析用の設定です。実際のエンジニアがどのファイルを修正するかを事前に知るのは難しいため、oracle設定は現実性が下がりますが、コンテキストの選択が結果に与える影響を切り離して見ることができます。

Table 2 : Model resolve rates with BM25 re- trieval, with different maximum context lengths.
出典 · CC BY 4.0 · Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik Narasimhan · SWE-bench: Can Language Models Resolve Real-World GitHub Issues? · 論文の図を引用 · 元のPDFの5ページ目から図の部分を抽出しています。
Table 3 : BM25 recall with respect to oracle files for different maximum context lengths.
出典 · CC BY 4.0 · Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik Narasimhan · SWE-bench: Can Language Models Resolve Real-World GitHub Issues? · 論文の図を引用 · 元のPDFの5ページ目から図の部分を抽出しています。
Table 4 : We compare the different context lengths and proportion of the “oracle” retrieval setting covered. Models with shorter context lengths are thus inherently disadvantaged. Note that descrip- tions of token-lengths is a relative non-standard measure (e.g. Llama-tokenized sequences are 42% longer on average than the equivalent sequence tokenized for GPT-4).
出典 · CC BY 4.0 · Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik Narasimhan · SWE-bench: Can Language Models Resolve Real-World GitHub Issues? · 論文の図を引用 · 元のPDFの5ページ目から図の部分を抽出しています。BM25設定での主な解決率
BM25検索を用いた設定では、Claude 2が全イシューの1.96%を解決し、最も高い性能でした。著者らは、この低い数値をタスクの難しさを示す結果と解釈しています。この結果は、BM25で与えたコンテキストと評価設定のもとで得られたものであり、別の検索手法やコンテキストの上限で同じ値になるとは保証されません。

Table 5 : We compare models against each other using the BM25 retriever as described in Section 4.
出典 · CC BY 4.0 · Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik Narasimhan · SWE-bench: Can Language Models Resolve Real-World GitHub Issues? · 論文の図を引用 · 元のPDFの6ページ目から図の部分を抽出しています。実行テストの限界
著者らは、実行ベースのテストだけでは、モデルが生成したコードが包括的で、効率的で、読みやすいかを保証しにくいと説明しています。テストを通過したパッチでも、人が書いた解法より包括性や効率が低い可能性があるというのが著者らの観察です。

Table 8 : Average edits of model generated patches in the “oracle” retrieval setting across success- fully applied patches. For the task instances specific to each model, we calculate the same statistics across the gold patches. Avg Gold shows statistics macro-averaged over each models’ respective gold patches. All Gold shows statistics for all gold patches unconditioned on model performance.
出典 · CC BY 4.0 · Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik Narasimhan · SWE-bench: Can Language Models Resolve Real-World GitHub Issues? · 論文の図を引用 · 元のPDFの8ページ目から図の部分を抽出しています。
Table 23 : Categorization of model generations that applied successfully by the cases defined in Table 22. As mentioned, GPT-4 was evaluated on a25% subset (574 instances) of SWE-bench.
出典 · CC BY 4.0 · Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik Narasimhan · SWE-bench: Can Language Models Resolve Real-World GitHub Issues? · 論文の図を引用 · 元のPDFの29ページ目から図の部分を抽出しています。
Table 25 : In this example, Claude 2 correctly addresses an issue from scikit-learn/scikit-learn. How- ever, as demonstrated in the discussion, while the solution is correct, it demonstrates models’ ten- dency to write primitive Python and not employ existing methods within the codebase.
出典 · CC BY 4.0 · Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik Narasimhan · SWE-bench: Can Language Models Resolve Real-World GitHub Issues? · 論文の図を引用 · 元のPDFの33ページ目から図の部分を抽出しています。論文情報
- 著者
- Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik Narasimhan
- 学会・ジャーナル
- arXiv · プレプリント
- 公開日
- 2023年10月10日
- 登録日
- 2026年10月20日
- 更新日
- 2024年11月11日
- バージョン
- v3
- arXiv
- 2310.06770
- カテゴリ
- cs.CL · cs.AI · cs.SE
- ライセンス
- CC BY 4.0
- 掲載内容
- 論文情報・解説・論文の図
この解説は、Refivuの韓国語解説をAIで翻訳したものです。不正確な翻訳や誤りが含まれる可能性があります。論文と図の利用条件は各出典に従います。
アブストラクト
Language models have outpaced our ability to evaluate them effectively, but for their future development it is essential to study the frontier of their capabilities. We find real-world software engineering to be a rich, sustainable, and challenging testbed for evaluating the next generation of language models. To this end, we introduce SWE-bench, an evaluation framework consisting of $2,294$ software engineering problems drawn from real GitHub issues and corresponding pull requests across $12$ popular Python repositories. Given a codebase along with a description of an issue to be resolved, a language model is tasked with editing the codebase to address the issue. Resolving issues in SWE-bench frequently requires understanding and coordinating changes across multiple functions, classes, and even files simultaneously, calling for models to interact with execution environments, process extremely long contexts and perform complex reasoning that goes far beyond traditional code generation tasks. Our evaluations show that both state-of-the-art proprietary models and our fine-tuned model SWE-Llama can resolve only the simplest issues. The best-performing model, Claude 2, is able to solve a mere $1.96$% of the issues. Advances on SWE-bench represent steps towards LMs that are more practical, intelligent, and autonomous.
この論文を引用
Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik Narasimhan (2023). SWE-bench: Can Language Models Resolve Real-World GitHub Issues?. arXiv:2310.06770v3. https://arxiv.org/abs/2310.06770v3
BibTeX
@misc{jimenez2023bench,
title = {{SWE-bench: Can Language Models Resolve Real-World GitHub Issues?}},
author = {Carlos E. Jimenez and John Yang and Alexander Wettig and Shunyu Yao and Kexin Pei and Ofir Press and Karthik Narasimhan},
year = {2023},
eprint = {2310.06770},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2310.06770v3}
}