ReproAgent: Contract-Guided Paper-to-Code Reproduction
Organizations: Beihang University · Shanghai Jiao Tong University · Peking University · Minzu University of China · Zhongguancun Academy · Beijing Key Laboratory of Data Intelligence and Security (Peking University)
Abstract
Paper-to-code reproduction asks scientific AI agents to turn research papers into executable repositories that preserve the paper's method, protocol and artifacts. This is difficult because the specification is split: explicit paper content such as algorithms, metrics and artifacts is often lost across long agent trajectories, while implicit details such as framework defaults and conventions inherited from related work are absent from the paper. We introduce ReproAgent, a four-stage Prepare--Plan--Generate--Repair pipeline built around a persistent implementation contract with two channels: an implementation-requirement channel that turns paper snippets into code obligations, and a reference-evidence channel that retrieves content and structure evidence from related repositories. Both are bound to work packages, projected into file-level contracts, and consumed across generation and repair. On PaperBench Code-Dev, ReproAgent reaches the highest mean score among same-backbone scaffolds under both Claude-Sonnet-4.5 and Gemini-3-Flash. End-to-end channel ablations and per-paper cases support the contribution of both channels. Code and experimental artifacts are publicly available.
Figures & tables
| Paper | BasicAgent | IterAgent | DeepCode | ReproAgent (ours) |
|---|---|---|---|---|
| Adaptive Pruning | 16.6 | 22.4 5.8 | 54.4 37.8 | 67.8 51.2 |
| All in One | 24.8 | 11.5 13.3 | 75.9 51.1 | 76.9 52.1 |
| BAM | 25.2 | 18.7 6.5 | 74.8 49.6 | 61.8 36.6 |
| BBOX | 10.7 | 15.2 4.5 | 64.4 53.7 | 86.4 75.7 |
| Bridging Data Gaps | 15.8 | 8.1 7.7 | 58.1 42.3 | 66.0 50.2 |
| FRE | 22.7 | 17.5 5.2 | 81.4 58.7 | 76.8 54.1 |
| Paper | BasicAgent | IterAgent | AiScientist | ReproAgent (ours) |
|---|---|---|---|---|
| Adaptive Pruning | 24.5 | 3.0 21.5 | 27.2 2.7 | 41.9 17.4 |
| All in One | 20.9 | 45.1 24.2 | 46.3 25.4 | 51.6 30.7 |
| BAM | 48.5 | 45.0 3.5 | 56.6 8.1 | 48.5 |
| BBOX | 15.4 | 8.3 7.1 | 33.8 18.4 | 15.6 0.2 |
| Bridging Data Gaps | 12.6 | 12.4 0.2 | 23.1 10.5 | 50.6 38.0 |
| FRE | 21.7 | 23.9 2.2 | 35.2 13.5 | 26.9 5.2 |
| Setting | Mean | Median | |
|---|---|---|---|
| Full contract | 39.7 | 41.8 | — |
| Reference evidence | 21.6 | 21.4 | 18.1 |
| Implementation requirements | 25.6 | 24.6 | 14.1 |
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Method | Backbone / setting | Reported score |
| BasicAgent ( Starace et al., 2025 ) a | Gemini-2.0-Flash | 5.0 |
| o3-mini | 5.1 | |
| GPT-4o | 7.7 | |
| o1 | 19.5 | |
| Claude-3.5-Sonnet | 35.4 | |
| IterativeAgent ( Starace et al., 2025 ) a | o3-mini | 16.4 |
| Paper | Full | w/o impl. | w/o ref. | Case role |
|---|---|---|---|---|
| Sample-specific Masks | 53.8 | 21.3 | 28.0 | Clear two-channel benefit: the full run preserves SMM-specific optimization, mask generation, interpolation, baselines, and ablations. |
| BAM | 48.5 | 30.8 | 20.7 | Large positive case: both removed-channel settings score substantially below the full contract, with the largest gap for reference evidence. |
| Bridging Data Gaps | 50.6 | 38.4 | 13.9 | Reference-heavy case: paper obligations remain useful, but removing reference evidence sharply reduces concrete protocol and repository-structure recovery. |
| PINN | 61.3 | 53.3 | 52.2 | Standardized-prior case: all variants remain strong because PINN objectives and PDE-loss structure are common, but the full contract is still best. |
| What Will My Model Forget | 16.8 | 10.7 | 8.4 | Scale and coverage stress case: the task has many long-tail details, and the full contract still leads both ablations. |
| LCA-on-the-Line | 41.8 | 16.1 | 33.8 | Boundary case: no-reference keeps a visible checklist for ObjectNet/LCA details, while the full run remains the strongest setting. |
| Paper | Claude | Gemini | w/o ref. | w/o req. | ||||
| Score | Files | Score | Files | Score | Files | Score | Files | |
| Adaptive Pruning | 67.8 | 46 | 41.9 | 92 | 6.2 | 23 | 14.3 | 24 |
| All in One | 76.9 | 77 | 51.6 | 48 | 23.7 | 16 | 28.0 | 36 |
| BAM | 61.8 | 37 | 48.5 | 47 | 20.7 | 18 | 30.8 | 38 |
| BBOX | 86.4 | 280 | 15.6 | 70 | 14.6 | 15 | 14.2 | 75 |
| Bridging Data Gaps | 66.0 | 151 | 50.6 | 23 | 13.9 | 17 | 38.4 | 19 |
| Setting | Papers | Score | Judge tok. | Pipe tok. | Hours | Calls |
|---|---|---|---|---|---|---|
| ReproAgent / Claude | 20 | 73.7 | 12,868,729 | 17,833,795 | 9.3 | 35.4 |
| ReproAgent / Gemini full | 20 | 39.7 | 6,243,588 | 17,459,007 | 5.6 | 11.7 |
| Gemini w/o reference evidence | 20 | 21.6 | 6,582,787 | 4,034,007 | 1.5 | 13.8 |
| Gemini w/o implementation requirements | 20 | 25.6 | 4,668,761 | 4,429,321 | 1.3 | 12.6 |
| Paper | Claude judge | Gemini judge | Gemini pipe | No-ref judge | No-ref pipe | No-req judge | No-req pipe |
|---|---|---|---|---|---|---|---|
| Adaptive pruning | 5,423,412 | 2,868,933 | 23,047,479 | 1,980,736 | 2,236,269 | 3,341,264 | 5,919,631 |
| All-in-one | 5,538,759 | 3,780,967 | 9,264,024 | 3,429,304 | 3,936,893 | 2,250,662 | 2,630,553 |
| BAM | 30,766,863 | 7,768,083 | 16,097,296 | 8,827,504 | 4,969,452 | 1,892,690 | 15,027,467 |
| BBOX | 8,567,577 | 774,669 | 58,268,936 | 4,903,571 | 4,131,573 | 4,373,037 | 4,509,759 |
| Bridging data gaps | 4,746,750 | 2,300,086 | 8,820,069 | 1,864,915 | 4,264,829 | 2,412,905 | 4,406,997 |
| FRE | 37,387,691 | 13,780,748 | 8,425,041 | 10,006,741 | 2,975,272 | 12,737,673 | 3,925,572 |
| Phase | Stage | Engineering role |
| Prepare | Input normalization | Normalize the target, task type, entities, and explicit constraints. |
| Prepare | Paper chunking | Segment paper text into section-level chunks with overflow handling. |
| Prepare | Requirement extraction | Extract implementation requirements that need concrete code, artifacts, interfaces, or validation targets. |
| Prepare | Reference acquisition | Collect reference repositories and survey file trees, README files, and likely reusable modules. |
| Plan | Work-package planning | Group prepared requirements into implementation-oriented packages such as data, method, training, evaluation, and artifact writing. |
| Plan | Package reference evidence | Attach package-local content and structure evidence; this supports package decisions but does not decide the final file tree. |
| Stage | Audit statistic | Mean | Median | Range |
|---|---|---|---|---|
| Prepare | Extracted implementation units per paper | 33.8 | 34.0 | 28–38 |
| Prepare | Candidate reference repositories requested per paper | 24.6 | 25.0 | 10–30 |
| Prepare | Prepared reference repositories per paper | 1.1 | 0.0 | 0–9 |
| Prepare | Implementation units grounded by references per paper | 6.2 | 0.0 | 0–29 |
| Plan | Work packages per paper | 19.6 | 21.5 | 3–38 |
| Plan | Contract assertions per paper | 6.9 | 7.0 | 5–10 |