NeurIPS 2026

Crafter: Towards Automated Reproducible Machine Learning via Agentic Code Generation

Fangru Linghu, Jackson R. Ye, Jieying Wang, Alexandre V. Morozov, Ian T. Foster, Zhao Zhang
Affiliations to be announced

Crafter turns a machine learning paper into a runnable repository.

Crafter pipeline: a paper is partitioned, its figures and implementation gaps are analysed, a planner produces an architecture and module specifications, code is generated and debugged, and all stages share a global memory.
Overview. Crafter reads a paper, recovers the implementation details the text leaves out, plans the repository hierarchically, generates code module by module, and repairs it by running it. Every stage reads and writes a shared global memory, so the pipeline can resume from any cached stage.
0.835
PaperBench Code-Dev score
avg. over 23 papers, Claude Sonnet 4.6
17/23
papers won
vs. Paper2Code and DeepCode
7/7
repositories reach M7
execution + liveness + contribution
5.7
repair cycles on average
about half of either baseline

Abstract

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.

What makes Crafter different

Implementation-gap recovery

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.

Figure-aware extraction

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.

Hierarchical planning with validation

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.

Asymmetric-context code generation

Modules see only their declared dependencies; orchestrators see the full module layer. Two passes, in dependency order, keep each prompt focused and consistent.

Execution-aware debugging

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.

How it works

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.

  1. 1

    Partition

    Deterministic split of the parsed paper into body, appendix, references, and preamble. No LLM involved.

  2. 2

    Figure analysis

    A VLM classifies each figure and converts architecture diagrams into typed component/flow records.

  3. 2.5

    Gap analysis

    Find missing implementation details and resolve them from external evidence: cited papers, third-party repositories, and dataset registries.

  4. 3

    Planning

    Main planner fixes the global architecture, sub-planners write module specs, and a constraint validator checks the result.

  5. 4

    Code generation

    Pass 1 writes modules with dependency-scoped context; pass 2 writes orchestrators with the full module layer in view.

  6. 4.5

    Scaffolding

    Adds reproduce.sh, requirements.txt, and package __init__ files.

  7. 5

    Debug loop

    Run, diagnose, submit_fix, re-run. Snapshots and rollback protect against regressions.

  8. 6

    Unit tests optional

    Generates unit tests for the produced repository.

Results

Code-development faithfulness

PaperBench Code-Dev, mean paper-level score in [0, 1]. Wins = papers on which the method scores highest of the three.

Claude Sonnet 4.6 · PaperBench (23)
Paper2Code0.698
DeepCode0.684
Crafter0.835
MiniMax M2.7 · PaperBench (23)
Paper2Code0.421
DeepCode0.442
Crafter0.588
BackendMethodPaperBench (23) Avg.WinsICLR 2026 (4) Avg.Wins
Claude Sonnet 4.6Paper2Code0.6984/230.7390/4
DeepCode0.6842/230.6830/4
Crafter0.83517/230.8224/4
MiniMax M2.7Paper2Code0.4214/23——
DeepCode0.4421/23——
Crafter0.58818/23——

Execution-oriented evaluation

Seven repositories. M7 = execution, liveness, and contribution checks all pass. |ΔLOC| = lines changed by the repair loop.

MethodReached M7Avg. edit cycles|ΔLOC|
Paper2Code6/710.7521
DeepCode6/712.9615
Crafter7/75.7484

Ablation

Nine papers, Claude Sonnet 4.6. Mean Code-Dev score.

0.888
Crafter (full)
0.842
w/o debugging
0.830
w/o gap filling
0.819
w/o both

Per-paper tables are in the paper's appendix.

Get started

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>

BibTeX

@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}
}