ZICQ
中 Log in / Sign up
Newsroom Paper Frontier Research #Coding Agents #Code Review #Verified Trajectories #Qwen3.5 #Model Post-training

LegoReview Builds Verifiable Code-Review Training Data from Pull Request Histories

Avatar of Mr.Xu

By Mr.Xu Compiled & Reviewed by Editorial

Published: · 2 views

中文阅读 (Chinese) English Version
Co-reading Select any sentence in the article to highlight, annotate, or copy a quote card. Join discussion ↓

Summary:The LegoReview authors extract an implicit verification signal from 556,000 merged GitHub pull requests. By reconstructing reviewed code snapshots and aligning review discussions with later revisions, acceptances, withdrawals, and rejections, the pipeline produces 168,000 review tasks and 60,000 verified training trajectories across eight programming languages and eight finding categories. Fine-tuning Alibaba's Qwen3.5-35B-A3B-Base with only 1,000 verified trajectories raises the reported LegoR


LegoReview does not introduce a new MoE or attention block. It targets the hardest scaling problem in code-review supervision: review findings are natural-language statements, so unit tests cannot directly determine whether a comment such as “this pointer may be null” or “this boundary check is missing” is correct. The paper treats GitHub pull-request history as an implicit verifier, deriving supervision from maintainers’ acceptance, fixes, withdrawals, or rejections and from the code revisions that follow a review.

Core mechanism: turning repository history into a weak verifier

The pipeline has four main stages:

  1. Reconstruct the reviewed state: Commit relationships from merged PRs are used to identify the reviewed version, patched version, and subsequent revisions, preventing a model from reviewing a mismatched snapshot.
  2. Align comments with later actions: A finding followed by an accepted fix is more likely to be actionable, while a withdrawn or rejected finding provides a negative signal. According to the abstract, negative examples primarily come from abandoned comments inside merged PRs rather than from wholly rejected PRs.
  3. Build review tasks and verified trajectories: The 168,000 tasks describe what should be found in a given code state, while the 60,000 trajectories retain review processes whose behavior can be checked against subsequent repository actions. The exact task schema, conflict handling, and matching rules are not disclosed in the abstract.
  4. Fine-tune a code model: The experiments use Alibaba’s Qwen3.5-35B-A3B-Base to measure review performance and transfer to coding tasks. The LegoReview authors are responsible for the method and experiments; Qwen serves as the experimental base model.

At an engineering level, the label for a finding can be abstracted as label_i = f(action_i, revision_delta_i, discussion_i). The action represents acceptance, repair, withdrawal, or rejection; the revision delta captures changes after the review; and the discussion supplies additional context. The central idea is to replace some manual judgment with weak supervision derived from repository behavior, but the abstract does not disclose the exact implementation of f, confidence weighting, or policies for conflicting labels.

Dataset and headline results

The authors start with 556,000 merged PRs and produce 168,000 review tasks and 60,000 verified trajectories. The data spans eight programming languages and eight categories of findings, including correctness, maintainability, and design.

| Training scale | LegoReview-Bench F1 | |---|---:| | Reported starting baseline | 5.7 | | 1,000 verified trajectories | 43.1 | | 60,000 verified trajectories | 56.1 |

Just 1,000 trajectories add 37.4 F1 points over the reported starting point. Expanding the data by roughly 60 times produces another 13.0 points, indicating that filtering quality may matter more than raw volume and that returns diminish quickly. Two points are not enough to infer a scaling law.

Review training also transfers to feature implementation and issue resolution:

| Training regime | DeepSWE | SWE-bench Pro V2 Hard | |---|---:|---:| | Coding trajectories only | 26.5 | 62.8 | | Joint coding and review trajectories | 31.9 | 70.6 |

Behavioral analysis suggests that the jointly trained model checks code more frequently while implementing changes and is better at recognizing and revising incorrect patches. The result indicates that review data may train more than a standalone comment classifier: it can encourage an internal generate-check-revise loop.

Engineering trade-offs

Repository reconstruction is expensive. Unlike ordinary text corpora, rebuilding PR snapshots requires handling Git objects, commit graphs, rebases, squash merges, and follow-up revisions. Cloning repositories, computing diffs, and aligning historical states can cost far more than tokenizing the associated text. The abstract provides no storage footprint, processing throughput, API-rate policy, or dataset-construction time.

Weak labels are not ground truth. A maintainer may accept a comment because its general direction is useful even when its location or severity is wrong. A comment may also be rejected because of development priorities, style, or effort rather than a faulty judgment. Combining discussions, revision diffs, and subsequent actions reduces noise, but does not replace rigorous human auditing.

Training cost does not scale linearly with data. The strong result from 1,000 trajectories suggests that high-quality filtering can be more valuable than indiscriminate collection. Fine-tuning a 35B-class base model still requires different cost strategies, such as ZeRO, FSDP, expert parallelism, or LoRA. The abstract does not state the training method, GPU count, duration, or checkpoint memory. The A3B designation generally indicates roughly 3B active parameters, but the exact architecture should be confirmed from the model card and paper.

Transfer gains do not prove review correctness. Improvements on DeepSWE and SWE-bench Pro V2 Hard show that review training does not undermine coding and may improve patch inspection. That is still indirect evidence. Production value requires measurements of missed defects, false positives, accepted comments, escaped regressions, and human-review cost.

Benchmark caveats

LegoReview-Bench is proposed by the same team, and its data-generation logic resembles the training-data pipeline. Strict repository-level separation, temporal splitting, duplicate-PR removal, and contamination checks are therefore essential. If adjacent commits, forks, or near-identical defect templates cross the split, F1 can be inflated.

The abstract also leaves unresolved how free-text findings are aligned with reference comments. Exact matching, semantic matching, and LLM judging can yield very different precision and recall, making the matcher itself a key reproducibility target. Baseline settings, random seeds, confidence intervals, data licensing, training code, and evaluation code are not disclosed. The reported 56.1 F1 should therefore not yet be treated as a stable, model-general capability.

Deployment guidance

  1. Apply data governance first. Use public repositories with explicit licensing, remove secrets and personal information, and record GitHub terms, source-PR licenses, and derived-data licenses. Publicly accessible does not automatically mean cleared for training or redistribution.
  2. Split by both repository and time. Keep adjacent PRs, copied branches, and similar patches on the same side of the split, and evaluate on a later time window to block template memorization and future-data leakage.
  3. Reproduce the small, high-quality baseline first. Compare 1,000 high-confidence trajectories with random-sample and unfiltered baselines before scaling up. LoRA is a reasonable cost-reduction experiment, but it is not reported by the paper and must not be presented as a paper result.
  4. Evaluate review and coding separately. Track review precision, recall, severe-defect coverage, comment acceptance, false-positive rate, patch rework, coding success, and cost per token rather than relying on F1 alone.
  5. Keep a human gate in production. The system is better suited to proposing findings, explaining patch risks, and triggering secondary checks than to rejecting or merging PRs automatically. Any feedback loop should distinguish model findings, maintainer acceptance, and defects that were actually fixed.

LegoReview’s main contribution is a scalable supervision pipeline for code-review learning: it uses real code revisions as verification instead of requiring every natural-language finding to pass an executable test. The large gain from only 1,000 trajectories and the reported transfer to coding tasks make the work worth reproducing. However, the custom benchmark, noisy weak supervision, and missing reproducibility details mean it should currently be viewed as a promising data and post-training method rather than a fully validated general-purpose code-review model.


Source: Hugging Face Daily Papers (2026-12-01)

— END —

Tags: #Coding Agents #Code Review #Verified Trajectories #Qwen3.5 #Model Post-training

Editorial & Fact-Checking Note: This article is compiled from primary research, official release documentation, and source papers by the ZICQ Newsroom pipeline with automated entity verification and human editorial review. If you notice any technical inaccuracy, please submit a correction via our corrections policy or email our editorial desk directly.

What's your take on this story?
Explore & Submit Works

Community Comments

Loading live comments and annotations…