R224 · Agent principles and patterns › Evaluation data for agents

BuggyMLE: harder coding evals by injecting verified bugs into working ML repos

Read the original

Authors Elvis Saravia (shared)

evalsbenchmarkscoding-agentssynthetic-datarlml-engineeringpaper

· Source: Wu, Qiang, Zhuang et al. (Google Research, Google DeepMind, UIUC), BuggyMLE: Scaling Machine Learning Engineering Difficulty with Bug Injection, arXiv:2611.25088, 18 Nov 2026. Surfaced by Elvis Saravia (DAIR.AI).

The short version

Repository-level coding benchmarks are saturating, and most ML-engineering benchmarks still confine agents to single-file edits. The paper makes two moves. First, it fits a Code Complexity Index (CCI): ten structural features of a repository and its fix (repo size, file count, directory depth, dependency count and chain depth, files changed, hunks, lines added, removed and total delta), combined with four parameters. Fitted on task medians from eight public coding benchmarks, CCI predicts their average solve rates with R² ≈ 0.95, and patch size and complexity are the strongest predictors. Second, it uses that finding as a dial: BuggyMLE has an agent inject controlled bugs into working ML repositories at a target mutation budget, so the same codebase can yield an easy task or a brutal one.

Results: about 6,600 bug-injected variants (roughly 260K injected lines) from 222 source repos; a graded, repository-level BuggyMLEBench-Lite derived from MLE-Bench Lite where the best of 14 models falls from a 95% solve rate on the easiest tier to 9% on the hardest; and a Qwen3.5-9B fine-tuned (LoRA, SFT then RL) on an easy-to-hard curriculum over 200 further repos that rivals frontier models on the benchmark and transfers outside ML (SWE-bench Lite 24% → 33%, LiveCodeBench v6 pass@1 69% → 71%).

The claim worth carrying away: difficulty is mostly a property of code structure and patch reach, not model identity, so you can manufacture harder tasks and training data from repos you already own.

How the pipeline works

A four-stage, YAML-configured pipeline, every stage running in a GPU-enabled Docker sandbox with a shared tool harness:

  1. Curate. An auditor keeps candidate repos that run fast, produce a stable metric across runs, and have a responsive metric (one that moves when code changes). A repo whose metric doesn't move can't grade a repair.

  2. Inject. An LLM agent explores the clean repo and introduces plausible bugs wherever they fit (data loading, preprocessing, architecture, training, evaluation). There is no fixed bug taxonomy. Difficulty comes from the mutation budget: a required number of files, hunks and lines. Deterministic scripts accept an injection only if (a) the diff meets the budget, (b) the run crashes or degrades the metric by more than three standard deviations of clean run-to-run variance (or 10% when variance is unknown), and (c) a completed run still emits a valid metric. Failures go back to the injector with diagnostics, up to five retries.

  3. Attribute (the oracle). A multi-hunk injection can mix real bugs with harmless edits. The oracle first reverts mutations in ranked order until baseline performance returns (a minimal reverting set), then applies each mutation alone to the clean repo to measure its isolated effect. Output: a verified checklist of impactful bugs, with inert edits kept as decoys.

  4. Solve and evaluate. A debugging agent gets only the buggy repo: no clean reference, no bug list. Its fix runs in a clean container and is graded on recovered ML performance, on an oracle-grounded LLM code review, and on anti-bypass checks for cheating.

Because difficulty is a budget on the same repository, the curriculum can be graded while holding repo distribution and data modality fixed. That isolates "harder" from "different".

What the results say

Why it matters for engineering teams

Tradeoffs and limits

Failure modes to watch if you build this

Review checklist

Cited in field guides

Connections

See R224 on the knowledge map

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.