A code review comment cannot usually be validated as easily as a test: running the program may not tell us whether a natural-language finding is right. As coding agents take on more development work, this makes it harder to assemble large training sets with credible labels for review. LegoReview proposes using the subsequent history of a GitHub pull request (PR) as evidence: did the team accept a finding, make a related fix, withdraw it, or explicitly reject it?
Turning PR histories into training data
The authors reconstruct review-time code snapshots from 556,000 merged PRs, then use discussions and later revisions to assemble 168,000 review tasks and 60,000 verified trajectories. The data covers eight programming languages and eight finding categories, including correctness, maintainability, and design. The release includes a task dataset, a trajectory dataset, and LegoReview-Bench, with examples involving both defective and clean code changes.
The labeling scheme does not treat a merged PR as proof that a finding was right or wrong. In an author reply, the team describes follow-up fixes or explicit acceptance as supporting evidence. A reviewer’s withdrawal or an explicit rejection by an author or maintainer counts as opposing evidence. When evidence is missing or conflicts, the finding is marked uncertain. Among 558,184 reference findings in the defect tasks, 78.2% were supported, 7.4% opposed, and 14.4% uncertain. That distinction matters: an unaddressed comment is not automatically an incorrect one.
Review training and coding performance
On LegoReview-Bench, fine-tuning Qwen3.5-35B-A3B-Base with 1,000 verified trajectories raises F1 from 5.7 to 43.1. Scaling the training set to 60,000 trajectories brings the score to 56.1. The project also reports a 90.9% Clean Rate for its released model, compared with an F1 of 24.4 for Qwen3.5-35B-A3B. These results suggest that both the quantity and the verification of review examples may matter, though benchmark scores alone cannot establish performance in every engineering setting.
The reported gains extend beyond review. Compared with coding-only training, joint training with review trajectories increases scores from 26.5 to 31.9 on DeepSWE and from 62.8 to 70.6 on SWE-bench Pro V2 Hard. Adding self-review and revision raises the reported scores further, to 34.5 and 74.5 respectively. This offers evidence for training systems to inspect their work as well as produce it.
Why it matters—and what it cannot prove
LegoReview’s contribution is a data-engineering approach: software collaboration records can help create review examples at a scale that would be difficult to label entirely by hand. The datasets, model, and code are released for further study. But PR histories capture what a team did, not an infallible account of what was true. Teams may overlook valid findings, and discussion can be ambiguous. The uncertain category helps represent that limitation, but does not eliminate it. LegoReview is a promising route to more verifiable review training, not a final solution to judging code review correctness.
Comments
Checking sign-in status...
Loading comments...