构建多语言代码仓库级评测基准,提升自动代码审查模型评估准确性
AACR-Bench: Evaluating Automatic Code Review with Holistic Repository-Level Context
- 采用AI辅助+专家验证的标注流程,挖掘原始PR中遗漏的缺陷
- 缺陷覆盖率提升285%,显著超越传统数据集的检测能力
- 揭示上下文粒度与检索方法对不同模型性能的关键影响
高质量评估基准对于在自动代码审查(ACR)中部署大语言模型(LLMs)至关重要。现有基准存在两大局限:一是缺乏跨语言的仓库级上下文支持,限制了评估结果的泛化性;二是依赖来自原始拉取请求(PR)评论的噪声且不完整的真值数据,制约了问题检测范围。为此,我们提出AACR-Bench,一个涵盖多种编程语言的完整跨文件上下文基准。不同于传统数据集,该基准采用“AI辅助、专家验证”的标注流程,发现原始PR中常被忽略的潜在缺陷,使缺陷覆盖率提升285%。对主流LLMs在该基准上的广泛评估表明,以往评估可能因数据局限而误判或仅部分反映模型能力。本研究确立了更严格的ACR评估标准,并揭示:上下文粒度与检索方法的选择显著影响模型表现,且这种影响随模型、编程语言及使用范式(如是否采用Agent架构)而异。相关代码、数据及其他资源已开源于https://github.com/alibaba/aacr-bench。
原文摘要 · Abstract (English)
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 .
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。