alphaFeedback

WorksComputer Science

CR-Bench-v2: Evaluating the Real-World Utility of AI Code Review Agents

AI contributions
Not recorded for this paper
View details

Abstract

The rapid growth of automated code generation has created a pressing need for automated code review. Yet code review resists full automation: it depends on context beyond the diff, on the author's intent, and on judgments about design and maintainability on which even expert reviewers disagree. Existing code review benchmarks lack standardization and rely largely on noisy human review comments scored with text-similarity metrics, which reward surface overlap and fail to measure precision. We introduce CR-Bench, a defect-centric evaluation framework that recasts SWE-Bench issues as pull-request review tasks with full repository context. After filtering for review-detectable defects and grounding each to a single originating pull request, CR-Bench contains 584 instances, with a 174-instance CR-Bench-Verified subset derived from SWE-Bench Verified. Each instance pairs a pull request with a known defect, its ground-truth fix, and a taxonomy label for bug category, impact, and severity. We propose two complementary metrics: Known-Defect Detection Rate (KDDR), which measures whether an agent identifies the labeled defect, and Usefulness Rate, which measures the fraction of review comments that are actionable. We evaluate eight code review agents over four backbones, plus commercially available Gemini Code Assist, using three independent LLM judges. Even the strongest systems detect only about one-third of known defects (KDDR ≈\approx 33%), and Gemini Code Assist detects 8.1%.

Introduction

Despite significant commercial interest ([8, 11, 1]), code review automation remains difficult ([30, 4]) because it is time-consuming for large multi-file repositories, costly, and inherently subjective ([10, 31, 23]). Existing code review benchmarks (Table 3, Appendix) fail in pull requests with at least one of these scenarios: multiple diff hunks, multi-file PR context, systematic categorization, and verifiable defect handling ([31, 23, 29, 28, 27]).

Method# TasksMultiple DiffsFull PR ContextCategorizationDefect-focusedEvaluation
Tufano et al., [29]1718✗✗✗✗Exact/BLEU
Tufano et al., [28]147, 533✗✗✗✗Exact/BLEU
Thongtanunam et al., [27]17K✗✗✗✗Exact
Li et al., [16]54K✗✗✗✗CodeBLEU
Zeng et al., [31]1000✓✓✓✗LLM Judge (P, R, F1)
CR-Bench (Ours)584✓✓✓✓LLM Judge (KDDR, U)
CR-Bench-Verified (Ours)174✓✓✓✓LLM Judge (KDDR, U)

Table 3. A novelty matrix positioning CR-Bench compared to existing code review datasets.

Feedback from engineers using review agents on live repositories shows that noisy comments hamper productivity and slow adoption. Before deploying an agent, a team needs to know how often it catches real defects and how much of its output is worth reading.

In this paper, we introduce CR-Bench/CR-Bench-Verified, a benchmark for evaluating how well code review agents detect defects and generate useful review comments. Each review task consists of the source repository, the identification number of the pull request (PR) within that repository, a description of the defect introduced by the PR, the ground-truth patch that resolves the defect, and three taxonomy labels: category, impact, and severity (see Figure 7 in the Appendix). It prioritizes defect-identifying reviews that target functional, performance, reliability, or security regressions: defects cause system faults and can be verified, whereas stylistic preferences are subjective and better handled by linters or human judgment.

CR-Bench PR Defect Taxonomy diagram showing Category, Impact, and Severity labels

Figure 7. Taxonomy Labels for PR defects including Category, Impact, and Severity.

Our key contributions are as follows:

  • CR-Bench and CR-Bench-Verified. A benchmark of real-world, detectable defects for evaluating automated code review agents, with each defect labeled under a fine-grained taxonomy of category, impact, and severity.

  • Two-axis evaluation metrics. A measurement framework that scores code review agents on both logical defect detection and the usefulness of their generated comments.

  • Comprehensive benchmarking. An evaluation

of eight code review agents and one commercial code review agent, showing that even the strongest agent detects only about one-third of known defects, with practical guidance for teams deploying review agents (§ 6).

Related Work

Table 3 (Appendix) compares CR-Bench with prior code review datasets on four properties: multiple diff hunks per task, full Pull Request (PR) context, categorization of the reviewed issue, and a focus on a verifiable defect. It also lists how each dataset scores reviews.

Learning-based code review. Early work frames review automation as a sequence-to-sequence task over a single code change. Tufano et al. [29] and Tufano et al. [28] train models to generate reviewer comments and revised code for method-level changes, and AutoTransform (Thongtanunam et al., [27]) learns the code transformations that reviewers request. CodeReviewer (Li et al., [16]) pre-trains on diff hunks for review comment generation and code refinement. Each task pairs one change with a reference comment or revision, so these datasets lack multi-hunk and cross-file PR context and carry no categorization of the underlying issue. They are scored with Exact Match, BLEU, or CodeBLEU, which reward similarity to the reference rather than detection of a defect. LLM agents such as CodeAgent (Tang et al., [26]) and production tools such as CodeRabbit (CodeRabbit, [8]), Gemini Code Assist (Google Cloud, [11]), and Qodo (Qodo AI, [22]) now review entire PRs, which calls for repository-scale evaluation.

Code review benchmarks. SWR-Bench (Zeng et al., [31]) provides full PR context at repository scale, includes multiple diff hunks, categorizes its PRs, and scores comments with an LLM judge (Liu et al., [17]) using precision, recall, and F1. However, it scores hits against human-verified change points, so its ground truth inherits the subjectivity of those changes and is not tied to a verifiable defect. CR-Bench/CR-Bench-Verified keep the multi-hunk, full-PR setting, ground each instance in a SWE-Bench defect (Jimenez et al., [15]) labeled by category, impact, and severity, and measure both defect detection (KDDR) and developer utility (Usefulness Rate). To the best of our knowledge, they are the first code review benchmarks with all four properties in Table 3.

CR-Bench: Benchmarking Framework for Code Review

Code Review starts with a Pull Request (PR) on a base code state (SBS_B) — a proposal to integrate a sequence of code modifications into a target code-base. Formally, PRPR is a set of {C,Δ,M}\{C, \Delta, \mathcal{M}\}, where C={c1,c2,…,cn}C = \{c_1, c_2, \ldots, c_n\} is a set of discrete commits, Δ\Delta is the cumulative code diff, and M\mathcal{M} denotes the associated metadata (e.g., title, description, and author). The output for a code review process is a set of mm reviews: R={(rC,rδ)i∣1≤i≤m}\mathcal{R} = \{(r_C, r_\delta)_i \mid1 \le i \le m\}. rCr_C is a natural language comment, which identifies specific defects or suggests improvements, and rδr_\delta provides a concrete code-level resolution to the identified defects. The code review task is formalized in Equation (1).

(PR,SB)→CR Agent or HumanRm(1)(PR, S_B) \xrightarrow{\text{CR Agent or Human}} \mathcal{R}^m \tag*{(1)}

We construct the CR-Bench/CR-Bench-Verified benchmarks by transforming the SWE-Bench (Jimenez et al., [15])/SWE-Bench Verified (Chowdhury et al., [7]) datasets using Algorithm 1. The algorithm converts SWE-Bench’s (issue,patch)(issue, patch) instances into (PR,Review)(PR, Review) instances: the PR is the earlier pull request that introduced the defect, and the reference review pairs a comment derived from the issue with the fix patch.

Dataset Creation Algorithm

Given the SWE-Bench or SWE-Bench Verified dataset S\mathcal{S}, each instance s∈Ss \in\mathcal{S} is processed through three sequential phases. Every LLM call in the pipeline uses Claude Opus 4.5 (Anthropic, [2]) as L\mathcal{L}. First, we apply an LLM-based detectability filter to classify whether the underlying issue in the patch is inferable from the code change itself. Specifically, we query an LLM L\mathcal{L} with a detectability prompt PD\mathcal{P}_D (Appendix § 8.1.1) over the patch s.patchs.\mathrm{patch}, and we discard instances deemed non-detectable. This step removes cases that require external context or latent knowledge. Second, we apply PR grounding to link each instance to the real-world pull requests that introduced the modified code. Starting from the base commit cbasec_{\mathrm{base}}, we retrieve commit IDs of modified lines using git blame. Using these, we retrieve associated PRs of these commit IDs via the GitHub API. Third, we apply a single-PR filter. We retain only the instances that map to a single PR, ensuring an unambiguous correspondence between the patch and Algorithm 1: CR-Bench Construction via SWE-Bench Transformation

CR-Bench framework diagram

Figure 1. CR-Bench framework. Offline preparation turns SWE-Bench defects into PR-context instances with taxonomy labels. An LLM judge classifies agent comments, and human annotations validate the classifications. KDDR measures labeled-defect detection. Usefulness Rate measures developer utility.

Require: SWE-Bench SS, LLM L\mathcal{L}, prompts PD\mathcal{P}_D (detectability), PC\mathcal{P}_C (comment), PT\mathcal{P}_T (tagging)

Ensure: CR-Bench dataset DD

  1. D←∅D \leftarrow\emptyset

  2. for each instance s∈Ss \in S do

  3. Detectability filtering: is_detectable←L(PD,s.patch)is\_detectable \leftarrow\mathcal{L}(\mathcal{P}_D, s.patch)

  4. continue if ¬is_detectable\neg is\_detectable

  5. PR grounding: cbase←s.base_commitc_{base} \leftarrow s.base\_commit

  6. Cblame←GitBlame⁡(cbase)C_{blame} \leftarrow\operatorname{GitBlame}(c_{base})

  7. PR←QueryGitHubAPI⁡(Cblame)PR \leftarrow\operatorname{QueryGitHubAPI}(C_{blame})

  8. Single-PR filter: continue if ∣PR∣≠1\lvert PR \rvert\ne1

  9. pr←pr \leftarrow unique element of PRPR

  10. Attribute generation & aggregation: rc←L(PC,s.desc)r_c \leftarrow\mathcal{L}(\mathcal{P}_C, s.desc)

  11. rδ←s.patchr_\delta\leftarrow s.patch

  12. tgen←L(PT,rδ,rc)t_{gen} \leftarrow\mathcal{L}(\mathcal{P}_T, r_\delta, r_c)

  13. D←D∪{(pr,rδ,rc,tgen)}D \leftarrow D \cup\{(pr, r_\delta, r_c, t_{gen})\}

  14. end for

  15. return DD

its origin PR. Instances with zero or multiple associated PRs are discarded. Finally, we perform attribute generation and dataset aggregation. For each retained instance, we generate a natural language review comment rcr_c using L\mathcal{L} with prompt PC\mathcal{P}_C (Appendix § 8.1.2), conditioned on the original problem description. The patch itself is retained as rδr_\delta. We further assign tags of category, impact, severity tgent_{gen} using a tagging prompt PT\mathcal{P}_T (Appendix § 8.1.3) over both the patch and generated comment. The resulting tuple (pr,rδ,rc,tgen)(pr, r_\delta, r_c, t_{gen}) is added to the dataset DD. Together, these steps keep only actionable, context-resolvable review scenarios, and the generated attributes support fine-grained evaluation. They reduce SWE-Bench from 2,294 to 584 instances (CR-Bench) and SWE-Bench Verified from 500 to 174 (CR-Bench-Verified). The 174 CR-Bench-Verified tasks span 11 source repositories, led by Django with 63 (Figure 5, Appendix). Other repositories include mathematical libraries like sympy/sympy, and specialized tools such as astropy/astropy and scikit-learn/scikit-learn. The statistics in Table 4, Appendix show that CR-Bench covers large scale PRs and an code review agents must be robust to perform well on it. An example of data instance is given in Figure 6 in Appendix.

DatasetFixed linesPR comments
CR-Bench10.2841.03
CR-Bench-Verified8.6935.83

Table 4. Per-instance means for all 584 CR-Bench instances and the 174-instance verified subset. Fixed lines count lines changed by the known repair. PR comments count comments in the originating pull request.

Bar chart showing tasks per source repository in CR-Bench-Verified

Figure 5. Tasks per source repository in CR-Bench-Verified (174 instances). Repositories are inherited from SWE-Bench Verified. Django is the largest repository with 63 tasks (36.2%), and Django and SymPy together account for just over half of the benchmark (54.6%). The remaining nine repositories span documentation tooling (Sphinx), scientific computing (Matplotlib, scikit-learn, Astropy, xarray), testing and linting (pytest, pylint), and HTTP and web libraries (Requests, Flask).

One CR-Bench instance showing an originating pull request, known repair patch, and target review comment

Figure 6. One CR–Bench instance. The PR context (top) concerns Django’s escaped-URL punctuation handling. Its known defect is that trim_punctuation() slices escaped URLs with indices derived from the unescaped string. The repair rδr_{\delta} (bottom left) computes the removed punctuation count before slicing. Red and green mark removed and added code. The target comment rcr_c (bottom right) identifies the same defect, so its label is Bug Hit. (a) Originating pull request (PR); (b) Known repair patch (rδr_{\delta}); (c) Target review comment (rcr_c), labeled Bug Hit.

For ease of evaluation analytics, each instance of the CR-Bench/CR-Bench-Verified datasets is labeled into three classes: category, impact, and severity, as defined in Table 1 and Figure 7 in the Appendix. In order to generate class labels, we make an LLM call (Step 12 in Algorithm 1) using the problem definition (descdesc) and fix patch with a tag generation prompt PT\mathcal{P}^T (Appendix § 8.1.3). The prompt also elaborates on the definition of each of the items in all three buckets.

TaxonomyElements
CategoryStructural, IIS, RFF, Data, Concurrency, Memory, Security, Coding
ImpactFunctional Suitability, Performance Efficiency, Compatibility, Usability, Reliability, Security, Maintainability, Portability
SeverityLow, Medium, High

Table 1. The CR-Bench taxonomy elements for defect labeling. Category follows Beizer [5]; Islam et al. [14] and impact follows ISO 25010 (International Organization for Standardization and International Electrotechnical Commission, [13]); severity is ours.

As per Figure 8, CR-Bench-Verified is heavily weighted toward Structural Bugs, accounting for 82.8% of the corpus. These represent complex errors in logical flow. The primary impacts are Functional Suitability and Reliability. The rigor is further evidenced by 92.5% of the defects being Medium or High severity. High-severity defects are predominantly linked to Reliability and Functional Suitability, representing critical failures that would likely result in system regressions if merged. The 174 instances are what survives applying detectability filtering, PR grounding, and the single-PR filter to the 500 human-validated instances of SWE-Bench Verified [7], a scale comparable to agentic benchmarks that verify every instance by hand, such as Terminal-Bench 2.0 with 89 tasks [18].

Three heatmaps showing category by severity, category by impact, and severity by impact

Figure 8. Pairwise counts for the 174 CR-Bench-Verified instances. Panels show category by severity (left), category by impact (center), and severity by impact (right). Only observed taxonomy levels appear. RFF = Requirements, Features and Functionality. IIS = Interface, Integration and System.

The expansion into the full CR-Bench further reinforces these findings while increasing the size of the benchmark. As shown in Figure 9, Appendix § 12, this larger dataset adds instances of impacts like Maintainability, Security, and some readjustments to proportions of different categories, impacts, and bugs. This ensures that the benchmark provides a meaningful assessment of an agent’s ability.

Pairwise cross-tabulations for all 584 CR-Bench instances

Figure 9. Pairwise cross-tabulations for all 584 CR-Bench instances. The panels show category by severity (left), category by impact (center), and severity by impact (right). Each cell counts instances. Only observed taxonomy levels are shown. RFF = Requirements, Features and Functionality. IIS = Interface, Integration and System.

Experiments

We assess the construct validity of CR-Bench by testing whether it reproduces well-established patterns from prior work. We test two: iterative self-reflection on a model’s own output improves over single-shot generation [24], and stronger models resolve more repository-level tasks, as reflected in the SWE-Bench leaderboard [15]. Reflexion should thus beat single-shot on each backbone, and GPT-5 backbones should beat the smaller open-weight ones.

We evaluate four backbone LLMs: two closed-API models, GPT-5.2 [25, 19] and GPT-5-mini [25], and two open-weight models, Gemma 4 31B [12] and GPT-OSS 20B [20]. All nine resulting systems are evaluated on CR-Bench-Verified.

We evaluate each model under two harnesses of increasing complexity: a single-shot harness that issues one model call over the PR diff (Appendix § 8.2.1, inspired by Qodo AI [22]), and a self-reflection harness that iteratively critiques and revises its review [24] (Appendix § 8.2.2). We also evaluate Gemini Code Assist, a fully managed commercial agent whose underlying LLM and harness are not disclosed, by cloning PRs and repositories into a private GitHub instance and invoking it through its GitHub App2.

CR-Bench itself was built with Claude Opus 4.5 (§ 3), which we use neither as a review agent nor as a judge. We score each fixed set of reviews independently with GPT-5.4 [21], Claude Sonnet 4.5 [3], and DeepSeek V4 Flash [9] using the same balanced evaluator prompt (Appendix § 8.§ 3.1). We additionally test strict (Appendix § 8.3.2) and lenient (Appendix § 8.3.3) prompt variants for the GPT-5.2 single-shot and Reflexion outputs.

Evaluation Methodology with LLM-as-a-Judge

CR-Bench uses LLM-as-a-Judge evaluators (Appendix § 8.§ 3.1) to classify each review comment into one of two labels: first, Bug Hit (H) corresponds to reviews that accurately identify or directly relate to the specific bug described in the ground truth review, and second, Valid Suggestion (S) corresponds to reviews with constructive feedback such as stylistic improvements, performance optimizations, or edge-case handling. These reviews are significant, but not related to the primary defects in ground truth. We measure identification of the benchmark’s labeled defect using the Known-Defect Detection Rate (KDDR). Let each of the BB benchmark instances contain one SWE-Bench-derived known defect. A PR may contain other unlabeled defects. Let di=1d_i = 1 when at least one review comment identifies instance ii’s known defect, and di=0d_i = 0 otherwise:

KDDR=1B∑i=1Bdi(2)\mathrm{KDDR} = \frac{1}{B}\sum_{i=1}^{B} d_i \tag*{(2)}

KDDR scores review output against the defect CR-Bench labels for each instance, so it measures detection rather than repair and is not comparable to SWE-Bench resolve rates.

Because agents can produce useful comments beyond the single labeled defect, we also report Usefulness Rate (U). Here, RR is the total number of review comments:

U=H+SR(3)U = \frac{H + S}{R} \tag*{(3)}

Uncertainty and robustness. Point estimates use all 174 instances. 95% confidence intervals come from 1,000 instance-level bootstrap resamples (seed 42) that keep each instance’s comments together. Strategy comparisons are paired by instance_id, with paired bootstrap intervals and two-sided permutation tests (1,000 permutations). The balanced evaluator prompt is primary; strict and lenient variants measure prompt sensitivity (Appendix § 15).

Results

Does CR-Bench Reproduce Known Patterns?

Both patterns from § 4 hold. First, Reflexion improves KDDR for every backbone under every judge (Table 2), significantly in 8 of the 12 backbone–judge pairs. GPT-5.2, the strongest single-shot system, gains 2.9–5.7 points without reaching significance. Second, both GPT-5 backbones beat both open-weight backbones under each strategy (Figure 3). Gemini Code Assist detects only 8.1±0.6%8.1 \pm0.6\% of known defects, below every system except single-shot GPT-OSS 20B. Even the best systems detect only about one-third of known defects (KDDR≈33%KDDR \approx33\%), so CR-Bench is far from saturated.

Three-judge mean KDDR and Usefulness Rate per system

Figure 3. Three-judge mean KDDR and Usefulness Rate per system (Table 7). Arrows go from single-shot (hollow) to Reflexion (filled). The solid line is the Pareto frontier.

SystemKDDRUsefulness Rate
GPT-5.2 single-shot28.9±2.328.9 \pm2.386.2±11.386.2 \pm11.3
GPT-5.2 Reflexion33.0±1.333.0 \pm1.389.8±9.589.8 \pm9.5
GPT-5-mini single-shot23.4±2.323.4 \pm2.369.0±29.969.0 \pm29.9
GPT-5-mini Reflexion33.7±4.933.7 \pm4.972.6±28.472.6 \pm28.4
Gemma 4 31B single-shot14.0±1.214.0 \pm1.264.5±27.864.5 \pm27.8
Gemma 4 31B Reflexion21.6±2.121.6 \pm2.168.6±27.368.6 \pm27.3
GPT-OSS 20B single-shot7.1±1.87.1 \pm1.853.3±27.953.3 \pm27.9
GPT-OSS 20B Reflexion13.4±1.813.4 \pm1.861.2±26.661.2 \pm26.6
Gemini Code Assist8.1±0.68.1 \pm0.678.0±20.078.0 \pm20.0

Table 7. Performance on CR-Bench-Verified. Each cell is the mean ±\pm sample standard deviation over the three judges (GPT-5.4, Claude Sonnet 4.5, DeepSeek V4 Flash, n=3n = 3) under the balanced prompt. The deviation measures spread across evaluators, not sampling error; per-judge estimates with instance-bootstrap confidence intervals are in Table 8. Percentage metrics omit the % symbol.

BackboneClaudeGPT-5.4DeepSeek
GPT-5.2+5.7+3.4+2.9
GPT-5-mini+6.9*+11.5*+12.6*
Gemma 4 31B+6.9*+8.6*+7.5*
GPT-OSS 20B+6.3*+6.3*+6.3

Table 2. Reflexion minus single-shot KDDR (percentage points) on CR-Bench-Verified, per backbone and judge. * p<0.05p < 0.05, two-sided paired permutation test over instances. Confidence intervals and the other metrics are in Table 9, Appendix § 15.

Defect Detection versus Developer Utility

Reflexion improves both for every backbone, so self-reflection does not trade usefulness for detection. Only GPT-5.2 and GPT-5-mini Reflexion are Pareto-optimal: GPT-5-mini matches GPT-5.2 on KDDR (33.7 vs. 33.0%) but trails it by 17 points in Usefulness Rate. Gemini Code Assist shows the opposite profile: its comments are often useful (78.0%) but rarely hit the known defect.

Robustness to the Evaluator

Each judge scores the same fixed review comments (Figure 2). The judges agree on direction but not on level: GPT-5.4 gives the highest Usefulness Rate for all nine systems and DeepSeek V4 Flash the lowest, while Claude Sonnet 4.5 gives the lowest KDDR for eight of nine. Paired comparisons within a judge are therefore more reliable than absolute scores. For GPT-5.2, the Reflexion KDDR gain also holds under strict and lenient evaluator prompts (Table 10, Appendix § 15).

Judge-specific KDDR and Usefulness Rate for Claude Sonnet 4.5, GPT-5.4, and DeepSeek V4 Flash across GPT-5.2, GPT-5-mini, Gemma 4 31B, GPT-OSS 20B, and Gemini Code Assist

Figure 2. Judge-specific KDDR (left) and Usefulness Rate (right) for the same fixed review comments on all 174 verified instances under the balanced prompt. Single = single-shot, Refl. = Reflexion, and Gemini = Gemini Code Assist. Marker shape identifies the judge. Points are full-sample estimates. Bars are 95% percentile confidence intervals from 1,000 instance-level bootstrap resamples.

Evaluation judgePromptSingle-shot KDDRSingle-shot UReflexion KDDRReflexion U
Claude Sonnet 4.5Balanced26.481.732.289.5
Strict25.938.232.850.7
Lenient27.044.032.252.7
GPT-5.4Balanced31.099.134.599.4
Strict24.794.332.298.8
Lenient23.635.431.653.0
DeepSeek V4 FlashBalanced29.377.832.280.4
Strict21.841.130.551.0
Lenient26.415.429.343.8

Table 10. Prompt robustness for fixed GPT-5.2 single-shot and Reflexion outputs on all 174 verified instances. Each judge classifies the same comments under balanced, strict, and lenient evaluator prompts. KDDR and Usefulness Rate (U) are percentages. Higher is better.

Which Defects Do Agents Catch?

Figure 4 breaks KDDR down by taxonomy group. Four groups have fewer than ten instances, so we draw conclusions only from groups with at least 13. Severity matters only for the GPT-5 backbones: with Reflexion, GPT-5.2 and GPT-5-mini detect 45.8% and 48.8% of high-severity defects against 27.0% and 26.0% of medium ones, while Gemma 4 31B and GPT-OSS 20B show no clear difference. Reflexion improves KDDR in every well-populated group for every backbone, most for GPT-5-mini; the largest single gain is GPT-5.2 on Compatibility defects (12.8% to 43.6%). Table 11 and Figure 16 give the full breakdown.

KDDR for taxonomy groups across GPT-5.2, GPT-5-mini, Gemma 4 31B, and GPT-OSS 20B, comparing Single-shot and Reflexion

Figure 4. KDDR for every taxonomy group (Table 11, Appendix § 15), one panel per backbone. Hollow gray markers are single-shot, filled blue markers are Reflexion, and arrows point from single-shot to Reflexion. Each value averages the three judges under the balanced prompt. Faded rows marked † have fewer than 10 instances and are shown for completeness only. RFF = Requirements, Features and Functionality, IIS = Interface, Integration and System.

DimensionGroupnnGPT-5.2GPT-5-miniGemma 4 31BGPT-OSS 20B
CategoryStructural14431.5 → 35.925.9 → 34.314.1 → 22.97.4 → 14.1
IIS1921.1 → 29.817.5 → 36.821.1 → 24.68.8 → 14.0
RFF{sup}†70.0 → 0.00.0 → 14.30.0 → 0.00.0 → 4.8
Data{sup}†333.3 → 0.00.0 → 33.30.0 → 0.00.0 → 0.0
Memory{sup}†10.0 → 0.00.0 → 33.30.0 → 0.00.0 → 0.0
ImpactFunctional Suitability10528.9 → 29.520.3 → 30.513.7 → 19.76.7 → 13.0
Reliability4135.8 → 39.831.7 → 38.214.6 → 22.010.6 → 17.1
Compatibility1312.8 → 43.633.3 → 43.617.9 → 33.35.1 → 12.8
Usability1320.5 → 25.67.7 → 30.812.8 → 23.12.6 → 7.7
Perf. Efficiency{sup}†250.0 → 50.050.0 → 66.70.0 → 33.30.0 → 0.0
SeverityLow1320.5 → 25.67.7 → 30.812.8 → 23.12.6 → 7.7
Medium10525.4 → 27.017.5 → 26.011.4 → 20.34.1 → 12.7
High5637.5 → 45.838.1 → 48.819.0 → 23.813.7 → 16.1

Table 11. KDDR (%) for every taxonomy group, written as single-shot → Reflexion. Each value averages the three judges under the balanced prompt. nn is the number of CR-Bench-Verified instances in the group. †Groups with fewer than 10 instances are listed for completeness only. Their confidence intervals are tens of percentage points wide, so we draw no conclusions from them. The dimensions overlap: 12 of the 13 Usability instances are also the Low-severity instances, and Reliability is mostly high severity (26 High, 15 Medium, 0 Low). Differences across impact groups therefore partly reflect severity. Figure 16 plots the severity rows with confidence intervals. Figure 4 plots every row. RFF = Requirements, Features and Functionality, IIS = Interface, Integration and System.

KDDR (%) by defect severity for GPT-5.2, GPT-5-mini, Gemma 4 31B, and GPT-OSS 20B

Figure 16. KDDR by defect severity for each backbone. Points average the three judges under the balanced prompt, and bars are 95% bootstrap confidence intervals. The number of instances per severity level is printed on the axis. Table 11 reports the same numbers for every category and impact group.

Can an LLM Judge Replace Human Annotators?

Three expert developers independently labeled 60 reviews from the GPT-5.2 Reflexion agent. Claude Sonnet 4.5 matches the human majority on 71.7% of them, while pairwise agreement among the experts themselves ranges from 0.48 to 0.75. Under the Alternative Annotator Test [6], its winning rate is 67% at ϵ=0.3\epsilon= 0.3 and 100% at ϵ=0.5\epsilon= 0.5, so once the cost of expert annotation is counted (ϵ≥0.3\epsilon\ge0.3), it is a statistically justified substitute for an individual expert annotator. Appendix § 14 reports the full study.

Conclusion

We introduced CR-Bench, a defect-centric (PR, Review) benchmark of 584 instances (174 verified) labeled by root cause, impact, and severity, which scores review agents on known-defect detection and usefulness.

Implications for practice. (1) The best systems catch about one-third of known defects, so agents should assist human reviewers, not gate merges. (2) Self-reflection raised both KDDR and Usefulness Rate for every backbone. (3) Useful comments alone misleads: Gemini Code Assist’s comments are useful 78.0% of the time, yet it detects 8.1% of known defects, so test agents against known defects before deployment. (4) LLM judges differ in calibration, so compare agents under the same judge.

Future work will add more languages and agent designs and use CR-Bench for post-training.

Limitations

Scope of the data. CR-Bench inherits the scope of SWE-Bench: all instances come from open-source Python repositories, and the 174 CR-Bench-Verified tasks span only 11 of them, with Django alone contributing 63. Results may not transfer to other languages, to proprietary or monorepo codebases, or to review practices outside these projects. The reported agent evaluation uses only the verified split; broader conclusions require evaluating the full corpus and additional ecosystems.

One known defect per instance. Each instance supplies a single known defect, so KDDR measures whether an agent finds that defect, not whether it finds every defect in a PR. Other correct defect reports are counted as Valid Suggestions rather than Bug Hits and contribute to the Usefulness Rate instead.

LLM-generated references and labels. Claude Opus 4.5 filters instances for detectability, writes the reference review comments, and assigns the taxonomy labels. Errors in these steps propagate to KDDR and to the per-group results, and the detectability filter may exclude defects that a human reviewer could catch.

Evaluator dependence. Absolute scores depend on judge calibration: the three judges agree on the direction of differences but not on their magnitude. Our primary human-validated judge, Claude Sonnet 4.5, belongs to the same model family as the model that generated the references, which may favor phrasing close to those references. The human study covers 60 comments from a single system (GPT-5.2 Reflexion) and validates only that judge. We mitigate these effects by reporting three judges, prompt variants, and paired within-judge comparisons.

Contamination. The repositories, issues, and fixes behind SWE-Bench are public and may appear in the training data of the evaluated models, which could inflate KDDR.

Agents evaluated. We evaluate two reproducible harnesses, neither of which executes code or uses tools, and one commercial agent whose model and harness are undisclosed and may change over time. We do not report cost or latency, so the extra model calls that Reflexion requires are not weighed against its gains.

Ethical Considerations

Data. CR-Bench is derived from SWE-Bench and SWE-Bench Verified, which are built from public open-source repositories. It adds pull request identifiers, LLM-generated reference comments, and taxonomy labels, and it contains no private or proprietary code.

Human annotation. Two in-house software engineers and one technical director labeled 60 review comments as Bug Hit, Valid Suggestion, or Noise as part of their regular duties, and they agreed to the use of their labels. The task involved only public code and model-generated review text.

Responsible use. The best evaluated systems detect about one-third of known defects. Teams that rely on review agents as the only safeguard may therefore merge defective code. We recommend using such agents to assist human reviewers rather than to replace them, and testing them against known defects before deployment.

Prompts

Dataset Creation Prompts

Detectability Filter Prompt

System Prompt: You are a software engineering expert analyzing code changes. Your task is to determine if a change is of the kind that might have been prevented by reviewing the PR/commit that made that change more carefully or NOT. Name these PREVENTABLE and UNPREVENTABLE. PREVENTABLE: Code changes that fix incorrect behavior, errors, crashes, or unexpected results introduced by a previous code change (PR/commit). UNPREVENTABLE: Everything else including but not limited to: New features, refactoring, documentation, performance improvements, or enhancements.

Respond with JSON only: { "category": "PREVENTABLE" or "UNPREVENTABLE", "confidence": 0.0 to 1.0, "reasoning": "brief explanation" }

User Prompt: Problem Statement: {problem_statement}

Patch: {patch}

Is this a bug fix that might have been introduced by a previous code change (PR/commit)?

Bug Description Generation Prompt

System Prompt: You are a software engineering expert writing technical bug descriptions.

Given a problem statement and the code fix patch, write a concise technical description of the bug.

Format Requirements:

  • Start with a clear statement of what's wrong

  • Include specific code snippets showing the problematic pattern

  • Explain why it's a bug (runtime impact, incorrect behavior)

  • Keep it under 100 words

  • Use technical language

  • Focus on the root cause, not symptoms

Respond with ONLY the bug description (no JSON, no extra formatting).

User Prompt: Bug Description Task

Problem Statement

{problem_statement}

Code Fix

File: {file_path} Lines: {line_start}-{line_end}

{patch}

Write a concise technical description of this bug.

Bug Taxonomy Tagging Prompt

System Prompt: You are a software engineering expert analyzing bug reports to classify them according to a predefined bug taxonomy used in empirical software engineering research.

Analyze the bug from the issue description (problem statement) and the code fix patch, and provide a classification using the following fields.


1. category

Choose EXACTLY ONE of the following bug types:

1. Requirements, Features, and Functionality Bugs

Source: Ambiguous, incomplete, misunderstood, or changing requirements/specifications.

Types:

  • Requirements bugs: Missing, ambiguous, or inconsistent requirements.

  • Feature bugs: Wrong, missing, or extra features, including undesired enhancements.

Detection/Remedy: Formal specification languages, functional testing (transaction flow, domain, logic, state-based testing).

2. Structural Bugs

Source: Code control flow, sequence, and logical structure.

Types:

  • Control & sequence bugs: Missing paths, unreachable code, improper loop nesting, misused GOTO/labels.

  • Logic bugs: Incorrect logical expressions and Boolean errors.

  • Processing bugs: Arithmetic, algorithm, type conversion, overflow errors.

  • Initialization bugs: Uninitialized variables or improper first-loop values.

  • Data-flow anomalies: Using uninitialized or stale data or failing to store or modify data correctly.

Detection/Remedy: Structural/path testing, unit testing, domain testing.

3. Data Bugs

Source: Specification, format, initial values, and usage of data objects. Types:

  • Dynamic data bugs: Temporary data issues, shared memory residues.

  • Static data bugs: Fixed content, parameters, and preprocessing errors.

  • Role-based bugs: Errors in data used as control, parameter, or information.

  • Attributes, structure, content bugs: Incorrect semantics, memory allocation, or representation.

Detection/Remedy: Validate all data declarations, centralize shared resources, defensive coding, compile-time checks.

Coding Bugs

Source: Programming errors, including wild-card or arbitrary mistakes.

Types:

  • Syntax errors: Usually caught by compilers.

  • Documentation bugs: Misleading comments or manuals.

Detection/Remedy: Proper code review, accurate documentation, automated syntax checking.

Interface, Integration, and System Bugs

Source: Interactions between components, systems, or hardware.

Types:

  • External interface bugs: Wrong device or protocol handling.

  • Internal interface bugs: Improper module communication.

  • Hardware bugs: Misunderstood device behavior, I/O errors.

  • OS bugs: Misuse or assumption of OS services.

  • Software architecture bugs: Emergent behavior due to module interactions or stress.

  • Integration bugs: Incompatibilities between integrated modules.

  • System bugs: Complex interaction of multiple components, rare but expensive.

Detection/Remedy: Design for modularity, stress testing, integration testing, specialist interfaces.

Test and Test Design Bugs

Source: Errors in testing processes or test code.

Types:

  • Test execution bugs: Incorrect test implementation.

  • Test design bugs: Flawed test scenarios or criteria.

Detection/Remedy: Test debugging, automation of test execution and design, test quality assurance.

Memory-related Bugs

Source: Improper memory handling.

Types:

  • Buffer overflow: Access beyond allocated memory.

  • Stack smashing: Overwriting function return addresses.

  • Memory leak: Lost pointers to allocated memory.

  • Uninitialized read: Accessing memory before initialization.

  • Double free: Freeing memory twice.

Detection/Remedy: Careful memory management, automated memory checking tools.

Concurrent Bugs

Source: Multi-threading or multi-process synchronization issues.

Types:

  • Data race bugs: Conflicting access to shared memory.

  • Atomicity bugs: Interrupted sequences of operations.

  • Deadlock: Processes waiting indefinitely for shared resources.

Detection/Remedy: Proper synchronization, lock ordering, deadlock detection mechanisms.


Severity

Classify the runtime impact of the bug:

  • Critical: System crash, severe malfunction, data loss, or serious security risk.

  • High: Core functionality broken or system unusable in common scenarios.

  • Medium: Partial malfunction, degraded behavior, or non-critical failures.

  • Low: Minor issues, cosmetic problems, edge cases, or test-only failures.


Impact

Choose EXACTLY ONE aspect of the software that the bug directly compromises:

1. Functional Suitability

Description: Bugs that cause incorrect, missing, or inappropriate behavior relative to requirements.

  • Examples: Wrong outputs, missing features, incorrect calculations.

2. Performance Efficiency

Description: Bugs that degrade system performance or resource utilization.

  • Examples: Slow response, high CPU/memory usage, poor throughput.

3. Compatibility

Description: Bugs that interfere with interoperability or co-existence with other systems, devices, or software.

  • Examples: Integration failures, protocol mismatches, API incompatibilities.

#### 4. Usability

* Description: Bugs that make the system confusing, hard to use, or increase user errors. * Examples: Misleading error messages, poor workflow, inaccessible UI elements.

#### 5. Reliability

* Description: Bugs that cause system instability, crashes, incorrect state, or inability to recover from failures. * Examples: Crashes, deadlocks, memory leaks, data corruption.

#### 6. Security

* Description: Bugs that expose the system to threats, unauthorized access, or data compromise. * Examples: Buffer overflows, improper access control, injection vulnerabilities.

#### 7. Maintainability

* Description: Bugs that make code harder to understand, modify, or extend. * Examples: Poorly structured code, missing documentation, complex interdependencies.

#### 8. Portability

* Description: Bugs that prevent software from being installed, executed, or transferred across different environments. * Examples: OS-specific assumptions, hardware incompatibilities, environment-specific failures.


#### 4. reasoning

Concisely explain the reasoning behind the category, impact, and severity of the bug.


### Output format

Respond ONLY with valid JSON in the following format:

{
  "category": "...",
  "severity": "...",
  "impact": "...",
  "reasoning": "..."
}

Do not include explanations, markdown, or any additional text outside the JSON.

User Prompt: # Bug Classification Task

## Problem Statement

{problem_statement}

## Code Fix File: {file_path} Lines: {line_start}-{line_end}

{correct_fix}

Analyze this bug and provide classification as JSON.

Agent Prompts

Single-Shot Agent Prompt

System Prompt box

Figure 1 (PDF p. 12).

System Prompt:

You are an expert code reviewer analyzing pull requests for potential bugs and issues.

Your task is to review the provided code changes and identify:

  1. Potential bugs or errors

  2. Logic issues

  3. Edge cases not handled

  4. Security vulnerabilities

  5. Performance problems

For each issue found, provide:

  • file: The file path

  • line: The line number (approximate)

  • comment: Clear description of the issue

  • severity: "high", "medium", or "low"

Output your review as a JSON array of comments. Example: [ { "file": "src/module.py", "line": 42, "comment": "Potential null pointer dereference. Variable 'user' may be None.", "severity": "high" } ]

If no issues found, return an empty array: []

Focus on actual bugs, not style or formatting issues. Do not be verbose, just provide the review comments in concise manner that describes the issue completely.

User Prompt: # Pull Request Review

Repository: {{ repo }} PR Number: {{ pr_number }} Title: {{ title }} Description: {{ description }}

## Diff

\{\{ diff \}\}

Please review the above changes and identify any potential bugs or issues.

Reflexion Agent Prompt

System Prompt: You are an expert code reviewer specializing in bug detection and security analysis.

Review the provided code changes and identify ONLY actual bugs and issues, NOT style or formatting concerns.

Focus Areas:

  1. Bugs: Logic errors, incorrect implementations, type mismatches

  2. Edge Cases: Unhandled null/undefined, empty arrays, boundary conditions

  3. Security: SQL injection, XSS, authentication bypasses, data leaks

  4. Concurrency: Race conditions, deadlocks, thread safety issues

  5. Performance: Memory leaks, infinite loops, inefficient algorithms

Output Format:

Return a JSON array. Each issue must include:

  • file: Exact file path from the diff

  • line: Line number where issue occurs

  • comment: Specific, actionable description of the bug (not generic warnings)

  • severity: "high" (crashes/security), "medium" (data corruption/incorrect behavior), "low" (minor issues)

Quality Standards:

  • Be SPECIFIC: Point to exact problematic code, not general concerns

  • Be CERTAIN: Only report issues you're confident are real bugs

  • Explain WHY: Include the consequence of the bug

  • Suggest FIX: Briefly mention how to resolve it

Return [] if no bugs found.

Example:

[ { "file": "src/auth.py", "line": 23, "comment": "Missing null check before accessing 'user.email'. Will throw AttributeError if user is None. Add: if user is None: return error", "severity": "high" } ]

User Prompt:

Pull Request to Review

Repository: {{ repo }}

PR #{{ pr_number }}: {{ title }}

{{ description }}

Code Changes

{{ diff }}

Analyze the diff above and identify concrete bugs. Focus on what could actually break or cause incorrect behavior.

Reflection System Prompt: You are performing iterative self-improvement using the Reflexion framework.

Your goal: Produce a MORE COMPLETE and ACCURATE review by finding bugs you missed.

Reflexion Strategy:

PRIMARY FOCUS: Find Missed Bugs (False Negatives)

Your previous review likely MISSED important bugs. Search for:

  • Null/undefined dereferences you overlooked

  • Logic errors in conditionals or loops

  • Off-by-one errors, incorrect operators

  • Unhandled exceptions or error cases

  • Security vulnerabilities (injection, auth bypass)

  • Resource leaks, race conditions, memory issues

SECONDARY: Remove Only OBVIOUS False Positives

When in doubt, KEEP the issue. Err on the side of caution.

TERTIARY: Improve Existing Issues

  • Make vague comments more specific

  • Adjust severity if clearly wrong

  • Add fix suggestions

Output Requirements:

  • Return the FULL JSON array with ALL valid issues

  • Prioritize ADDING missed bugs over removing uncertain ones

  • Each comment must point to specific problematic code

  • Be thorough - it's better to report a potential bug than miss a real one

Return [] only if you're absolutely certain no bugs exist.

Reflection User Prompt:

Reflection - Iteration {{ iteration }}: Find What You Missed

Repository: {{ repo }} | PR: {{ pr_number }}

Code to Review

{{ diff }}

Your Previous Review (Iteration {{ prev_iteration }})

You found {{ num_comments }} issue(s): ````markdown

{{ previous_comments }}

Reflexion Task: FIND MISSED BUGS

PRIMARY: What Bugs Did You Miss?

Carefully re-examine the diff. Look for bugs you may have overlooked in the previous review, including failures that emerge from interactions across changed lines, invalid assumptions, missing validation, incorrect state transitions, and changed call sites. Do not duplicate issues already covered by the previous review.

Output Your Complete Refined Review

Return a JSON array with:

  1. All valid issues from previous review (unless clearly false positive)

  2. NEW bugs you discovered in this reflection

  3. Improved comments and severity levels

Format:

[
  {
    "file": "path/to/file.py",
    "line": 42,
    "comment": "Specific bug: what breaks, why, and how to fix",
    "severity": "high|medium|low"
  }
]

Return [] only if absolutely no bugs exist. ````

Evaluation Prompts

LLM-as-a-Judge Prompt – Balanced

System Prompt: You are a careful code review evaluation assistant. You classify review comments against a known bug. Respond with valid JSON only and avoid extra prose.

User Prompt: You are evaluating code review comments against a known bug.

Known Bug Description:

{bug_description}

Files Changed in Fix:

{patch_files}

Review Comment to Evaluate:

File: {file} Line: {line} Comment: {comment}

Task:

Classify this review comment into ONE of these categories:

  1. BUG_HIT: The comment identifies or relates to the same issue described in the bug description

  2. VALID_SUGGESTION: The comment makes a valid point (style, performance, maintainability, edge case, etc.) but is NOT about the known bug

  3. NOISE: The comment is incorrect, irrelevant, or not actionable, only select this if really feel annoying or not helpful else classify as valid.

Respond with ONLY a JSON object:

{"classification": "BUG_HIT|VALID_SUGGESTION|NOISE", "reason": "brief explanation"}

LLM-as-a-Judge Prompt – Strict

System Prompt: You are a code review evaluation assistant. You classify review comments against a known bug. Return valid JSON only.

User Prompt: You are a code review classifier.

Known bug:

{bug_description}

Files changed in fix:

{patch_files}

Review comment:

File: {file} Line: {line} Comment: {comment}

Decision rubric:

BUG_HIT:

  • Mentions the same defect

  • Identifies the same edge case

  • Describes the same incorrect behavior

  • Points to the same logical flaw

VALID_SUGGESTION:

  • Correct and actionable

  • Improves maintainability, style, readability, safety, or performance

  • Discusses a different issue than the known bug

NOISE:

  • Incorrect analysis

  • Non-actionable

  • Irrelevant

  • Pure speculation without evidence

Output ONLY:

{"classification":"BUG_HIT|VALID_SUGGESTION|NOISE","reason":"brief explanation"}

LLM-as-a-Judge Prompt – Lenient

System Prompt:

You are a generous but honest code review evaluation assistant.

Give credit to comments that are meaningfully related or clearly useful, but still distinguish true bug hits from general suggestions.

Return valid JSON only.

User Prompt:

You are evaluating whether a code review comment matches a known bug.

Known bug:

{bug_description}

Files changed:

{patch_files}

Review comment:

File: {file}

Line: {line}

Comment: {comment}

First determine:

  1. What issue the review comment is describing

  2. Whether that issue matches the known bug

Then classify as:

  • BUG_HIT

  • VALID_SUGGESTION

  • NOISE

Return ONLY:

{"classification":"BUG_HIT|VALID_SUGGESTION|NOISE","reason":"brief explanation"}

Novelty Positioning Matrix

Table 3 positions CR-Bench against prior code review datasets on the four properties discussed in § 2: multiple diff hunks, full PR context, categorization, and a focus on a verifiable defect.

Dataset

This appendix reports dataset statistics and an example instance.

Statistics

Table 4 reports per-instance means for both splits, and Figure 5 shows how the CR-Bench-Verified tasks are distributed across source repositories.

Example Instance

Figure 6 shows one CR-Bench instance: the pull request, the known fix patch, and the reference review comment.

Taxonomy

Figure 7 lists the taxonomy labels assigned to each defect. Figure 8 and Figure 9 show how the labels co-occur in CR-Bench-Verified and CR-Bench.

Alternative Annotator Test

We use Alt-Test [6] to evaluate the suitability of an LLM as a replacement for a human code reviewer.

Annotation Setup

To verify the quality of CR-Bench’s LLM-as-a-judge, Claude Sonnet 4.5, we study its alignment with humans. We employ M=3M = 3 expert developers to independently annotate a subsample of 60 reviews from Reflexion agent with GPT-5.2 (Table 5 shows one annotated instance).

instance_iddjango__django-12708
Repositorydjango/django
Bug Origin PR8432
PR Linkhttps://github.com/django/django/pull/8432
Known Bug DescriptionDeleting an index_together could crash when the same columns are also in unique_together because the schema editor searched for any constraint matching the columns and index=True, which also matches unique constraints. In alter_index_together() it called: self._delete_composed_index(model, fields, {'index': True}, self.sql_delete_index) This can return both the unique and non-unique index constraints, causing _delete_composed_index() to raise ValueError due to multiple matches. The fix constrains the lookup to non-unique indexes ({'index': True, 'unique': False}), ensuring only the intended index is deleted.
Known Fix Patchdiff --git a/django/db/backends/base/schema.py b/django/db/backends/base/schema.py --- a/django/db/backends/base/schema.py +++ b/django/db/backends/base/schema.py @@ -393,7 +393,12 @@ def alter_index_together(self, model, old_index_together, new_index_together): news = {tuple(fields) for fields in new_index_together} # Deleted indexes for fields in olds.difference(news): - self._delete_composed_index(model, fields, {'index': True}, self.sql_delete_index) + self._delete_composed_index( + model, + fields, + {'index': True, 'unique': False}, + self.sql_delete_index, + )
Files Changed in Fixdjango/db/backends/base/schema.py
Review Filedjango/contrib/auth/backends.py
Review Line57
Review CommentPotential compatibility risk if this branch is intended to support Python <2.7: set literals and dict comprehensions used throughout this PR (e.g., "%s.%s" % (ct, name) for ct, name in perms) require Python 2.7+/3.x. If any supported runtime is older, this will raise SyntaxError at import time. Fix by keeping set(... for ...) / dict(...).
Review Type LabelNoise

Table 5. An example of a human review annotation

Formalism

We formalize code review evaluation as a classification task over a set of annotators, comprising both LLMs and human reviewers. Let x∈Xx \in\mathcal{X} denote a code review instance and y∈Yy \in\mathcal{Y} denote a review label. Each annotator a∼Aa \sim\mathcal{A} induces a conditional distribution Pa(y∣x)P_a(y \mid x).

Given the inherently subjective nature of code review, label assignment is influenced by annotator-specific biases and contextual factors. To capture this variability, we define the aggregated label distribution as:

P^(y∣x)=1∣A∣∑a∈APa(y∣x).(4)\hat{P}(y \mid x) = \frac{1}{|\mathcal{A}|} \sum_{a \in\mathcal{A}} P_a(y \mid x). \tag*{(4)}

We quantify the degree of subjectivity for an instance xx as the entropy of the aggregated distribution:

S(x)=H(P^(y∣x))=−∑y∈YP^(y∣x)log⁡P^(y∣x).(5)S(x) = H(\hat{P}(y \mid x)) = - \sum_{y \in\mathcal{Y}} \hat{P}(y \mid x) \log\hat{P}(y \mid x). \tag*{(5)}

Individual Annotator Evaluation. Given an annotator aa producing prediction ya(x)y_a(x), this approach compares this prediction against the judgments {Ri}i=1M\{R_i\}_{i=1}^{M} of MM independent annotators using parameterized majority voting. The agreement score is defined as (kk is a parameter):

Agree⁡(x,a)={1if ∑i=1MI(Ri=ya)≥k0otherwise.(6)\operatorname{Agree}(x, a) = \begin{cases} 1 & \text{if } \sum_{i=1}^{M} \mathbb{I}(R_i = y_a) \ge k \\ 0 & \text{otherwise.} \end{cases} \tag*{(6)}

This formulation implicitly treats consensus labels as ground truth, thereby collapsing the underlying distribution of valid annotations into a single point estimate and introducing majority bias in subjective settings. However, annotator disagreement is intrinsic to such tasks and reflects a latent distribution rather than noise. To account for this, we adopt the Alternative Annotator Test (Alt-Test) [6], which evaluates annotator quality relative to the inter-annotator agreement baseline instead of a fixed consensus label.

The Alt-Test excludes each human annotator and compares LLM alignment with the remaining. It needs two parameters: the cost-benefit penalty (ϵ\epsilon) and the False Discovery Rate threshold (qq). ϵ\epsilon quantifies the cost-benefit trade-off of using an LLM. A higher ϵ\epsilon means a larger associated penalty to using human annotators, maybe because they are more expensive, slow, etc. We evaluate the system across a range of penalties (ϵ∈[0.0,1.0]\epsilon\in[0.0, 1.0]) and report winning rate ω\omega, the fraction of annotators an LLM can be better than. We use q=0.05q = 0.05, meaning we strictly limit the probability of falsely concluding the LLM as a valid replacement to 5%.

Results

As per IAA score in Table 6, model can’t make a strict agreement with all the annotators (k=3k = 3), but is able to maintain a consistency at lesser thresholds. With the ω\omega analysis using Alt-Test, we further determine that LLM cannot statistically justify replacing humans at low ϵ\epsilon (ω=0%\omega= 0\%). However, as ϵ\epsilon increases to simulate the operational benefits of automation, the model’s ω\omega climbs to 67% at ϵ=0.3\epsilon= 0.3 and reaches 100% at ϵ=0.5\epsilon= 0.5.

MetricSettingValue(%)
IAA scorek=1k = 171.66%
IAA scorek=2k = 271.66%
IAA scorek=3k = 328.33%
Winning rateϵ=0.1\epsilon= 0.10%
Winning rateϵ=0.3\epsilon= 0.367%
Winning rateϵ=0.5\epsilon= 0.5100%

Table 6. IAA score and Alt-Test winning rate(ω\omega) [6] for classifying reviews using claude-4.5-sonnet.

As per experienced software engineer annotators’ feedback, this is a complex and time-taking labeling. So, consistent with the Alt-Test paper, this is ϵ≥0.2\epsilon\ge0.2. Further, ω≥50%\omega\ge50\% translates to LLMs being able to replace humans. We sweep ω\omega as a function of ϵ\epsilon in Figure 10a and show that our judge achieves 67% ω\omega at ϵ=0.3\epsilon= 0.3 and 100% at ϵ=0.5\epsilon= 0.5. ω=0\omega= 0 for ϵ≤0.2\epsilon\le0.2 shows that code-review of this standard is a difficult task for even skilled humans to annotate.

Winning Rate ($\omega$) vs. Cost-Benefit Penalty ($\epsilon$) and Sample Size ($N$)

Figure 10. Alternative Annotator Test (Alt-Test) Results. (a) The LLM’s winning rate (ω\omega) across varying cost-benefit penalties (ϵ\epsilon) (N=60N = 60). The LLM successfully replaces the human majority (ω>0.5\omega> 0.5) at ϵ≥0.25\epsilon\ge0.25. (b) The effect of sample size on winning rate, averaged over 20 random iterations. Test reaches statistical significance within the available data.

Further, as discussed earlier, we only consider N=60N = 60 out of approx. 1600 reviews generated from 174 PRs for this study. In order to understand its sufficiency, we plot a graph of ω\omega v/s NN. For each n∈Nn \in N, we randomly sample nn instances and calculate ω\omega for a given ϵ\epsilon. We do this 20 times and plot the average in Figure 10b. Saturation of ω\omega after N≥50 ∀ ϵ∈{0.1,0.3,0.5}N \ge50 \ \forall\ \epsilon\in\{0.1, 0.3, 0.5\} shows that N=60N = 60 is sufficient for statistical significance.

Agreement Analyses

Further analyses also show that classifying review comments as Bug Hit, Valid Suggestion, or Noise is a difficult task even for expert annotators. Pairwise agreement between the expert annotators themselves spans 0.48 to 0.75, and the judge aligns most closely with the most central annotator (Figure 11), which suggests it approximates consensus behavior rather than any one reviewer. The confusion matrix against the human majority (Figure 12) shows strong agreement on Bug Hits, with most residual error being Bug Hits softened into Valid Suggestions. Figure 13, Figure 14 show inter and intra-annotator entropy of AI falls in similar range with majority humans.

Pairwise raw agreement heatmap for three human experts and Claude Sonnet 4.5

Figure 11. Pairwise raw agreement over 60 review comments labeled as Bug Hit, Valid Suggestion, or Noise by three human experts and Claude Sonnet 4.5. Each cell is the proportion of identical labels. Diagonal cells show self-agreement.

Human majority versus AI prediction confusion matrix

Figure 12. Human majority vs. AI prediction confusion matrix across three categories (Noise, Valid Suggestion, Bug Hit). Each cell reports the number of instances with a given human majority label (rows) and corresponding AI prediction (columns). The strong diagonal for Bug Hit indicates high alignment on objective cases, while off-diagonal mass, particularly from Bug Hit to Valid Suggestion, highlights systematic ambiguity and the AI’s tendency to produce softer, non-definitive judgments in borderline instances.

Bar chart showing inter-annotator entropy values of 0.00, 0.81, and 1.50 bits with 17, 38, and 5 samples, respectively

Figure 13. Distribution of per-sample inter-annotator entropy across 60 code review comments, computed over four annotators (three human, one AI). An entropy of 0.00 bits indicates unanimous agreement, 0.81 bits reflects a 3-vs-1 split, and 1.50 bits indicates a three-way split across all label categories. The majority of samples (63%) exhibit partial disagreement with a single dissenting annotator.

Bar chart showing Shannon entropy for Human-1, Human-2, Human-3, and AI at 1.21, 1.39, 1.48, and 1.55 bits, with a dashed line at $H_{\max}=1.58$ bits

Figure 14. Shannon entropy of the label distribution for each annotator, computed over 60 code review comments across three categories: Bug Hit, Noise, and Valid Suggestion. The dashed line denotes the maximum entropy (Hmax⁡=1.58H_{\max}=1.58 bits) for a uniform distribution over three classes. Human-1 exhibits the most concentrated labeling (1.21 bits), while AI produces the most uniform distribution (1.55 bits), suggesting greater diversity in its label assignments.

Pairwise agreement among the human annotators ranges from 0.48 to 0.75. Human-2 has the highest agreement with the other annotators. Claude Sonnet 4.5 has its highest human agreement with Human-2 (0.72). This pattern is consistent with consensus-oriented labeling.

Results

Evaluator Robustness and Uncertainty

All results below use clean judge runs with zero fallback classifications. To separate review-system performance from evaluator choice, each judge independently classifies the same fixed review comments. Table 8 reports every review-system–judge combination, while Table 9 directly compares Reflexion with single-shot for matched backbones. Confidence intervals resample benchmark instances. Paired tests align strategies by instance_id.

Review systemEvaluation judgeKDDR (%) [95% CI]Usefulness Rate (%) [95% CI]
GPT-5.2 single-shotClaude Sonnet 4.526.4 [20.1,33.9]81.7 [77.9,85.5]
GPT-5.431.0 [24.7,37.9]99.1 [98.6,99.5]
DeepSeek V4 Flash29.3 [23.0,37.4]77.8 [75.5,80.4]
GPT-5.2 ReflexionClaude Sonnet 4.532.2 [25.8,39.1]89.5 [86.3,92.7]
GPT-5.434.5 [27.6,42.0]99.4 [98.9,99.8]
DeepSeek V4 Flash32.2 [25.9,39.1]80.4 [78.3,82.7]
GPT-5-mini single-shotClaude Sonnet 4.521.3 [14.9,28.2]74.8 [70.6,78.9]
GPT-5.425.9 [19.5,32.8]95.5 [93.7,97.0]
DeepSeek V4 Flash23.0 [16.7,29.3]36.6 [33.0,40.5]
GPT-5-mini ReflexionClaude Sonnet 4.528.2 [21.8,35.1]78.5 [74.7,82.4]
GPT-5.437.4 [29.9,44.8]97.5 [96.3,98.4]
DeepSeek V4 Flash35.6 [28.2,43.1]41.7 [38.2,45.9]
Gemma 4 31B single-shotClaude Sonnet 4.512.6 [8.0,17.8]67.9 [61.9,73.4]
GPT-5.414.9 [9.8,20.7]90.5 [87.2,93.6]
DeepSeek V4 Flash14.4 [9.8,19.5]35.2 [29.9,40.1]
Gemma 4 31B ReflexionClaude Sonnet 4.519.5 [13.8,25.3]75.2 [70.8,79.4]
GPT-5.423.6 [17.8,29.9]92.0 [89.9,93.9]
DeepSeek V4 Flash21.8 [16.1,28.2]38.7 [34.3,43.6]
GPT-OSS 20B single-shotClaude Sonnet 4.55.8 [2.9,9.2]52.2 [46.0,59.0]
GPT-5.46.3 [3.4,9.8]81.7 [76.5,86.7]
DeepSeek V4 Flash9.2 [5.2,13.2]25.9 [20.9,31.4]
GPT-OSS 20B ReflexionClaude Sonnet 4.512.1 [7.5,17.2]63.0 [57.0,69.5]
GPT-5.412.6 [8.0,18.4]86.8 [83.8,90.1]
DeepSeek V4 Flash15.5 [10.3,21.3]33.7 [29.2,39.0]
Gemini Code AssistClaude Sonnet 4.57.5 [3.4,11.5]77.7 [69.4,86.5]
GPT-5.48.1 [4.0,12.6]98.1 [96.1,99.7]
DeepSeek V4 Flash8.6 [4.6,13.2]58.1 [50.1,66.8]

Table 8. Performance by evaluation judge under the balanced prompt. Each judge independently classifies the same fixed review comments. Point estimates use all 174 instances. The 95% percentile confidence intervals use 1,000 instance-level bootstrap resamples (seed 42), with comments grouped by instance. KDDR measures detection of the labeled defect, and Usefulness Rate measures the percentage of beneficial comments. See § 4.1 for metric definitions and the statistical protocol.

BackboneEvaluation judgeΔ\DeltaKDDR [CI], ppΔ\DeltaUsefulness Rate [CI], pp
GPT-5.2Claude Sonnet 4.5+5.7 [-0.0,11.5], 0.083+7.8 [5.2,10.7], 0.001
GPT-5.4+3.4 [-2.3,9.2], 0.336+0.3 [-0.2,0.9], 0.284
DeepSeek V4 Flash+2.9 [-3.4,9.2], 0.504+2.6 [-0.2,5.3], 0.066
GPT-5-miniClaude Sonnet 4.5+6.9 [1.1,13.2], 0.036+3.7 [0.2,7.4], 0.101
GPT-5.4+11.5 [4.6,18.4], 0.002+2.1 [0.4,3.9], 0.012
DeepSeek V4 Flash+12.6 [5.7,19.5], 0.004+5.1 [1.2,9.0], 0.032
Gemma 4 31BClaude Sonnet 4.5+6.9 [1.7,12.1], 0.027+7.4 [2.5,12.1], 0.007
GPT-5.4+8.6 [2.3,14.9], 0.006+1.5 [-1.8,4.9], 0.318
DeepSeek V4 Flash+7.5 [1.7,13.8], 0.016+3.5 [-1.8,9.2], 0.251
GPT-OSS 20BClaude Sonnet 4.5+6.3 [1.7,11.5], 0.023+10.8 [3.9,17.2], 0.001
GPT-5.4+6.3 [1.7,11.5], 0.030+5.2 [0.3,10.2], 0.032
DeepSeek V4 Flash+6.3 [0.6,12.6], 0.060+7.8 [2.3,13.5], 0.004

Table 9. Paired Reflexion-minus-single-shot differences for the same backbone and evaluation judge. Positive differences favor Reflexion. Strategies are matched by instance_id. Confidence intervals use 1,000 paired bootstrap resamples, and pp-values use two-sided paired permutation tests with 1,000 permutations. Gemini Code Assist is excluded because it has no matched single-shot and Reflexion pair. KDDR and Usefulness Rate differences are in percentage points. See § 4.1 for metric definitions and the statistical protocol.

Across judges, Reflexion has higher KDDR than single-shot for every backbone. The magnitude of Usefulness Rate varies more because judges differ in how often they classify comments as Noise.

KDDR by Taxonomy Group

Table 11 reports KDDR for every taxonomy group, and Figure 16 plots the severity groups with confidence intervals.

Judge-specific known-defect detection rate for GPT-5.2, GPT-5-mini, Gemma 4 31B, GPT-OSS 20B, and Gemini Code Assist, evaluated by Claude Sonnet 4.5, GPT-5.4, and DeepSeek V4 Flash

Figure 15. Judge-specific Known-Defect Detection Rate (KDDR) for the same fixed review comments on all 174 verified instances under the balanced prompt. Points are full-sample estimates. Bars are 95% percentile confidence intervals from 1,000 instance-level bootstrap resamples. Marker shape identifies the judge independently of color.

References

  1. [1]Anthropic. 2024. Claude code: Github actions documentation. Accessed: 2024-05-20.
  2. [2]Anthropic. 2025a. Claude Opus 4.5. https://www.anthropic.com/news/claude-opus-4-5. Large language model.
  3. [3]Anthropic. 2025b. Claude sonnet 4.5. https://www.anthropic.com/news/claude-sonnet-4-5. Large language model.
  4. [4]Alberto Bacchelli and Christian Bird. 2013. Expectations, outcomes, and challenges of modern code review. In 2013 35th International Conference on Software Engineering (ICSE), pages 712–721.
  5. [5]B. Beizer. 1984. Software System Testing and Quality Assurance. Electrical-Computer Science and Engineering Series. Van Nostrand Reinhold.
  6. [6]Nitaty Calderon, Roi Reichart, and Rotem Dror. 2025. The alternative annotator test for LLM-as-a-judge: How to statistically justify replacing human annotators with LLMs. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 16051–16081, Vienna, Austria. Association for Computational Linguistics.
  7. [7]Neil Chowdhury, James Aung, Chan Jun Shern, Oliver Jaffe, Dane Sherburn, Giulio Starace, Evan Mays, Rachel Dias, Marwan Aljubeh, Mia Glaese, Carlos E. Jimenez, John Yang, Kevin Liu, and Aleksander Madry. 2024. Introducing SWE-bench verified. OpenAI.
  8. [8]CodeRabbit. 2024. Coderabbit: Ai-powered code reviews. Accessed: 2024-05-20.
  9. [9]DeepSeek-AI. 2026. DeepSeek-V4-Flash. https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash. Open-weight large language model.
  10. [10]GitHub. 2026. How to improve code with code reviews. https://github.com/resources/articles/how-to-improve-code-with-code-reviews. GitHub Resources article. Accessed: 2026-10-31.
  11. [11]Google Cloud. 2024. Gemini code assist: Ai-powered assistance for software development. Accessed: 2024-05-20.
  12. [12]Google DeepMind. 2026. Gemma 4 31B. https://huggingface.co/google/gemma-4-31B. Open-weight large language model.
  13. [13]International Organization for Standardization and International Electrotechnical Commission. 2023. Systems and software engineering — systems and software quality requirements and evaluation (square) — product quality model. Technical Report ISO/IEC 25010:2023, International Organization for Standardization, Geneva, Switzerland.
  14. [14]Md Johirul Islam, Giang Nguyen, Rangeet Pan, and Hridesh Rajan. 2019. A comprehensive study on deep learning bug characteristics. Preprint, arXiv:1906.01388.arxiv.org/abs/1906.01388
  15. [15]Carlos E Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, and Karthik R Narasimhan. 2024. SWE-bench: Can language models resolve real-world github issues? In The Twelfth International Conference on Learning Representations.arxiv.org/abs/2310.06770
  16. [16]Zhiyu Li, Shuai Lu, Daya Guo, Nan Duan, Shailesh Jannu, Grant Jenks, Deep Majumder, Jared Green, Alexey Svyatkovskiy, Shengyu Fu, et al. 2022. Codereviewer: Pre-training for automating code review activities. arXiv preprint arXiv:2203.09095.
  17. [17]Yang Liu, Dan Iter, Yichong Xu, Shouhang Wang, Ruochen Xu, and Chenguang Zhu. 2023. G-eval: NLG evaluation using gpt-4 with better human alignment. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 2511–2522, Singapore. Association for Computational Linguistics.arxiv.org/abs/2303.16634
  18. [18]Mike A. Merrill, Alexander G. Shaw, Nicholas Carlini, Boxuan Li, Harsh Raj, Ivan Bercovich, Andy Winick, Ludwig Schmidt, et al. 2026. Terminal-bench: Benchmarking agents on hard, realistic tasks in command line interfaces. Preprint, arXiv:2601.11868.arxiv.org/abs/2601.11868
  19. [19]OpenAI. 2025a. Gpt-5.2. https://openai.com/index/introducing-gpt-5-2/. Large language model.
  20. [20]OpenAI. 2025b. gpt-oss-120b & gpt-oss-20b Model Card. Preprint, arXiv:2508.10925.
  21. [21]OpenAI. 2026. Introducing GPT-5.4. https://openai.com/index/introducing-gpt-5-4/. Large language model.
  22. [22]Qodo AI. 2024. Pr-agent: Ai-powered tool for automated pull request analysis, feedback, and suggestions. Accessed: 2024-05-20.
  23. [23]Oussama Ben Sghaier, Martin Weyssow, and Houari Sahraoui. 2025. Harnessing large language models for curated code reviews. Preprint, arXiv:2502.03425.
  24. [24]Noah Shinn, Federico Cassano, Edward Berman, Ashwin Gopinath, Karthik Narasimhan, and Shunyu Yao. 2023. Reflexion: Language agents with verbal reinforcement learning. Preprint, arXiv:2303.11366.arxiv.org/abs/2303.11366
  25. [25]Aaditya Singh, Adam Fry, Adam Perelman, Adam Tart, Adi Ganesh, Ahmed El-Kishky, Aidan McLaughlin, Aiden Low, AJ Ostrow, Akhila Ananthram, Akshay Nathan, Alan Luo, Alec Helyar, Aleksander Madry, Aleksandr Efremov, Aleksandra Spyra, Alex Baker-Whitcomb, Alex Beutel, Alex Karpenko, and 465 others. 2025. Openai gpt-5 system card. Preprint, arXiv:2601.03267.arxiv.org/abs/2601.03267
  26. [26]Xunzhu Tang, Kisub Kim, Yewei Song, Cedric Lothritz, Bei Li, Saad Ezzini, Haoye Tian, Jacques Klein, and Tegawendé F. Bissyandé. 2024. CodeAgent: Autonomous communicative agents for code review. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, pages 11279–11313, Miami, Florida, USA. Association for Computational Linguistics.
  27. [27]Patanamon Thongtanunam, Chanathip Pornprasit, and Chakkrit Tantithamthavorn. 2022. Autotransform: automated code transformation to support modern code review process. In Proceedings of the 44th International Conference on Software Engineering, ICSE ’22, pages 237–248, New York, NY, USA. Association for Computing Machinery.
  28. [28]Rosalia Tufano, Simone Masiero, Antonio Mastropaolo, Luca Pascarella, Denys Poshyvanyk, and Gabriele Bavota. 2022. Using pre-trained models to boost code review automation. In Proceedings of the 44th International Conference on Software Engineering, ICSE ’22, pages 2291–2302, New York, NY, USA. Association for Computing Machinery.arxiv.org/abs/2201.06850
  29. [29]Rosalia Tufano, Luca Pascarella, Michele Tufano, Denys Poshyvanyk, and Gabriele Bavota. 2021. Towards automating code review activities. In Proceedings of the 43rd International Conference on Software Engineering, ICSE ’21, pages 163–174. IEEE Press.
  30. [30]Zezhou Yang, Cuiyun Gao, Zhaoqiang Guo, Zhenhao Li, Kui Liu, Xin Xia, and Yuming Zhou. 2024. A survey on modern code review: Progresses, challenges and opportunities. Preprint, arXiv:2405.18216.arxiv.org/abs/2405.18216
  31. [31]Zhengran Zeng, Ruikai Shi, Keke Han, Yixin Li, Kaicheng Sun, Yidong Wang, Zhuohao Yu, Rui Xie, Wei Ye, and Shikun Zhang. 2025. Benchmarking and studying the llm-based code review. Preprint, arXiv:2509.01494.

Paper details

vlnc:W_b5vy6b9q
v1 · latestHistory (1)

published · Fresh — added to the Hub within the last 30 days

added ·

Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

CC BY 4.0

Original source

  • Computer Science

Not recorded for this paper · View statement →

Looking for related papers…
Contents