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 and 5 others
NTU · Huawei Technologies · HKU
Published December 1, 2026 · on the feed December 2, 2026 · ▲ 20 · arXiv 2612.00862
The 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.
The Brief
2:34A short podcast summary of the paper. Written and voiced by AI.
Transcript
LegoReview. Scaling Code Review Data with Verification from Pull Request Histories. By Ruoyu Wang and twelve others, from Nanyang Technological University, Huawei Technologies, and one other institution. Published on the first of December.
As coding agents write more and more software, automated code review becomes more necessary. Training a capable reviewer means scaling up two things: tasks whose answers can be verified, and trajectories that have been verified. Code review makes that hard. Its output is a set of open-ended findings in natural language, and whether a finding is correct cannot be settled just by running tests. LegoReview is a pipeline, and the dataset it produces, built to get around that obstacle.
From five hundred and fifty-six thousand merged pull requests, LegoReview builds one hundred and sixty-eight thousand review tasks. Alongside those come sixty thousand verified trajectories. The data span eight programming languages, and eight categories of finding, such as correctness, maintainability, and design. The authors also propose an evaluation set, LegoReview-Bench.
The key observation is that pull request histories already contain a verification signal, only an implicit one. Discussions, code revisions and other actions reveal which review findings were accepted or fixed, and which were withdrawn or rejected. The pipeline reconstructs the code snapshots that were actually reviewed, and then uses the surrounding discussions and revisions in two ways: to construct review tasks that can be verified, and to verify the training trajectories.
The intended users are those training code reviewers, and the results suggest coding agents generally. Fine-tuning Qwen3.5-35B-A3B-Base on just one thousand verified trajectories raises its F1 score on LegoReview-Bench from five point seven to forty-three point one. Scaling to the full sixty thousand raises it further, to fifty-six point one.
The benefit carries over to coding itself, including feature implementation and issue resolution. Against training on coding alone, joint training with review trajectories raises the score on DeepSWE from twenty-six point five to thirty-one point nine. On SWE-bench Pro V2 Hard, it rises from sixty-two point eight to seventy point six. A behavioral analysis suggests why: review training encourages the model to check its code more often during implementation, and improves how it recognizes and revises incorrect patches.
The resource rests on a simple reframing. Code review looked unverifiable because its findings are prose, but the history of a merged pull request records what happened to each finding afterwards. Read that way, the ordinary traces of collaborative development become a large source of checked supervision, useful both for reviewing code and for writing it.
More with an account
Listen to every day’s papers
Daily playlists, deep dives, quests for the papers, and quizzes on their key terms.
Join free