arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2503.16167cs.SEcs.CL
收藏

CodeReviewQA:面向大语言模型的代码审查理解评估基准

CodeReviewQA: The Code Review Comprehension Assessment for Large Language Models

The University of Melbourne(墨尔本大学);Singapore Management University(新加坡管理学院)

Hong Yi Lin, Chunhua Liu, Haoyu Gao, Patanamon Thongtanunam, Christoph Treude

AI总结:

本文提出 CodeReviewQA 基准,将代码审查精化任务分解为变更类型识别、变更定位和解决方案识别三个推理步骤,以多项选择形式在 900 个人工示例上评估 72 个大语言模型,实现细粒度能力诊断并降低数据污染风险。

摘要:

当前最先进的大语言模型(LLMs)已展现出令人瞩目的代码生成能力,但在真实软件工程任务中仍面临困难,例如根据代码审查意见修改源代码,这阻碍了它们的实际应用。代码审查评论往往隐晦、含糊且口语化,要求模型同时理解代码和人类意图。这一挑战要求评估大语言模型在技术语境与会话语境之间建立桥梁的能力。虽然已有工作采用自动代码精化(ACR)任务来处理这些评论,但现有评估方法存在不足,它们依赖文本匹配指标,对模型失败原因提供的洞察有限,并且容易受到训练数据污染的影响。为解决这些局限性,我们引入了一个新的评估基准 CodeReviewQA,它能够对模型能力进行细粒度评估并降低数据污染风险。在 CodeReviewQA 中,我们将代码精化的生成任务分解为三个关键推理步骤:变更类型识别(CTR)、变更定位(CL)和解决方案识别(SI)。每个步骤被重构为难度各异的多项选择题,从而能够精确评估模型能力,同时降低数据污染风险。我们的综合评估覆盖了 72 个近期发布的大语言模型,在九种编程语言上的 900 个人工整理的高质量示例上进行。结果表明,CodeReviewQA 能够揭示模型在代码审查理解方面的具体弱点,并将其与生成式自动代码精化结果分离开来。

英文摘要:

State-of-the-art large language models (LLMs) have demonstrated impressive code generation capabilities but struggle with real-world software engineering tasks, such as revising source code to address code reviews, hindering their practical use. Code review comments are often implicit, ambiguous, and colloquial, requiring models to grasp both code and human intent. This challenge calls for evaluating large language models' ability to bridge both technical and conversational contexts. While existing work has employed the automated code refinement (ACR) task to resolve these comments, current evaluation methods fall short, relying on text matching metrics that provide limited insight into model failures and remain susceptible to training data contamination. To address these limitations, we introduce a novel evaluation benchmark, $\textbf{CodeReviewQA}$ that enables us to conduct fine-grained assessment of model capabilities and mitigate data contamination risks. In CodeReviewQA, we decompose the generation task of code refinement into $\textbf{three essential reasoning steps}$: $\textit{change type recognition}$ (CTR), $\textit{change localisation}$ (CL), and $\textit{solution identification}$ (SI). Each step is reformulated as multiple-choice questions with varied difficulty levels, enabling precise assessment of model capabilities, while mitigating data contamination risks. Our comprehensive evaluation spans 72 recently released large language models on $\textbf{900 manually curated, high-quality examples}$ across nine programming languages. Our results show that CodeReviewQA is able to expose specific model weaknesses in code review comprehension, disentangled from their generative automated code refinement results.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑