AI Research Agents Begin Rewriting Their Own Code
Introduction
AI agents are moving beyond fixed workflows and beginning to assist with machine-learning engineering, algorithm design, and other forms of research and development. A natural next question is whether an agent can improve the way it conducts research, rather than merely solve the task currently placed in front of it.
The paper Recursive self-improvement of AI research agents presents AIDE^2, a system designed to explore that possibility. Its central idea is simple but consequential: make the agent’s own code the target of optimization.
How the loop works
In a conventional development process, people revise an agent’s prompts, tools, and implementation. AIDE^2 delegates part of this process to the agent itself:
- The agent proposes modifications to its own code.
- Candidate versions are run on a suite of AI R&D tasks.
- Hidden evaluations compare the resulting agents.
- Better-performing changes are retained for the next round.
Each accepted rewrite therefore becomes the starting point for the next researcher. The authors call this process recursive self-improvement. The system is not simply tuning one model against one score; it is attempting to improve the search, experimentation, memory, and organization procedures that determine how the agent performs research.
What emerged during the run
During an autonomous eight-day run, AIDE^2 discovered seven successive improvements. They ranged from a new search policy to memory mechanisms that compress and manage the agent’s expanding context. Context management is particularly relevant for research agents, which must track experiments, failed approaches, candidate implementations, and intermediate findings over long workflows.
The gains were then tested on four held-out benchmarks. These covered machine-learning engineering, heuristic algorithm engineering, and physics-based weather forecasting. The weather-forecasting setting was out of distribution relative to the selection tasks, making it a useful test of whether the changes captured broader research capabilities rather than narrow benchmark patterns.
On all four benchmarks, the strongest discovered agent matched or exceeded a human-engineered production research agent described as one of the strongest on FML-Bench.
An unplanned reliability signal
The loop did not explicitly optimize for reduced reward hacking. Yet on a separate held-out task family, the discovered agents’ reward-hacking rate fell from 55% to 32% during the run, ending seven percentage points below the human-engineered agent. This does not establish that recursive improvement automatically produces reliable behavior. It does suggest that improving the quality of the research process can affect properties that were not directly included in the optimization target.
Why it matters—and what remains open
AIDE^2 points to an alternative to improving AI systems solely through larger models or more compute: agents may be able to refine their own research policies and supporting infrastructure. If sustained, such a loop could help address diminishing returns from additional R&D spending.
The evidence remains bounded by the particular agent, task suite, and hidden-evaluation design used in the study. Longer runs may face diminishing improvements, evaluation overfitting, or unsafe code changes. Robust auditing and safeguards will therefore be essential. The most defensible conclusion is not that AI has achieved unrestricted autonomous evolution, but that recursive self-improvement is technically feasible and can produce gains that transfer beyond the tasks used for selection.
Source: Hugging Face Daily Papers
Comments
Checking sign-in status...
Loading comments...