[論文レビュー] EvoCodeBench: An Evolving Code Generation Benchmark Aligned with Real-World Code Repositories
EvoCodeBench はリアルリポジトリ対応のコード生成ベンチマークで、包括的な注釈と進化するパイプラインを備え、リポジトリレベルのコード生成について10のLLMを評価。
How to evaluate Large Language Models (LLMs) in code generation is an open question. Existing benchmarks demonstrate poor alignment with real-world code repositories and are insufficient to evaluate the coding abilities of LLMs. This paper proposes a new benchmark - EvoCodeBench to address the preceding problems, which has three primary advances. (1) EvoCodeBench aligns with real-world repositories in multiple dimensions, e.g., code distributions and dependency distributions. (2) EvoCodeBench offers comprehensive annotations (e.g., requirements, reference code, and reference dependencies), and robust evaluation metrics (e.g., Pass@k and Recall@k). (3) EvoCodeBench is an evolving benchmark to avoid data leakage. We build an automatic pipeline to update EvoCodeBench from the latest repositories. We release the first version - EvoCodeBench-2403, containing 275 samples from 25 real-world repositories. Based on EvoCodeBench, we propose repository-level code generation and evaluate 10 popular LLMs (e.g., gpt-4, gpt-3.5, DeepSeek Coder, StarCoder 2, CodeLLaMa, Gemma, and Qwen 1.5). Our experiments reveal the coding abilities of these LLMs in real-world repositories. For example, the highest Pass@1 of gpt-4 only is 20.73% in our experiments. We also analyze failed cases and summarize the shortcomings of existing LLMs in EvoCodeBench. We release EvoCodeBench, all prompts, and LLMs' completions for further community analysis.
研究の動機と目的
- 既存のベンチマークが実世界のコードリポジトリと乖離していることを主張する。
- 実世界の分布、包括的な注釈、堅牢な指標を備えた EvoCodeBench を提案する。
- データリークを緩和し、ベンチマークを最新の状態に保つ進化するベンチマークパイプラインを導入する。
- リポジトリレベルのコード生成を現実的な評価シナリオとして定義する。
- 実際のリポジトリにおける強みと限界を明らかにするため、人気のある LLM を評価する。
提案手法
- コード分布と依存関係分布の整合性を持つ実世界の Python リポジトリから EvoCodeBench を構築する。
- 要件、参照コード、参照依存関係、テストケースを含むサンプルに注釈を付ける。
- Pass@k を機能的正確性指標として、Recall@k を依存関係リコール評価として用いる。
- 半自動的な要件生成と定期的な更新を伴う進化するベンチマークパイプラインを運用する。
- 複数のコンテキスト設定の下で、10 個の LLM(例: GPT-4、GPT-3.5、StarCoder 2、CodeLLaMa、Gemma、Qwen 1.5、DeepSeek Coder など)を評価する。
- 要件とコンテキストが与えられたときにリポジトリ内でコードを書くことをシミュレートするリポジトリレベルのコード生成タスクを定義する。
実験結果
リサーチクエスチョン
- RQ1EvoCodeBench は実世界のリポジトリに見られる分布(コードと依存関係)とどのように整合するか?
- RQ2リポジトリレベルのコード生成は、単独の関数ベンチマークよりも開発者のコーディングプロセスをよりよく反映できるか?
- RQ3現在の LLM のリポジトリレベルのコード生成における性能と故障モードは何か?
- RQ4リポジトリのコンテキスト(ローカルファイル、ファイル間依存関係)はリポジトリレベルのタスクにおける LLM の性能を向上させるか?
- RQ5Pass@k や Recall@k のような評価指標は、実世界のリポジトリにおける LLM の能力と限界をどのように反映するか?
主な発見
| LLMs | Size | Pass@1 | Pass@3 | Pass@5 | Pass@10 | Recall@1 | Recall@3 | Recall@5 | Recall@10 |
|---|---|---|---|---|---|---|---|---|---|
| gpt-4 | N/A | 20.73 | 23.03 | 24.11 | 25.34 | 68.24 | 70.63 | 72.05 | 73.52 |
| gpt-3.5 | N/A | 17.82 | 21.78 | 23.06 | 24.46 | 61.94 | 68.13 | 69.69 | 70.85 |
| DeepSeek Coder | 33B | 19.64 | 22.78 | 24.29 | 26.01 | 71.46 | 79.93 | 82.11 | 86.25 |
| DeepSeek Coder | 6.7B | 17.82 | 21.02 | 22.40 | 23.97 | 69.58 | 74.04 | 78.00 | 83.22 |
| StarCoder 2 | 15B | 14.91 | 17.54 | 18.63 | 19.86 | 50.90 | 53.29 | 55.89 | 61.76 |
| StarCoder 2 | 7B | 15.27 | 17.29 | 18.63 | 20.09 | 56.35 | 60.59 | 63.74 | 74.20 |
- EvoCodeBench-2403 は 25 個の実世界リポジトリから 275 サンプルを含み、500 の実世界リポジトリで観察された分布と整合している。
- このベンチマークは、要件、参照コード、参照依存関係、依存パスを含むリポジトリコンテキストなど、包括的な注釈を提供する。
- 10 個の人気 LLM は、伝統的なベンチマークより EvoCodeBench-2403 での Pass@k スコアがはるかに低い(例: GPT-4 の Pass@1 が HumanEval で最大 88.4 から EvoCodeBench-2403 で 7.27 へ低下)。
- ローカルファイルからの文脈情報は性能を大幅に向上させる;GPT-4 では特定の設定で Pass@1 が最大約 152% 増加。
- Recall@k は依存関係リコールの課題を浮き彫りにし、ファイル間依存関係はローカル文脈の恩恵を受けるが、依然として不一致や欠落が生じやすい。
- Retrieval-Augmented Generation は同様の関数を用いることで Pass@1 と Recall@1 を改善し、リポジトリレベルの文脈を活用する価値を示す。
より良い研究を、今すぐ始めましょう
論文設計から論文執筆まで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。