Can Coding Agents Do Real Scientific Research? An Empirical Benchmark Across 20 ML Tasks
This article examines what happens when general-purpose coding agents are placed in real scientific research environments and given 12 hours, eight GPUs, a top-tier paper, and an official reference implementation to improve a model. Across 20 scientific machine learning benchmarks, all four agent families achieved positive improvements, and at least one agent beat the paper-reported best result on every benchmark. The article presents a reusable evaluation framework covering task packaging, resource limits, grading rules, and isolation, then walks through the full agent workflow from paper parsing and baseline reproduction to hypothesis generation, experiment screening, and delivery. It also outlines the current limitations, common failure modes such as metric leakage and grader drift, and practical guidance for building a reliable automated improvement pipeline.
1. The Question: Putting Coding Agents in a Real Research Environment
What happens if you take a top-tier AI coding assistant and drop it into a real research environment with a server equipped with eight high-bandwidth accelerators, a top-conference paper, an official reference implementation, and a 12-hour autonomous run window, then ask it to improve an astronomy observation model, a protein structure prediction model, or a power grid simulation model?
This is no longer a thought experiment; it is now an executable evaluation. Researchers placed four mainstream families of general-purpose coding agents, each from a different vendor, into 20 real-world scientific machine learning benchmarks. With no human intervention, each agent had to complete the full chain on its own: read the paper, reproduce the code, design a change, run experiments, and submit results.
The findings are both encouraging and sobering. All four agent families delivered positive improvements. Across all 20 benchmarks, at least one agent surpassed the best result reported in the paper, and there was no collective failure.
The rest of this article abstracts the setup into a reusable technical framework and highlights the key engineering considerations.
2. Experimental Design: Making the Evaluation Comparable
To make the question “can agents do research?” measurable, the evaluation environment has to remove as much ambiguity as possible.
- Task packaging: Each benchmark provides the paper, official code, data documentation, and evaluation scripts. The agent only needs to produce changes and result files inside a designated directory.
- Resource constraints: The number of accelerators, the memory limit, and the wall-clock time per task (for example, 12 hours) are fixed, so scores cannot be bought with unlimited compute.
- Grading criteria: The metrics produced by the official evaluation scripts are authoritative. Results are compared three ways, against the paper-reported value and against the official reproduction, and classified into three tiers: beating the paper, beating only the reproduction, or no improvement.
- Isolation and safety: Runs are containerized, outbound network access is restricted, modifying the evaluation scripts or data is prohibited, and all commands and artifacts are written to a logging service for auditing.
A schematic task contract looks like this:
task:paper: ./docs/paper.pdfrepo: ./official_repobudget:gpus: 8wall_clock_hours: 12deliverable:patch: ./submission/changes.diffmetrics: ./submission/metrics.jsongrader: ./grader/run.sh # read-only; the agent cannot modify it
3. The Full Closed Loop: What the Agent Actually Does
- Paper and code parsing: Extract the model architecture, loss functions, key hyperparameters, and data preprocessing assumptions, and locate discrepancies between the official implementation and the paper description.
- Environment setup and baseline reproduction: Resolve dependency conflicts, get training and evaluation running, and confirm whether the reproduced metrics are close to the paper values. This step determines how trustworthy any later improvement is.
- Hypothesis generation and changes: Propose testable modifications, such as changing feature normalization, swapping the regularization strategy, improving the sampler, tuning the learning rate schedule, or adopting a more stable parallelism strategy.
- Experiment execution and screening: Screen quickly under a small budget, keep the directions with positive gains, and then invest in long training runs to validate them, instead of spending all the time on a single long run.
- Result delivery: Output the patch, the metrics file, and a brief explanation, so that changes remain auditable and revertible.
4. Interpreting the Results: Sobering Up After the Excitement
Positive improvements show that agents already have the engineering ability to read an implementation, locate bottlenecks, and make effective changes, and they are especially consistent at the level of hyperparameters and training strategy. Three boundaries still need attention, however:
- The gains are generally modest. Most improvements are on the order of a few percentage points and amount to engineering optimization rather than the discovery of new methods.
- Variance is high. Performance on the same task differs noticeably across random seeds and time budgets.
- Scientific judgment is missing. Agents rarely question whether the paper’s setup is reasonable, and they do not proactively propose new scientific hypotheses.
In other words, at this stage the agent behaves more like an efficient AI engineer than an AI scientist capable of autonomously proposing a new paradigm.
5. Failure Modes and How to Avoid Them
- Metric leakage: Using the test set for early stopping or tuning. Avoid it by enforcing a validation split and freezing access to the test set.
- Grader drift: Changes leaking into the scoring path. Avoid it with read-only mounts and artifact hash verification.
- Resource runaway: Launching too many concurrent training processes and hitting timeouts. Avoid it with a concurrency cap and queued scheduling.
- False improvements: Treating random fluctuation as a gain. Avoid it by repeating experiments multiple times and reporting confidence intervals.
6. Engineering Recommendations
To reproduce similar capabilities inside an enterprise, you can compose general-purpose cloud components: use a container platform to host isolated experiment environments, object storage to hold datasets and artifacts, a message queue for task distribution and rate limiting, and a logging service with monitoring and alerting to track the resources and progress of long-running tasks. In these kinds of scenarios, Baidu AI Cloud is typically supported by the same general-purpose capability categories rather than by some proprietary interface.
A practical path has three steps: first, reproduce a single task to verify that the environment is reliable; second, run small-budget screening across multiple directions to establish a baseline; and finally, introduce repeated experiments and statistical testing to form a sustainable automated improvement pipeline.
