Turning a machine learning paper into a faithful, runnable implementation is hard because papers omit the details a programmer needs: referenced architectures, baseline methods, dataset preprocessing, hyperparameters, and algorithmic corner cases. Crafter treats reproduction as context-calibrated implementation recovery rather than single-pass code generation. It builds an evidence-grounded specification from the paper, resolves missing implementation details before planning, and repairs the generated repository through execution-aware debugging.
On 23 PaperBench papers with Claude Sonnet 4.6, Crafter reaches an average Code-Dev score of 0.84, improving over Paper2Code by 19.7% and over DeepCode by 22.1%, and it wins on 17 of 23 papers. In execution-oriented evaluation it is the only system to reach the contribution-level milestone on every repository, with roughly half the repair cycles of either baseline. Ablations show that gap filling and execution-aware debugging each contribute, and that they compound.
A dedicated Gap Agent finds five categories of implementation-critical omissions (referenced architecture, baseline method, dataset detail, missing hyperparameter, algorithm gap) and resolves them from cited papers, external repositories, and dataset registries. The target paper's official code is explicitly blacklisted.
A vision-language agent classifies figures, discards result plots, and extracts architecture diagrams into structured component and flow records that downstream planners consume as text.
A main planner fixes the global architecture, sub-planners produce module-level specs, and a validator enforces orchestrator/module hygiene before any code is written.
Modules see only their declared dependencies; orchestrators see the full module layer. Two passes, in dependency order, keep each prompt focused and consistent.
A debug agent runs the repository, diagnoses root causes, and applies fixes through a multi-granularity submit_fix tool: line edits, file rewrites, or dependency-cascade regeneration, with snapshots and automatic rollback of regressions.
Crafter consumes a MinerU parse of the paper (content list plus extracted figures) and runs the stages below. Each stage persists its state, so re-running with the same output directory resumes from the last cached stage.
Deterministic split of the parsed paper into body, appendix, references, and preamble. No LLM involved.
A VLM classifies each figure and converts architecture diagrams into typed component/flow records.
Find missing implementation details and resolve them from external evidence: cited papers, third-party repositories, and dataset registries.
Main planner fixes the global architecture, sub-planners write module specs, and a constraint validator checks the result.
Pass 1 writes modules with dependency-scoped context; pass 2 writes orchestrators with the full module layer in view.
Adds reproduce.sh, requirements.txt, and package __init__ files.
Run, diagnose, submit_fix, re-run. Snapshots and rollback protect against regressions.
Generates unit tests for the produced repository.
PaperBench Code-Dev, mean paper-level score in [0, 1]. Wins = papers on which the method scores highest of the three.
| Backend | Method | PaperBench (23) Avg. | Wins | ICLR 2026 (4) Avg. | Wins |
|---|---|---|---|---|---|
| Claude Sonnet 4.6 | Paper2Code | 0.698 | 4/23 | 0.739 | 0/4 |
| DeepCode | 0.684 | 2/23 | 0.683 | 0/4 | |
| Crafter | 0.835 | 17/23 | 0.822 | 4/4 | |
| MiniMax M2.7 | Paper2Code | 0.421 | 4/23 | — | — |
| DeepCode | 0.442 | 1/23 | — | — | |
| Crafter | 0.588 | 18/23 | — | — |
Seven repositories. M7 = execution, liveness, and contribution checks all pass. |ΔLOC| = lines changed by the repair loop.
| Method | Reached M7 | Avg. edit cycles | |ΔLOC| |
|---|---|---|---|
| Paper2Code | 6/7 | 10.7 | 521 |
| DeepCode | 6/7 | 12.9 | 615 |
| Crafter | 7/7 | 5.7 | 484 |
Nine papers, Claude Sonnet 4.6. Mean Code-Dev score.
Per-paper tables are in the paper's appendix.
Python 3.10+. Parse the paper with MinerU, then point Crafter at the parsed directory. See the README for backends, Docker, and the full reproduction protocol.
git clone git@github.com:v1p0r/Crafter.git && cd Crafter
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
export ANTHROPIC_API_KEY=... # main backend
export GEMINI_API_KEY=... # figure analysis
./run.sh data/parsed/<paper> --output data/output/<paper> \
--target-codebase-blacklist https://github.com/<owner>/<official-repo>
@inproceedings{crafter2026,
title = {Crafter: Towards Automated Reproducible Machine Learning via Agentic Code Generation},
author = {Linghu, Fangru and Ye, Jackson R. and Wang, Jieying and Morozov, Alexandre V. and Foster, Ian T. and Zhang, Zhao},
booktitle = {Advances in Neural Information Processing Systems (NeurIPS)},
year = {2026}
}