AACR-Bench: 评估自动代码审查的综合仓库级上下文
AACR-Bench: Evaluating Automatic Code Review with Holistic Repository-Level Context
AI总结:
AACR-Bench通过综合仓库级上下文和专家验证流程,提升自动代码审查评估的准确性与全面性,揭示上下文粒度和检索方法对性能的影响。
摘要:
高质量的评估基准对于部署大语言模型(LLM)在自动代码审查(ACR)中至关重要。然而,现有基准存在两个关键限制:首先,缺乏多语言支持的仓库级上下文,限制了评估结果的通用性;其次,依赖于原始拉取请求(PR)评论中噪声和不完整的地面真实数据,限制了问题检测的范围。为了解决这些挑战,我们引入了AACR-Bench,一个全面的基准,提供跨多个编程语言的完整跨文件上下文。与传统数据集不同,AACR-Bench采用“AI辅助、专家验证”的标注流程,以发现常被原始PR忽视的潜在缺陷,从而将缺陷覆盖增加了285%。对主流LLM的广泛评估表明,先前的评估可能由于数据限制而误判或仅部分捕捉了模型能力。我们的工作建立了更严格的ACR评估标准,并提供了关于基于LLM的ACR的新见解,即上下文的粒度/级别和检索方法的选择显著影响ACR性能,且这种影响会根据LLM、编程语言和LLM使用范式(例如是否采用代理架构)而变化。我们的评估集的代码、数据和其他制品可在https://github.com/alibaba/aacr-bench获取。
英文摘要:
High-quality evaluation benchmarks are pivotal for deploying Large Language Models (LLMs) in Automated Code Review (ACR). However, existing benchmarks suffer from two critical limitations: first, the lack of multi-language support in repository-level contexts, which restricts the generalizability of evaluation results; second, the reliance on noisy, incomplete ground truth derived from raw Pull Request (PR) comments, which constrains the scope of issue detection. To address these challenges, we introduce AACR-Bench a comprehensive benchmark that provides full cross-file context across multiple programming languages. Unlike traditional datasets, AACR-Bench employs an "AI-assisted, Expert-verified" annotation pipeline to uncover latent defects often overlooked in original PRs, resulting in a 285% increase in defect coverage. Extensive evaluations of mainstream LLMs on AACR-Bench reveal that previous assessments may have either misjudged or only partially captured model capabilities due to data limitations. Our work establishes a more rigorous standard for ACR evaluation and offers new insights on LLM based ACR, i.e., the granularity/level of context and the choice of retrieval methods significantly impact ACR performance, and this influence varies depending on the LLM, programming language, and the LLM usage paradigm e.g., whether an Agent architecture is employed. The code, data, and other artifacts of our evaluation set are available at https://github.com/alibaba/aacr-bench .
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。