paperbot · PL 论文追踪

全部论文 待读 收藏

ExplainBench: Evaluating Code Explanations from Agents

ExplainBench:评估智能体生成的代码解释
ASE Proceedings of the 41st IEEE/ACM International Conference on Automated Software Engineering2026引用 0 inbox
Zhiyuan Pan, Sungmin Kang, Imam Nur Bani Yusuf, Abhik Roychoudhury
crossref: 2026-10-09

AI 速览

一句话:提出 ExplainBench 基准,用问答方式自动评估编码智能体所生成代码解释的可信度。

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

问题
LLM 编码智能体生成的补丁规模越来越大,人工审查困难,开发者依赖智能体解释,但缺少评估这些解释是否可信的基准。
方法
基于“好解释应能让 LLM 正确回答问题”的直觉构建 ExplainBench,设计问题集检验解释是否准确刻画有缺陷代码的预期行为与应用补丁后的效果,并实现运行额外测试来验证和精炼解释的审计智能体。
评估
用 ExplainBench 评估多个编码智能体的解释,并与 SWE-bench Verified 排名对比;进一步分析解释中的常见错误,并评估解释审计智能体对解释质量的改进效果。
原文摘要(Abstract)

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.

链接与引用

DOI 原文 · arXiv · DBLP

BibTeX
@inproceedings{abs-2607-26451,
  title = {ExplainBench: Evaluating Code Explanations from Agents},
  author = {Zhiyuan Pan and Sungmin Kang and Imam Nur Bani Yusuf and Abhik Roychoudhury},
  booktitle = {ASE},
  year = {2026},
  doi = {10.1145/3832783.3834395}
}