[論文レビュー] The Fact Selection Problem in LLM-Based Program Repair
この論文は、LLMベースのプログラム修復における「事実選択問題」を特定し、プロンプトに多すぎるバグ関連の事実を含めると修復効果が低下することを示している。著者らは、BugsInPyベンチマーク上で19,000件のプロンプトを用いた大規模な調査を実施し、バグ固有の事実を選択する統計的事実選択モデル「Maniple」を提案。これは汎用的事実セットを上回る性能を発揮し、157件のテストバグのうち88件を修復した(最良のベースライン比17%の向上)。
Recent research has shown that incorporating bug-related facts, such as stack traces and GitHub issues, into prompts enhances the bug-fixing capabilities of large language models (LLMs). Considering the ever-increasing context window of these models, a critical question arises: what and how many facts should be included in prompts to maximise the chance of correctly fixing bugs? To answer this question, we conducted a large-scale study, employing over 19K prompts featuring various combinations of seven diverse facts to rectify 314 bugs from open-source Python projects within the BugsInPy benchmark. Our findings revealed that each fact, ranging from simple syntactic details like code context to semantic information previously unexplored in the context of LLMs such as angelic values, is beneficial. Specifically, each fact aids in fixing some bugs that would remain unresolved or only be fixed with a low success rate without it. Importantly, we discovered that the effectiveness of program repair prompts is non-monotonic over the number of used facts; using too many facts leads to subpar outcomes. These insights led us to define the fact selection problem: determining the optimal set of facts for inclusion in a prompt to maximise LLM's performance on a given task instance. We found that there is no one-size-fits-all set of facts for bug repair. Therefore, we developed a basic statistical model, named Maniple, which selects facts specific to a given bug to include in the prompt. This model significantly surpasses the performance of the best generic fact set. To underscore the significance of the fact selection problem, we benchmarked Maniple against the state-of-the-art zero-shot, non-conversational LLM-based bug repair methods. On our testing dataset of 157 bugs, Maniple repairs 88 bugs, 17% above the best configuration.
研究の動機と目的
- 異なるバグ関連の事実がLLMベースのプログラム修復性能に与える影響を調査すること。
- プロンプト内の事実数を増やすことで修復結果が向上するか、悪化するかを特定すること。
- 事実数と修復成功率の間には非単調な関係が存在するかを同定すること。
- 汎用設定を超えてLLMベースの修復を向上させる、バグに特化した事実選択戦略を開発すること。
- 統計モデル(Maniple)が個々のバグに最適な事実を効果的に選択する有効性を評価すること。
提案手法
- BugsInPyベンチマークの314件のバグに対して、7種類の異なる事実をさまざまな組み合わせで含む19,000件のプロンプトを用いた大規模な実験的調査を実施。
- コードコンテキスト、スタックトレース、GitHubのイシューに加え、アングリカル値のような新しい意味的事実を含む多様な事実を統合。
- 個々のバグに特化した事実選択を行う統計モデル「Maniple」を提案。これは、各事実の個別な修復効果に基づいて最適な事実セットを選択する。
- 各事実-バグペアの歴史的修復成功率を用いて、Manipleをトレーニングし、最適な事実セットを予測する。
- ホールドアウトされたテストセット(157件のバグ)に対して、ゼロショットで会話を行わないLLMベースの修復手法と、Manipleを比較評価。
- 非単調なパフォーマンス曲線を用いて、各バグにおける最適な事実数を同定し、プロンプトへの過剰な事実の追加を回避。
実験結果
リサーチクエスチョン
- RQ1異なるバグ関連の事実の組み合わせが、LLMベースのプログラム修復の成功率にどのように影響するか?
- RQ2プロンプト内の事実数と修復効果の間に非単調な関係が存在するか?
- RQ3データ駆動型でバグに特化した事実選択モデルは、汎用的事実セットを上回る性能を発揮できるか?
- RQ4アングリカル値のようなこれまで未検討だった意味的事実(例:アングリカル値)を含めると、修復結果にどのような影響を与えるか?
- RQ5バグに特化した事実選択モデル(Maniple)の性能は、最先端のゼロショットLLMベースの修復手法と比べてどうか?
主な発見
- 構文的コードコンテキストから意味的アングリカル値に至るまでの7つの事実すべてが、そうでなければ修復されないバグの修復成功率を向上させる。
- プロンプトの効果は非単調である:多すぎる事実を含めると、修復パフォーマンスが著しく低下する。
- あらゆるバグで最適な修復を達成する「万能な」事実セットは存在せず、事実選択問題の存在を裏付ける。
- バグ固有の事実選択モデル「Maniple」は、テストセットの157件のバグのうち88件を修復し、最良の汎用設定を17ポイント上回った。
- アングリカル値を事実タイプとして含めることで、LLMベースの修復でこれまで未検討だった特定のバグクラスの修復結果が顕著に向上した。
- 本研究は、LLMベースのAPRにおけるプロンプト工学が、単なる加算的アプローチではなく、適応的かつ文脈に配慮したものでなければならないことを示している。
より良い研究を、今すぐ始めましょう
論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。