一句话:提出 ExplainBench 基准,用问答方式自动评估编码智能体所生成代码解释的可信度。
随着 LLM 智能体在软件工程中被广泛采用,其代码改动常达数十至数百行,人工审查愈发不可行,开发者转而依赖智能体给出的解释来理解变更。然而,目前缺乏评估这类解释可信度的基准。本文提出 ExplainBench,其核心直觉是:有信息量的解释应能让 LLM 正确回答关于变更的问题,从而可对智能体解释质量进行定量比较。作者据此构建问题集,评估解释是否准确描述(1)有缺陷代码的预期行为,以及(2)应用智能体补丁后的效果。实验表明,解释质量是独立于代码修复能力的评估维度:ExplainBench 对智能体的排名与广泛使用的 SWE-bench Verified 不同。细粒度分析显示解释常出现严重问题,例如在补丁实际不正确时仍宣称其正确。基于此,作者实现并评估了一个解释审计智能体,通过运行额外测试来验证与精炼解释,该智能体提升了所有被评估智能体的解释质量,说明智能体解释可被自动变得更可信。
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.