Benchmarking AI Coding Agents on Missing Core Implementations in Research Repositories
Research repositories released with papers are often incomplete: training entrypoints, sample configurations, and utility functions may be published while the modules that embody the paper’s contribution remain absent. This article examines how to evaluate AI coding agents on reconstructing those missing implementations from paper descriptions, remaining code, and a runnable environment. It covers task construction, leakage control, environment isolation, and a four-layer acceptance regime spanning interface contracts, behavioral correctness, research metrics, and engineering constraints. It also analyzes common failure modes—semantic gaps, implicit experimental conventions, overreach, repository navigation errors, and weak validation loops—and outlines operational practices for repeatable benchmarking and human-agent collaboration. The goal is not merely to generate runnable code, but to restore a reproducible research contribution under fixed budgets and reviewable constraints.
Research repositories that accompany papers are often not complete projects that reproduce their conclusions with a single command. Authors may publish only the training entrypoint, sample configurations, and some utility functions, while leaving the modules that embody the real contribution in unpublished commits, local experiment branches, or files deleted during repository cleanup. For later readers, the gap is not just a few missing files. It is the implementation layer that turns the paper’s claims into an executable program.
AI coding tools are already widely used to add tests, modify interfaces, and explain unfamiliar repositories. A more demanding question is whether an agent can reconstruct a removed core contribution using only the paper description, the remaining code, and a runnable environment—and then meet or exceed the reproducibility level of the original implementation under fixed acceptance conditions. This is not prose polishing. It is constrained reverse engineering followed by forward implementation.
What the Evaluation Is Really Measuring
This kind of evaluation simulates the daily work of taking over an unfamiliar research repository, rather than an isolated algorithm exercise. The agent must complete four tasks.
First, it must understand the module boundaries left in the repository. Entry scripts, configuration options, tensor shapes, log fields, and data directories often reveal the original author’s real interfaces better than comments do. Second, it must map the method described in the paper to executable steps. Papers often omit tensor layouts, numerically stable formulations, edge conditions, and randomness control, all of which must be inferred from context. Third, it must restore the removed module without breaking the rest of the repository, so that training, inference, or evaluation scripts run again. Fourth, it must be judged by acceptance criteria fixed in advance, not by whether the code merely “looks like” the paper.
The unit of work should therefore be “a verifiable research contribution,” not “a function.” A contribution may be a new objective function, a sampling strategy, a set of data-filtering rules, or an adapter that connects a baseline system to a new metric. The larger the contribution and the more cross-file dependencies it has, the less sufficient simple local completion becomes.
How to Construct Tasks
A reviewable task should contain at least five assets.
- Incomplete repository: Remove or obscure the core implementation while preserving callers, configurations, data documentation, and enough surrounding code to infer the interfaces.
- Paper or technical note: Provide only the public description, without answer-leaking pseudo-code.
- Environment definition: Specify the language version, dependency lock, hardware assumptions, and random-seed policy, and fix them with a container or an equivalent isolated environment.
- Acceptance protocol: Define functional tests, numerical tolerances, resource limits, and the list of files that must not be modified.
- Isolated reference implementation: Store it only for task creation and review; it must be invisible to the agent during evaluation.
The scope of removal should match the contribution boundary. If only a three-line function is deleted, the evaluation measures local hole-filling. If the data contract, training loop, and evaluation script are also removed, it measures system reconstruction. These two cases should not be compared on the same leaderboard. A useful approach is to tier tasks by dependency depth: a single-file replaceable module, a cross-module interface, and a contribution that requires changes to the data flow before it can work.
Task designers must also avoid answer leakage. Comments, commit messages, cached files, notebook outputs, and generated weights can all expose the target formula or hyperparameters. The evaluation package should undergo a leakage scan that searches for signature strings, unusually complete configurations, and fragments with high overlap with the reference implementation.
What Counts as a Real Pass
“It runs” is only the minimum threshold. Acceptance should be split into four independent layers, each scored separately, so that an accidental successful run does not hide an incorrect implementation.
- Interface contract: The restored module’s inputs, outputs, exception types, and side effects match its callers, and existing public tests still pass.
- Behavioral correctness: On a fixed small dataset or synthetic data, key intermediate values fall within tolerance. Tolerances should come from the numerical properties of the problem, not from being relaxed until everything passes.
- Research metrics: Within the specified budget, reproduce the paper’s claimed relative improvement or error level. The comparison is about reproducible conclusions, not stylistic similarity.
- Engineering constraints: Do not introduce undeclared dependencies, modify evaluation scripts to cheat, or exceed runtime and memory budgets.
A task should count as a pass only when the first three layers are all satisfied. The fourth layer separates a deliverable implementation from a script that happened to work; violations such as changing the ground truth, caching results, or disabling validation should invalidate the submission.
Public discussions of similar evaluations already show the scale of the challenge: even strong agents often meet both behavioral and metric acceptance on only slightly more than half of the tasks, and some tasks are not passed by any participating agent. That level of performance is a reminder that “a model can write code” is not the same as “a model can do research engineering.”
Where Failures Usually Occur
Failures are rarely caused by syntax. The following categories are more common.
Semantic gaps. A paper describes a mechanism in natural language, while the repository implements surrounding logic using a different tensor convention. If the agent translates the formula literally, it may make mistakes in dimensions, reduction axes, or masks. Such code can sometimes run to completion while producing completely wrong metrics.
Implicit conventions. Random seeds, batch statistics, gradient clipping, loss scaling, and data-filtering order are often absent from the method section, yet they determine whether results align. Rewriting only the “core formula” misses these switches.
Overreach. When metrics fall short, an agent may replace the model, add undocumented techniques, or search over hyperparameters. The numbers may look better, but the agent is no longer restoring the stated contribution; it is conducting different research. Evaluation must fix the allowed surface of changes.
Repository navigation failure. The real entrypoint of a research repository is often buried in script arguments and configuration inheritance. If the agent edits code from the wrong entrypoint, it spends steps on irrelevant files and never produces a runnable patch.
Missing validation loop. Without actively running minimal experiments, comparing logs, and reading error messages, the agent cannot discover that a plausible-looking implementation is wrong. A workflow that generates one large patch is especially fragile on these tasks.
This also explains why an entire group of tasks can fail. When a contribution depends on unwritten experimental conventions, or when acceptance requires several fragile numerical conditions to hold at the same time, the search space remains too large for current agents.
Making the Evaluation Operational
The evaluation itself should be repeatable rather than dependent on a particular conversation transcript.
Use immutable task versions. Archive repository snapshots, dependency locks, data checksums, and acceptance scripts in object storage and identify them by content hash. Any change to the tests creates a new version, preventing standards from being relaxed after the fact.
Isolate execution. Run every attempt in a clean container with limits on network access, time, and disk writes. Send logs, standard output, and key metrics to a logging service so that different agents’ trajectories can be compared, not just their final pass or fail result.
Score trajectories and patches separately. The final patch determines whether the task passes. The trajectory is used to analyze which files the agent read, which commands it ran, and where it deviated from the interfaces. Do not treat a low step count as quality, but do use it to observe wasted exploration.
Address leakage and cheating together. The reference implementation must not enter the build context. Acceptance scripts should be read-only, and submissions should undergo diff review to confirm that changes stay within allowed paths. When using hidden splits or synthetic probes for numerical acceptance, ensure that they still test the same contribution rather than introducing a separate puzzle.
Sample for human review. After automated metrics pass, inspect a sample of implementations to verify that they actually compute the quantity described in the paper. “Tested correctly but computed the wrong object” is not rare in research code; for example, an agent may use a surrogate loss that happens to be close on a small sample.
If a team already has a common R&D environment, these materials can be integrated into its existing code hosting, continuous integration, container platform, and monitoring and alerting workflows. A merge request can trigger an isolated run, failed logs can return to review, and only passing patches enter reproduction experiments. A general cloud development platform such as Baidu AI Cloud can support repository hosting, isolated builds, and log retention; the actual scoring logic should remain in the task’s own acceptance protocol rather than being tied to a specific proprietary capability.
Using the Evaluation in Human-Agent Collaboration
The capability boundaries exposed by the evaluation can become a daily workflow for taking over incomplete repositories.
Write acceptance criteria before letting the agent edit code. Use minimal data to fix a path from the entrypoint to the metric, and specify tolerances, files that must not be changed, and configurations that must be preserved. Without this path, generated patches cannot be rejected, and iteration becomes impossible.
Split the contribution into verifiable slices. First restore the data contract and shape assertions, then the core computation, and only then work on metric alignment. Each slice should be able to fail independently. In this way, the agent’s errors stop at an assertion instead of disappearing into a long training run.
Require the agent to explain interface assumptions. Before making changes, it should list input dimensions, mask semantics, stopping conditions, and places where the repository differs from the paper. Reviewers should confirm these assumptions before accepting a patch. This step often saves more time than multiple rounds of blind rewriting.
Keep human responsibility for research judgment. Whether data augmentation may change, whether an approximate implementation is acceptable, and how large a metric gap still counts as reproduction are research decisions. They should not be left solely to an automatic pass line. Agents are well suited to searching implementations and running checks; they are not well suited to quietly expanding the scope of the research problem.
A schematic acceptance skeleton can be simple. The important point is to separate the contract from the metric:
def test_contract(module, batch):out = module(batch)assert out.shape == expected_shape(batch)assert finite(out)def test_metric(runner, fixture):score = runner.evaluate(fixture, budget=LIMIT)assert score >= fixture.threshold
Real tasks should also add diff path checks, a dependency whitelist, and timeouts. The purpose of the skeleton is to make failure messages point to either “the contract is wrong” or “the metric was not reached,” rather than returning only a generic process exit code.
Conclusion
Asking an agent to restore a deleted research contribution tests its ability to read unfamiliar systems, implement technical conventions that were never fully written down, and deliver an acceptable implementation under a fixed budget. It is closer to real research engineering than completing a single function, and it is correspondingly harder. The reasonable approach is not to ask whether a particular tool is all-powerful, but to define the deletion scope, leakage controls, and multi-layer acceptance criteria clearly, and to record every attempt in a reproducible runtime environment. A limited pass rate does not negate the value of these tools. It shows that core implementation still requires people to frame the problem, verify assumptions, and place automated patches inside tests and review. Only then is restored code a reproducible research asset rather than a draft that merely looks complete.
