arXiv:2608.18167cs.AIcs.SE2026-08中稿 · ICML综述

用三代理论实现高效代码审查,靠结构化分歧提升质量

Adversarial Review: Structured Disagreement for Grounded Agentic Code Review

论文配图:Adversarial Review: Structured Disagreement for Grounded Agentic Code Review
图 1 · 摘自论文原文
  • 主代码代理配合评审与审计代理,通过结构化分歧推动改进
  • 在LiveCodeBench上超越五代理基线,仅用三代理却达最高通过率
  • 适合追求高效协作的代码生成场景,尤其看重审评质量的团队

早期多智能体大模型系统常采用角色分离团队,但增加智能体数量对仓库级编码任务的收益递减。近期方法将智能体视为被动工具(子代理),却完全丧失了智能体间交互的优势。本文研究子代理范式能否提供中间路径:以最小代价实现智能体合作而不负担大规模多智能体团队的开销。提出对抗性审查(Adversarial Review, AR),一种仅需三个智能体的轻量协作代码审查协议:主编码代理协同评审代理与批评代理。评审代理评估代码,批评代理通过结构化分歧审计评审过程后,主代理再进行修改。在LiveCodeBench上,AR在测试方法中取得最高通过率,优于五代理基线,且仅使用三代理。在SWE-PRBench上,原始AR暴露了虚假共识失效模式——代理在缺乏充分证据时达成一致,但仅通过一次显式引入分歧的提示迭代,即达到所有测试方法中的最高F1值。在SWE-bench Verified上,AR在仓库级编码任务中亦优于基线。结果表明,有效的协作代码审查无需大量智能体或复杂通信结构,关键在于分歧必须最小化、结构化且基于证据。

原文摘要 · Abstract (English)

Early multi-agent LLM systems often used role-separated teams, yet scaling agent count yields diminishing returns on repository-level coding tasks. Recent alternatives treat agents as passive tools (subagents), yet this removes the benefits of agent interaction entirely. We study whether a subagent paradigm can support a middle ground: minimal agentic cooperation without the overhead of large multi-agent teams. We introduce Adversarial Review (AR), a minimal cooperative code-review protocol in which a main coding agent works with a reviewer and a critic agent. The reviewer evaluates code, while the critic audits the review through structured disagreement before the main agent edits. On LiveCodeBench, AR achieves the highest pass rate among tested methods, outperforming a five-agent baseline while using only three agents. On SWE-PRBench, naive AR exposes a false-consensus failure mode, where agents converge on agreement without sufficient evidence, but a single prompt iteration that adds disagreement explicitly achieves the highest F1 among tested methods. On SWE-bench Verified, AR also shows improvements over the baselines on repository-level coding tasks. Together, AR demonstrates that cooperative code review does not require many agents or complex communication structures: it requires that disagreement be minimal, structured, and evidence-grounded.

代码生成智能体协作结构化分歧

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。