paperbot · PL 论文追踪

全部论文 待读 收藏

P1 Benchmarking LLMs for Fine-Grained Code Review with Enriched Context in Practice

面向细粒度代码评审的 LLM 基准测试:富上下文与实践应用
FSE Proceedings of the 34th ACM International Conference on the Foundations of Software Engineering2026匹配度 5/10 · 论文属于 PL 与机器学习交叉下的代码评审 LLM 基准,与用户核心的静态分析/形式化验证/浮点/贝叶斯程序分析方向不直接匹配;但其富上下文基准设计和字节跳动工业落地符合用户对重要场景 benchmark 与工业案例的关注。引用 7 inbox
Ruida Hu, Xinchen Wang, Xin-Cheng Wen, Zhao Zhang, Bo Jiang, Pengfei Gao, Chao Peng, Cuiyun Gao
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出 ContextCRBench——一个富上下文、细粒度的代码评审基准,含 6.79 万条数据,揭示现有 LLM 的明显局限。

现有 LLM 代码评审基准存在三重局限:缺少 issue 描述等语义上下文、验证不足导致数据质量偏低、粒度粗(文件或提交级)而忽略行级细节。本文提出 ContextCRBench:从热门仓库爬取超 15.37 万条 issue 与 PR;通过严格关联 issue-PR 对获得文本上下文,并抽取完整所在函数或类作为代码上下文;再经多阶段过滤(去除过期、格式不规范及由 LLM 分类器判定的低价值样本),最终得到 67,910 条富上下文条目。基准支持三种评测场景:hunk 级质量评估、行级缺陷定位与评审意见生成。对八个主流 LLM 的评测显示现有模型能力明显不足,且文本上下文比单纯代码上下文带来更大提升;在字节跳动作为自演化工具的奖励信号部署时,带来 61.98% 的性能提升。

问题
现有 LLM 代码评审基准缺乏 issue 描述等丰富语义上下文、数据验证不足且粒度粗(文件/提交级),无法对行级细粒度评审能力进行可靠评测。
方法
构建 ContextCRBench:爬取热门仓库的 issue 与 PR,严格关联 issue-PR 对作为文本上下文并抽取完整函数/类作为代码上下文,再经多阶段过滤(时效、格式、LLM 分类器价值判定)得到 67,910 条富上下文数据。
评估
在三种场景(hunk 级质量评估、行级缺陷定位、评审意见生成)上评测八个主流 LLM,并分析不同上下文的作用;同时在字节跳动将其用作自演化工具的奖励信号以验证工业实用性。
原文摘要(Abstract)

While large language models (LLMs) have shown efficacy in automated code review, existing benchmarks suffer from three limitations: (1) a lack of rich semantic context like issue descriptions; (2) data quality issues due to insufficient validation; and (3) coarse granularity (file or commit level) that misses fine-grained, line-level nuances. To address these, we present ContextCRBench, a high-quality, context-rich benchmark designed for fine-grained evaluation of LLMs in code review tasks. Our construction pipeline consists of three main modules. First, the Raw Data Crawling module collects over 153.7k issues and PRs from the selected most popular repositories. Next, the Comprehensive Context Extraction module establishes rich context by rigorously linking issue-PR pairs for textual context and extracting the full surrounding function or class for code context. Finally, our Multi-stage Data Filtering module applies a series of checks to remove entries that are outdated, improperly formatted, or identified as low-value by an LLM-based classifier. This rigorous process yields the final benchmark of 67,910 entries. Each entry in our benchmark is enriched with both textual context and code context. Our benchmark supports three evaluation scenarios: hunk-level quality assessment, line-level defect localization, and review comment generation. Evaluations on eight popular LLMs reveal great limitations in current models, and textual context improves performance more than code context alone. Furthermore, when deployed at ByteDance as a reward signal for a self-evolving tool, ContextCRBench guided a 61.98% performance improvement, demonstrating its practical industrial utility. All scripts and datasets are available at https://github.com/kinesiatricssxilm14/ContextCRBench.

链接与引用

DOI 原文 · arXiv · PDF(开放获取) · DBLP

BibTeX
@inproceedings{abs-2511-07017,
  title = {Benchmarking LLMs for Fine-Grained Code Review with Enriched Context in Practice},
  author = {Ruida Hu and Xinchen Wang and Xin-Cheng Wen and Zhao Zhang and Bo Jiang and Pengfei Gao and Chao Peng and Cuiyun Gao},
  booktitle = {FSE},
  year = {2026},
  doi = {10.1145/3803437.3805235}
}