NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

ResearchCodeBench: Benchmarking LLMs on Implementing Novel Machine Learning Research Code

Tianyu Hua, Harper Hua, Violet Xiang, Benjamin Klieger, Sang T. Truong, Weixin Liang, Fan-Yun Sun, Nick Haber

TL;DR

ResearchCodeBench is a new execution-based benchmark evaluating whether modern LLMs can implement novel machine learning ideas directly from 2024–2025 research papers into functional code. Evaluating 32 leading models reveals a significant frontier gap: even the best-performing model (Gemini-2.5-Pro-Preview) achieves only a 33.0% pass rate on the benchmark's hard subset, with 43 tasks completely unsolved by any model.

What Problem Does This Paper Address?

While LLMs excel at standard coding puzzles (e.g., HumanEval) and routine bug fixes (e.g., SWE-bench), assisting research scientists requires translating newly conceptualized mathematical and architectural ideas into working implementations.

Evaluating this capability presents two major roadblocks:

  1. Contamination and Novelty: Established benchmarks test well-known algorithms already saturated in pretraining corpora. Research code demands implementing ideas that emerged after model training cutoffs.
  2. Evaluation Reliability: Many recent scientific AI evaluations rely on subjective "LLM-as-a-judge" grading. Without automated, deterministic code execution, it is difficult to know if model-written research code actually runs correctly.

Methods

ResearchCodeBench curates fill-in-the-blank code completion challenges around the core innovations of recent papers.

  • Task Construction: For each paper, the authors isolate the novel contribution (e.g., custom attention mechanisms, loss functions, or sampling algorithms) and mask target snippets within the repository. Tasks are structured hierarchically—ranging from fine-grained lines to full function blocks—paired with disambiguating natural language hints.
  • Context Provision: Models receive the prompt, relevant contextual repository files, and the full research paper (averaging ~30k tokens for the paper and ~20k for code context).
  • Hybrid Execution Testing: To avoid subjective grading, completions are slotted into the codebase and executed locally against:
  • Equivalence tests: Comparing model outputs directly against the reference implementation across randomized seeds and execution modes.
  • Unit tests with ML nuances: Checking computed gradients for optimization components, behavior near thresholds (e.g., clipping), and stateful transitions across multi-step training loops.

Datasets

  • ResearchCodeBench: 212 coding challenges constructed from 20 recent, top-tier ML papers (NeurIPS 2024, ICLR 2025, CVPR 2024/2025, and arXiv).
  • ResearchCodeBench-HARD: A curated subset of the 109 most difficult tasks (the bottom 50% by aggregate pass rate).
  • Contamination-Safe Subset: A 13-paper split where repository initial commits postdate January 2025, strictly after the knowledge cutoff dates of evaluated models.

Key Insights and Ideas

  • Logic, Not Syntax, Is the Bottleneck: An error breakdown of failed runs revealed that 58.6% of failures are Functional Errors (code executes without crashing but yields incorrect outputs). Syntax, naming, and type errors represent less than 10% each. Today’s models know how to write valid Python, but struggle to grasp the underlying research mathematics.
  • Paper Context Can Confuse Weaker Models: Frontier reasoning models (Gemini-2.5-Pro, o3, o4-mini) gained up to a 30% relative boost when given access to the research paper. However, smaller models showed minimal gains, and open-weight LLaMA models actually performed worse with the paper included—suffering from context dilution and distraction.
  • Verbosity Flags Failure: Across all 32 models, successful solutions averaged 2.4 to 4.0 lines of code, while failed completions averaged 7 to 12 lines. Struggling models consistently over-engineered and generated redundant code that introduced logic bugs.

Key Results

  • Proprietary vs. Open-Source Gap: On the full 212-task benchmark (Pass@1, greedy decoding), Gemini-2.5-Pro-Preview led with 64.2%, followed by o3 (High) at 59.4% and o4-mini (High) at 58.5%. Top open-weights trailed significantly: Qwen-2.5-Coder-32B scored 25.9%, and Llama-3.3-70B reached 12.3%.
  • Struggles on Difficult Tasks: On ResearchCodeBench-HARD, Gemini-2.5-Pro hit only 33.0%, o4-mini scored 28.4%, and o3 scored 25.7%. Four evaluated models scored 0.0%, and 43 tasks saw a 0% success rate across every single model.
  • Human Baseline: An experienced ML researcher completed a 102-task subset with a 77.5% pass rate, outperforming the best model (68.6% on that subset), despite models generating answers in seconds rather than human iteration time.

Limitations and Future Work

  • Scope and Scale: The initial benchmark is restricted to 20 machine learning papers. The authors have launched a community submission pipeline to extend coverage to robotics, physics, and computational biology.
  • Single-Turn Evaluation: The benchmark currently measures zero-shot / single-turn generation without execution feedback or compiler error loops, which acts as a lower bound for agentic systems.
  • Manual Test Authoring: While human-crafted tests are essential to handle tricky ML-specific checks (like gradient verification and stochasticity), manual test construction limits the speed of benchmark expansion until reliable automated test generation matures.

Summary updated

BibTeX
@inproceedings{hua2025researchcodebench,
  author = {Tianyu Hua and Harper Hua and Violet Xiang and Benjamin Klieger and Sang T. Truong and Weixin Liang and Fan-Yun Sun and Nick Haber},
  title = {{ResearchCodeBench: Benchmarking LLMs on Implementing Novel Machine Learning Research Code}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=3k70Vt0YFS},
}
Figure