AI Research Reproduction: How to Evaluate Agents That Rebuild Missing Paper Code

    Rebuilding a research paper’s missing core code tests more than an AI agent’s ability to write working software. This article explains the challenges of research-oriented programming, how to design credible evaluations, and a practical reproduction workflow. It also shows why method fidelity, system performance, resource costs, stability, and reproducibility must be assessed together—and what these requirements mean for enterprise use of coding agents.

    1. Working Code Does Not Mean Reproduced Research

    Consider a research task: you receive a paper and its accompanying code, but the module implementing the paper’s main contribution has been removed. Data processing, basic dependencies, supporting components, and evaluation entry points remain intact. Your job is to reconstruct the missing module from the paper and the surviving code, then compare it with the authors’ original implementation.

    This is fundamentally different from writing a function to satisfy a specification. The goal is not to deliver plausible code. It is to recover the method described in the paper within the constraints of an existing system and demonstrate that it produces the expected experimental results.

    AI coding agents can read files, invoke tools, edit code, and run tests autonomously. Those operational capabilities, however, do not automatically amount to research capability. Research reproduction requires an agent to understand theoretical descriptions, software architecture, experimental conditions, and evaluation objectives—and keep them consistent.

    The central question is not whether an agent can fill the gap, but whether its implementation is faithful, effective, and able to withstand a fair comparison.

    Evaluations built around missing paper code can therefore reveal the limits AI encounters when moving from routine programming to research-oriented development.

    2. How Research-Oriented Programming Differs from Standard Coding Tests

    The Task Does Not Contain All the Necessary Information

    Traditional programming problems usually define inputs, outputs, and constraints explicitly. The implementer primarily needs to select an algorithm, handle edge cases, and meet time and space requirements.

    Research reproduction is different. Essential information may be scattered across the paper, equations, appendices, configuration files, calling code, and experiment scripts. Some conventions are visible only through the behavior of the remaining implementation.

    For example, a paper might state that a score is normalized without explaining, in the same passage, the normalization dimension, how zero values are handled, or how normalization interacts with subsequent ranking. The implementer must resolve these details from context rather than choose a familiar normalization method based on terminology alone.

    Correctness Is Only One Dimension

    When fixing a software defect, the objective is usually to restore expected behavior without breaking existing functionality. A research implementation may need to satisfy several objectives:

    • Does the output follow the method’s definition?
    • Is result quality close to that of the reference implementation?
    • Does execution time meet the experiment’s requirements?
    • Are memory and other resource costs reasonable?
    • Is behavior stable across input sizes and random conditions?

    An implementation can pass basic tests yet fail to achieve the paper’s reported results because its search strategy deteriorates, its numerical calculations are unstable, or its resource demands are excessive.

    Iteration Is Necessary, but Its Cost Must Be Controlled

    Real research does not end after one submission. Researchers read, form hypotheses, implement, test, and revise their approach based on the results.

    Allowing agents to conduct multiple rounds of experimentation makes an evaluation more representative of actual development. It also raises a comparison problem: how much runtime, compute, and feedback did each approach use?

    An approach that achieves a strong result through many attempts should not be ranked solely by its final score against one that reaches a similar result at much lower cost. Research capability must be evaluated through both result quality and the cost of obtaining that result.

    3. Why Reconstructing a Core Module Is Difficult

    Mathematical Descriptions Leave Room for Interpretation

    Papers generally explain why a method works, not how to write every line of code. Translating an operation from an equation into a program may require decisions about data layout, broadcasting, numerical precision, and special inputs.

    For example, an iterative process described mathematically as repeated updates still leaves implementation questions:

    • Are updates applied synchronously or one element at a time?
    • Does convergence depend on absolute or relative error?
    • What is returned when the maximum iteration count is reached?
    • How are invalid values handled?
    • Do intermediate states affect subsequent calculations?

    These details may not change the conceptual description of the method, but they can substantially change its results.

    The right approach is not to guess which common implementation the authors used. Each important assumption should be checked against the paper, the surrounding calls, and experimental observations.

    Modules Have Both Interface and Semantic Contracts

    An interface contract covers parameters, return values, data types, and exception behavior. These requirements are usually relatively easy to identify.

    Semantic contracts are less visible. They may determine:

    • Whether an input sequence must retain its original order.
    • Whether higher or lower returned scores are better.
    • Whether the module modifies input objects.
    • Whether training and evaluation use different logic.
    • Whether random state is controlled by the caller or managed internally.

    Satisfying the interface contract produces an implementation that can connect to the system. Satisfying the semantic contract is also necessary for its behavior to match expectations.

    Reading callers and downstream consumers is therefore often more important than focusing exclusively on the missing function.

    Local Plausibility Does Not Guarantee System-Level Effectiveness

    Research systems typically depend on interactions among several components. A core module may behave correctly in isolation while remaining incompatible with the rest of the system.

    For example, a new filtering strategy may reduce the candidate set but remove samples that a downstream module needs. A caching strategy may reduce execution time but return stale results after the underlying state changes.

    Reproduction must therefore be validated at two levels: whether the module works as intended, and whether restoring it also restores the expected behavior of the complete system.

    Mismatched Experimental Conditions Lead to Incorrect Attribution

    Data splits, preprocessing, randomness, resource environments, and stopping conditions can all affect results. Without aligning these factors, it becomes difficult to determine whether a performance gap comes from the algorithm’s implementation or the experimental environment.

    Two risks deserve particular attention: environmental differences can conceal implementation errors, or they can make a correct implementation appear wrong. Research reproduction is an exercise in experimental control as well as programming.

    4. Designing a Credible Missing-Code Evaluation

    Remove Code That Represents the Actual Contribution

    Removing too little may turn the task into a few lines of code completion. Removing too much may force participants to rebuild the entire system, losing focus on the core method.

    A more useful design removes the implementation of a key algorithm or strategy while retaining enough context for participants to understand the module’s location and purpose without exposing the answer.

    The removal scope should also be documented: a single function, several interdependent modules, or an entire subsystem. Otherwise, task difficulty is hard to compare.

    Separate Editable Code from Trusted Evaluation Components

    The files participants may modify should be specified before the task begins. Evaluation logic, data splits, and reference results should remain separate from editable areas.

    Without this separation, an agent could improve its score by changing test conditions rather than improving the target module. Even if unintentional, such changes undermine the evaluation.

    A credible evaluation should also inspect the final changes to confirm that the agent has not bypassed required computations, accessed prohibited data, or altered metric calculations.

    Use Layered Evaluation Rather Than a Single Score

    An evaluation should distinguish at least four layers:

    Interface and basic behavior. Can the module be called successfully? Does it return the correct structure? Does it handle exceptional inputs appropriately?

    Method fidelity. Does the implementation preserve the paper’s key mechanisms rather than substitute a simpler, different method?

    System-level performance. Does the complete system meet predefined requirements in the specified scenarios?

    Resource use and stability. Do runtime, memory consumption, and repeated-run results satisfy the constraints?

    These layers should ideally be reported separately. A single score is convenient for ranking, but it can hide important differences, such as high quality at excessive cost or fast execution that distorts the method.

    Treat the Reference Implementation as a Baseline, Not Absolute Truth

    The authors’ implementation is a valuable point of comparison, but it may contain unoptimized execution paths, implicit assumptions, or defects.

    Evaluations should therefore distinguish between faithful reproduction and performance improvement. Reproduction focuses on consistency with the method and its behavior. Improvement focuses on achieving better results under equivalent conditions.

    If improvements are allowed, the evaluation must specify which mechanisms may change and which constraints must remain intact. A higher-scoring alternative algorithm is not automatically a successful reproduction. Nor should every valid implementation that differs from the authors’ code be treated as a failure.

    5. A Practical Research Reproduction Workflow

    Step 1: Map the Task

    First identify the missing module, its calling entry points, its inputs and outputs, and the evaluation path. Then read the sections of the paper directly relevant to that module.

    Create a short record covering:

    • The module’s responsibility.
    • The files that supply its inputs.
    • The components that consume its outputs.
    • The core equations or algorithmic steps.
    • The details already confirmed.
    • The details that still need verification.

    This record reduces aimless exploration of a large codebase and provides a basis for subsequent changes.

    Step 2: Build a Minimal Correct Implementation

    Do not start with complex optimizations. Begin with a clear, inspectable implementation that establishes the main algorithm, data flow, and interface behavior.

    Prepare small, manually checkable examples for key operations. A ranking module can use a few candidates to verify ranking direction. An iterative module can use a simple state to check the result of a single update.

    A minimal correct implementation reduces debugging ambiguity. When results are unexpected, it becomes easier to distinguish a misunderstanding of the method from a coding error.

    Step 3: Test in Layers

    Start with inexpensive checks that make failures easy to locate, then expand the scope:

    1. Check dimensions, types, and return structures.
    2. Test empty inputs, duplicate elements, and extreme values.
    3. Verify relevant mathematical properties.
    4. Run small-scale integration experiments.
    5. Execute the full evaluation last.

    Different methods have different mathematical properties. Test assertions must come from the specific algorithm rather than a generic template. For example, the fact that some iterative methods are monotonic does not justify requiring every iterative process to produce monotonically changing metrics.

    Step 4: Let Experiment Records Guide Revisions

    Each modification should test a specific hypothesis, such as “candidate truncation occurs too early and discards useful information,” rather than a vague intention to optimize further.

    Record the reason for the change, the affected code, test results, and resource differences. Where possible, change only one category of important factors at a time. This reduces attribution problems caused by interacting modifications.

    Step 5: Verify That the Final Result Is Reproducible

    Before submission, rerun the complete workflow in a clean environment. Confirm that the result does not depend on temporary files, undocumented settings, or an accidental execution order.

    For tasks involving randomness, follow a consistent protocol for repeated runs. Report suitable aggregate results and variability rather than presenting only the most favorable run.

    6. Interpreting AI Failures

    When an agent fails a task, the explanation is not necessarily that it cannot write code. Failure may occur at several stages:

    • It identifies the wrong module to reconstruct.
    • It misunderstands a key concept in the paper.
    • Its implementation satisfies the interface but violates semantic conventions.
    • It implements local logic correctly but does not validate the complete system.
    • It cannot complete the necessary experiments within the resource budget.
    • It makes the wrong optimization based on limited feedback.

    Evaluation reports that retain action traces, code diffs, and intermediate test results can turn failures into analyzable problems rather than reducing them to a pass rate.

    Likewise, a successful attempt does not establish general research capability. The number of tasks, domain coverage, difficulty distribution, and acceptance criteria all affect the conclusion. A pass rate under limited conditions should not be interpreted as the probability of completing an arbitrary research task.

    7. Implications for Enterprise Use of Coding Agents

    Enterprises can use agents to organize documentation, analyze call relationships, add tests, and generate candidate implementations. Replacing core algorithms should still require human review and experimental validation.

    For modules that affect business decisions, resource scheduling, or data-processing results, acceptance criteria should include:

    • Behavior consistent with the relevant contracts.
    • Key metrics within specified limits.
    • Acceptable resource consumption.
    • Traceable and reversible changes.
    • Repeatable experiments.
    • Controlled data access and execution permissions.

    Agent tool use should take place in a controlled environment under the principle of least privilege. Reproducing a paper is not a reason to grant access to all production data or permission to modify arbitrary system settings.

    A practical division of responsibility is for people to define research objectives, critical assumptions, and acceptance criteria; for agents to handle repetitive code exploration, implementation, and testing; and for people to review method fidelity and experimental conclusions.

    Conclusion

    Reconstructing a paper’s missing core code is closer to real research work than ordinary code generation. It requires AI to understand not only how to write a program, but also why the method is designed that way, how its implementation fits into a larger system, and how experiments can establish trustworthy results.

    Working code and a strong final score are not sufficient evidence on their own. Reliable assessment requires method fidelity, system-level performance, resource costs, stability, and reproducibility to be considered together.

    For developers and enterprises, the most useful goal is not an apparently complete answer on the first attempt. It is a research implementation workflow that can be inspected, validated, and rolled back.