TL;DR
Reproducing a machine learning paper from scratch often feels like detective work—crucial details are buried in appendices, implied in diagrams, or missing altogether. Crafter is an automated, multi-agent pipeline that reads research PDFs, actively hunts down missing implementation details, and generates executable, debugged codebases. Instead of producing code that merely looks plausible, Crafter gets repositories significantly closer to actually running and validating a paper's core scientific claims.
What Problem Does This Paper Address?
Machine learning has a reproducibility headache. Many papers arrive without code, leaving engineers to translate dense math and high-level prose into working software. While LLMs are great at everyday coding, handing a raw paper to an LLM—or even to existing multi-stage "paper-to-code" pipelines like Paper2Code or DeepCode—often results in broken repositories.
The authors pinpoint two specific failure modes behind this:
- Fabrication-by-omission: When a paper forgets to mention a detail (like a learning rate or dataset split), the LLM silently guesses a plausible default rather than flagging or researching it.
- Fabrication-by-extrapolation: Given partial clues (say, a brief mention of an adapter module), the LLM gets overly creative and invents extra APIs, parameters, or logic unsupported by the text.
Methods
Crafter treats paper reproduction not as single-pass text-to-code translation, but as context-calibrated implementation recovery. Rather than letting agents chat freely—which can amplify hallucinations—Crafter enforces a strict pipeline mediated by a shared key-value store (GlobalMemory), while giving individual agents private scratchpads (LocalMemory).
The pipeline balances two opposing forces: Expansion (gathering missing evidence) and Contraction (strictly limiting what each coding agent sees so it doesn't invent things). It runs in three stages:
- Preprocessing (Expansion): A Partition Agent splits the PDF into sections, while a Vision-Language Agent translates architecture diagrams into structured graphs (filtering out result plots). Crucially, a Gap Agent spots missing details—like hyperparameters or referenced architectures—and tries to resolve them via a three-tier cascade: checking a local ML dataset registry, cross-referencing appendices/footnotes, and querying the Semantic Scholar API. Unresolved gaps are explicitly flagged.
- Planning: Main and Sub-Planning Agents build a strict "implementation contract" (specification). A constraint validator and cross-module review pass check that entry points (like
main.py) don't duplicate module logic and that return types match across files. - Implementation & Debugging (Contraction): When writing a module, the code generator only sees that module's spec and declared dependencies, preventing symbol leakage. Finally, a Debug Agent runs the code in a subprocess, reading the generator's
LocalMemoryto understand original intent and applying targeted fixes (or re-triggering planning if a file repeatedly fails).
Datasets
Because Crafter is an inference-time agentic system, there are no training datasets. For evaluation, the authors use:
- 27 Research Papers for Faithfulness: 23 ICML 2024 papers from the existing PaperBench benchmark (using its fine-grained
Code-Devrubrics to grade source-code completeness), plus 4 recent ICLR 2026 papers posted after the LLM's knowledge cutoff to test against data contamination. - Fixture-Scale Execution Benchmark (New): Source-code rubrics don't tell you if code actually runs, and full ML training takes weeks. The authors introduce an execution-readiness benchmark across 7 papers using lightweight "fixtures" (synthetic/small data on a single GPU) and a 7-step milestone ladder (
M0toM7) that tests whether the code launches, finishes pilot runs, and reproduces the qualitative direction of the paper's main claim.
Key Insights and Ideas
- Decouple the contract from the code: By building an explicit specification before coding—and deriving validation checks from that spec—the model isn't grading its own homework.
- Looking complete $\neq$ working: In execution tests, zero generated repositories (from Crafter or baselines) passed the final scientific contribution check (
M7) out of the box without human-in-the-loop repair. Measuring repair distance (how many edits it takes to reachM7) is far more revealing than static code grading alone. - Spend compute upfront to save human debugging later: Crafter costs roughly twice as much in API tokens per paper (~$21.64 vs. ~$12 for baselines), but cuts downstream repair cycles roughly in half.
Key Results
Using Claude Sonnet 4.6 as the backbone (and consistent trends with MiniMax M2.7), Crafter outperforms both Paper2Code and DeepCode:
- Implementation Faithfulness: Across 23 PaperBench papers, Crafter hits an average
Code-Devscore of 0.8354 (winning 17/23 papers), beating Paper2Code (0.6979) by 18.4% and DeepCode (0.6844) by 21.8%. On the 4 post-cutoff ICLR 2026 papers, Crafter wins all 4 (0.8215 average). - Execution & Repair Distance: On the 7-paper execution benchmark, Crafter reaches higher initial pre-repair milestones on 6/7 papers. Under a bounded repair loop, Crafter reaches
M7(passing contribution checks) on all 7/7 papers (vs. 6/7 for baselines), while slashing average source-edit repair cycles from 10.7–12.9 down to 5.7. - Ablations: Removing the debug loop drops the 9-paper subset score from 0.8879 to 0.8421; removing gap-filling drops it even further to 0.8296, proving how vital upfront evidence recovery is.
Limitations and Future Work
- Lossy visual parsing: Converting architecture diagrams into text/graph records is currently one-way; the system doesn't double-check extracted graphs against the original image before planning.
- Environment setup: Crafter generates Python source code, but fully portable reproduction requires automatically generating container environments and dependency configs alongside it.
- Scale of validation: Execution checks currently verify qualitative claim directions on small fixtures rather than full-scale, multi-week quantitative replications, and still require bounded repair cycles to cross the finish line.
Summary updated