ChatPaper.aiChatPaper

ExplainBench: エージェントによるコード説明の評価

ExplainBench: Evaluating Code Explanations from Agents

July 29, 2026
著者: Zhiyuan Pan, Sungmin Kang, Imam Nur Bani Yusuf, Abhik Roychoudhury
cs.AI

要旨

大規模言語モデル(LLM)エージェントは、ソフトウェア工学において急速に採用が進んでいる。エージェントが実際のコード生成においてより大きな役割を担うにつれ、その変更は数十行から数百行に及ぶ大規模なものになっている。このため、エージェントの成果物を手動でレビューすることはますます困難になり、開発者は実施された変更を理解するために説明に頼るようになっている。それにもかかわらず、エージェントが生成した説明の信頼性を評価するベンチマークは存在しない。このギャップを埋めるため、我々はコーディングエージェントからの説明を自動評価するベンチマークであるExplainBenchを提案する。ExplainBenchは、情報量の多い説明があればLLMが質問に正しく回答できるはずであり、それによりエージェント間の説明品質の定量的比較が可能になる、という直感に基づいている。この観察に基づき、我々は説明が(1)バグを含むコードの意図された動作と(2)エージェントのパッチ適用自体の効果を正確に記述しているかを評価する一連の質問群を構築する。実験によりまず、説明品質がエージェント評価の独立した軸であることが明らかになる。ExplainBenchは、広く使用されているSWE-bench Verifiedベンチマークとは異なる順位でエージェントをランク付けする。エージェントの説明品質をより詳細に分析すると、説明に頻繁に問題が見られることが分かる。例えば、説明が、正しくないパッチを正しいと主張することが多い。この知見に基づき、我々は追加テストを実行して説明を検証・改善する説明監査エージェントを実装し評価する。このエージェントは、評価したすべてのエージェントの説明を改善し、エージェントの説明を自動的により信頼性の高いものにできることを実証した。
English
Large Language Model (LLM) agents have seen rapid adoption in software engineering. As agents take a greater role in the actual generation of code, they are making larger changes, spanning tens to hundreds of lines. This makes manual review of agent results increasingly infeasible, leading developers to turn to explanations to understand enacted changes. Despite this, there are no benchmarks that evaluate the trustworthiness of agent-generated explanations. To bridge this gap, we propose ExplainBench, a benchmark to automatically evaluate explanations from coding agents. ExplainBench is based on the intuition that informative explanations should enable an LLM to correctly answer questions, allowing quantitative comparison of explanation quality between agents. With this observation, we construct a suite of questions that evaluates whether explanations accurately describe (1) the intended behavior of buggy code and (2) the effect of applying the agent patch itself. Experiments first reveal that explanation quality is a distinct axis of agent evaluation: ExplainBench ranks agents differently from the widely-used SWE-bench Verified benchmark. A deeper breakdown of explanation quality in agents shows frequent problems in explanations, such that explanations often claim that a patch is correct when it is not. Based on this insight, we implement and evaluate an explanation audit agent which runs additional tests to validate and refine explanations. This agent improved the explanations of all evaluated agents, demonstrating agent explanations can be automatically made more trustworthy.