LegoReview: Scaling Code Review Data with Verification from Pull Request Histories
Ruoyu Wang, Jierun Chen, Yuxin Jiang, Chaofan Tao, Shaowei Wang, Sidi Yang, Conghao Xiong, Yiming Du, Tiezheng Yu, Kim-Hui Yap, Lifeng Shang, Xiao-Hui Li, Haoli Bai
Abstract
As coding agents write a growing share of software, automated code review becomes increasingly necessary. Training capable reviewers calls for scaling verifiable tasks and verified trajectories. However, code review produces open-ended, natural-language findings whose correctness cannot be verified simply by running tests. We observe that pull request (PR) histories provide an implicit verification signal: discussions, code revisions, and other actions reveal which findings were accepted or fixed and which were withdrawn or rejected. Therefore, we introduce LegoReview, a pipeline that reconstructs reviewed code snapshots from merged GitHub PRs and uses their discussions and revisions to construct verifiable review tasks and verify training trajectories. From 556k merged PRs, we build 168k review tasks and 60k verified trajectories, spanning eight programming languages and eight finding categories such as correctness, maintainability, and design. Fine-tuning Qwen3.5-35B-A3B-Base on just 1k verified trajectories raises F1 score from 5.7 to 43.1 on our proposed LegoReview-Bench, and scaling to 60k raises it further to 56.1. Further, the benefits of review training extend to coding tasks like feature implementation and issue resolution: compared to coding-only training, joint training with review trajectories raises scores from 26.5 to 31.9 on DeepSWE and from 62.8 to 70.6 on SWE-bench Pro V2 Hard. Behavioral analysis suggests that review training encourages more frequent code checks during implementation and improves the recognition and revision of incorrect patches.
Create a lesson
Related papers
ReleaseSynth: Scaling Data from Software Evolution for Long-Horizon Coding Agents
Shared title terminologycs.SEMan Ho Lam, Chaozheng Wang, Zongjie Li et al.
Software Engineering After Human Comprehension? Review the Checks Instead of Code
Shared title terminologycs.SEChristoph Treude
FineCR: A Fine-Grained Benchmark for Evaluating LLMs on Raising Code Review and its Resolution
Shared title terminologycs.SETaufiqul Islam Khan, Shaowei Wang, Haoxiang Zhang et al.
Information Needs in Code Review: What Can an Agent's Trajectory Answer?
Shared title terminologycs.SEHannah Estes, Saba Khanmohammadi, Amirali Rayegan et al.
What Do Explanations and Fixes Add to LLM Code Review? A Replication on Audited Benchmarks
Shared title terminologycs.SESabry E. Farrag
Which Link Should I Look At First?: Automated Link Ranking in Code Reviews
Shared title terminologycs.SEPanya Trakoolgerntong, Arus Thienmee, Patsathorn Chadbantern et al.