atlas

Research map / Large language models / Language, safety and interpretability

Towards Practical Defect-Focused Automated Code Review

ICML 2025 · Large language models › Language, safety and interpretability · approach: Controlled text generation

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Builds a repository-aware, merge-request-level automated code review pipeline (code slicing, multi-role LLM reviewers with filtering, inline line localization) evaluated on historical C++ fault-inducing merge requests at an industrial recommendation service.

Problem

Automated code review is usually framed as snippet-level code-to-text generation scored by BLEU-like metrics, which ignores repository context, merge-request-level evaluation, and defect detection.

Approach

Combines AST-based code slicing for repository context, a multi-role LLM system (Reviewer, Meta-Reviewer, Validator, Translator) with CoT prompts, a Q1-Q3 scoring comment filter against nitpicks/hallucinations, and inline line-number prompt formatting, evaluated with defect-oriented MR-level metrics (KBI, FAR, CPI, LSR).

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
replace Original Diff slicing with Left Flow slicing (ablation)LLaMA3.1-405B-AWQ-Int4 single reviewer, all comments · Fault merge requestsKBI: 23.70 -> 37.04Helped
use Full Flow instead of Left Flow slicing (ablation)LLaMA3.1-405B-AWQ-Int4 single reviewer, all comments · Fault merge requestsKBI: 37.04 -> 39.26No clear effect
add a Validator (ablation)Left Flow, three-reviewer workflow · Fault merge requestsCPI_1: 17.51 -> 22.07Helped
add a Validator (ablation)Left Flow, three-reviewer workflow · Fault merge requestsKBI: 31.11 -> 20.00Hurt
increase reviewer count from one to three (ablation)Left Flow, +Meta Reviewer · Fault merge requestsKBI: 26.67 -> 31.11Helped
increase reviewer count from one to three (ablation)Left Flow, +Meta Reviewer · Fault merge requestsCPI_1: 20.57 -> 17.51Hurt
add chain-of-thought prompting (ablation)Left Flow, single reviewer, Top-5 · Fault merge requestsCPI_1: 11.10 -> 14.26Helped
add chain-of-thought prompting (ablation)Original Diff, single reviewer, Top-5 · Fault merge requestsCPI_1: 13.05 -> 12.48Hurt
apply coarse filtering (ablation)Left Flow, single reviewer · Fault merge requestsCPI_1: 9.77 -> 12.80Helped
apply Top-5 truncation instead of keeping all comments (ablation)Left Flow, single reviewer · Fault merge requestsCPI_1: 9.77 -> 14.26Helped
provide inline line numbers instead of no line-position information (ablation)three-reviewer workflow with Meta Reviewer · Fault merge requestsCPI_1: 12.21 -> 17.51Helped
provide relative line positions instead of no line-position information (ablation)all-comments setting · Fault merge requestsKBI: 30.37 -> 42.96Helped

Surprising findings

Limitations

Experimental setup

Datasets: historical fault reports and fix merge requests from company (C++ short-video recommendation codebases)

Benchmarks: internal fault merge request dataset

Metrics: key bug inclusion (KBI) false alarm rate (FAR) comprehensive performance index (CPI) line localization success rate (LSR)

Baselines: CodeReviewer CCT5 LLaMA-Reviewer DISCOREV

Builds on: Aider CodeReviewer

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy