Darwin Gödel Machine: Open-Ended Evolution of Self-Improving Agents
Authors: Jenny Zhang
Shengran Hu
Cong Lu
Robert Tjarko Lange
Jeff Clune
Venue: ICLR 2026 Poster (2026)
Keywords: Self-improving AI
Open-endedness
Primary area: transfer learning, meta learning, and lifelong learning

Abstract: Most of today's AI systems are constrained by human-designed, fixed architectures and cannot autonomously and continuously improve themselves. The scientific method, on the other hand, is a cumulative and open-ended system, where each innovation builds upon previous artifacts, enabling future discoveries. There is growing hope that the current manual process of advancing AI could itself be automated. If done safely, such automation would accelerate AI development and allow us to reap its benefits much sooner. This prospect raises the question of how AI systems can endlessly improve themselves while getting better at solving relevant problems. Meta-learning can automate the discovery of novel algorithms, but is limited by first-order improvements and the human design of a suitable search space. The Gödel machine proposed a theoretical alternative: a self-improving AI that repeatedly modifies itself in a provably beneficial manner. Unfortunately, proving that most changes are net beneficial is impossible in practice. We introduce the Darwin Gödel Machine (DGM), a novel self-improving system that iteratively modifies its own code (thereby also improving its ability to modify its own codebase) and empirically validates each change using coding benchmarks. Inspired by Darwinian evolution and open-endedness research, the DGM grows an archive of generated coding agents. It samples agents from this archive, which self-modify to create new, interesting versions of themselves. This open-ended exploration forms a growing tree of diverse, high-quality agents and allows the parallel exploration of many different paths through the search space. Empirically, the DGM automatically improves its coding capabilities (e.g., better code editing tools, long-context window management, peer-review mechanisms), increasing performance on SWE-bench from 20.0% to 50.0%, and on Polyglot from 14.2% to 30.7%. Furthermore, the DGM significantly outperforms baselines without self-improvement or open-ended exploration. All experiments were done with safety precautions (e.g., sandboxing, human oversight). Overall, the DGM represents a significant step toward self-improving AI, capable of gathering its own stepping stones along a path that unfolds into endless innovation.

Published as a conference paper at ICLR 2026
DARWIN GÖDEL MACHINE: OPEN-ENDED EVOLUTION OF SELF-IMPROVING AGENTS
Robert Lange Jeff Clune 2.12,4 'University of British Columbia Vector Institute Sakana AI 4Canada CIFAR AI Chair (jennyzzt, srhu, conglu) (cs. ubc. ca, robert @aaerrtssaaaaacccmm ai, jeff. clune@ubc. ca
Jenny Zhang .12
Shengran Hu -1,2, Cong Lu
ABSTRACT
Most of today's Al systems are constrained by human-designed, fixed architectures and cannot autonomously and continuously improve themselves. The scientific method, on the other hand, is a cumulative and open-ended system, where each innovation builds upon previous artifacts, enabling future discoveries. There is growing hope that the current manual process of advancing Al could itself be automated. If done safely, such automation would accelerate Al development and allow us reap its benefits much sooner. This prospect raises the question of how Al systems can endlessly improve themselves while getting better at solving relevant problems. Meta-learning can automate the discovery of novel algorithms, but is limited by first-order improvements and the human design of a suitable search space. The Gödel machine (Schmidhuber 2007) proposed theoretical alternative: a self-improving Al that repeatedly modifies itself in a provably beneficial manner. Unfortunately, proving that most changes net beneficial is impossible in practice. We introduce the Darwin Gödel Machine (DGM), a novel self-improving system that iteratively modifies its own code (thereby also improving its ability modify its own codebase) and empirically validates each change using coding benchmarks. Inspired by Darwinian evolution and open- open-endedness research, the DGM grows an archive of generated coding agents. It samples agents from this archive, which self-modify create new, interesting versions of themselves. This open-ended exploration forms growing tree of diverse, high-quality agents and allows the parallel exploration of many different paths through the search space. Empirically, the DGM automatically improves its coding capabilities (e.g., better code editing tools, long-context window management, peer-review mechanisms), increasing performance SWE-bench from 20.0% to 50.0%, and Polyglot from 14.2% to 30.7%. Furthermore, the DGM significantly outperforms baselines without self- improvement open-ended exploration. All experiments precautions (e.g.. sandboxing. human oversight). Overall, the DGM represents a significant step toward self-improving AI, capable of gathering its own stepping stones along path that unfolds into endless innovation.
done with safety
INTRODUCTION
Scientific progress is cumulative and open-ended, with each breakthrough standing on the shoulders of countless prior insights. In the same way, our most advanced Al systems are built upon a long lineage of innovations. For instance, transformers (Vaswani et al., 2017). the backhone of current large language models (LLMss) (Brown et al. 2020), did not emerge in isolation but were built upon years of past innovations, such as recurrent neural networks (Linnainmaal 1970, Amari 1972 Hopfield
1982 Rumelhart et al. 1985) and attention mechanisms (Schmidhuber & Huber 1990 Bahdanau
2015]Kim Kim al.) 2017] Parikh et al. 2016). However, most of today's s Al systems remain bound by fixed, human- human-designed architectures that learn within predefined boundaries, without the capacity to autonomously rewrite their own source code to self-improve. As result, each advancement in Al development still leans heavily on human interventions, tethering the pace of progress. This paper investigates the intriguing possibility safely automating the scarch for ever-better AI. One can
al. 2013]
"co-first authors
co-senior authors

---

Published as a conference paper at ICLR 2026
imagine an Al system that, like scientific discovery itself, becomes engine of its own advancement: building upon its past, recursively improving, and propelling itself toward more advanced capabilities.
Archive
Self-modify
Coding agent's own repo
Cinda Dvtt: Fessure 8
select
Dasting ngent
Sell-impeone instruction
improve hsalt
Coding
agent
New
coding
Treec GitHul repo)
child
agjant
add
Evaluate on benchmark
Task Instruction GitHub
Now cocling
Sollow baak
Cood Ditt:
g
Figure 1: Darwin Gödel Machine. The DGM iteratively builds a growing archive of agents by interleaving self-modification with downstream task evaluation. Agents the archive are selected for self-modification through open-ended exploration.
Schmidhuber (2007) presented a class of mathematically rigorous, self-referential, self-improving problem sol vers... relies on formal proofs justify code rewrites, ensuring that any self-modification is provably beneficial. However, in practice and without restrictive assumptions about the system, is impossible to formally prove whether a modification to an AI system will be beneficial. For example, while it may seem that an LLM-based coding agent would benefit from access more tools (e.g., code search, test runners), the actual impact depends heavily on the model's training and task context (c.g.. testing tool that is optimized for one setup may confuse the agent when working with others). Instead of requiring formal proofs, we empirically validate self-modification against a benchmark, allowing the system to improve and explore based observed results. This approach mirrors biological evolution, where mutations and adaptations are not verified advance but are produced, trialed, and then selected via natural selection. We also take inspiration from Darwinian evolution (Darwin) 2023) and investigate the effectiveness of maintaining a library of previously discovered agents serve stepping stones for future generations.
We propose the Darwin Gödel Machine (DGM), a self-referential, self-improving system that writes and modifies its own code become a better coding agent. Each modifiiiiiitiion requires the DGM to edit its own codebase. We use Python, which is juring-complee giving the DGM the potential to build any computable machine. Our framework envisions agents that can rewrite their own training scripts (including training new foundation model (FM)). However, we do not show that in this paper, as training FMs computationally intensive and would introduce substantial additional complexity, which we leave as future work. Instead, this paper focuses improving the design of coding agents with frozen pretrained FMs (e.g., tool use, workflows). The DGM alternates between self-mo mofifiiiiiattinn and evaluation phases. During the self-modification phase, selected coding agents from the archive generate modified versions of themselves. During the evaluation phase, each modified agent is tested coding benchmark, estimating the agent's coding capabilities, and then added to the archive. By improving its own capabilities through this loop, the DGM becomes better at both solving coding tasks and making future self-improvemments A key assumption is that an increase in performance on coding benchmarks indicates better coding capabilities, and hence better ability to self-modify and self-improve. Furthermore, the DGM maintains an archive of generated coding agents, initialized with only one agent, and continuously accumulates all generated variants over time. To support continual self-in aaff-improvement, the DGM draws inspiration from open- endedness research (Wang et al. 2019 Fernando et al., 2024, Faldor et al. 2025)). accumulating diverse stepping stones (i.e., interesting yet suboptimal solutions or features that may enable future
breakthroughs). This open-ended exploration encourages the discovery of novel and potentially useful self- modifications beyond immediate performance gains.
We present results on two coding benchmarks: SWE-bench (Jimenez et al. 2024) and Polyglot (Paul Gauthier 2024h. The DGM automatically improves itself from 20.0% to 50.0% on SWE-bench,
and from 14.2% 30.7% on Polyglot. We show that self-in oef--improvement enables continued progress, as the DGM outperforms the baseline where the same base agent is repeatedly used to modify and generate agents without self-improvemment. We also show that open-ended exploration and
2

---

Published as a conference paper at ICLR 2026
keeping an archive of all previously generated agents lead to the discovery of better coding agents. The DGM outperforms the baseline of not having open-ended exploration (i.c.. a baseline without the accumulation of an archive of interestingly different stepping stones), where the coding agent always builds off the most recent version of itself. Overall, the DGM represents a step toward Al systems that can build upon their own prior innovations and improve recursively. We consider and discuss safety aspects extensively, including sandboxing and traceability of self-modifications, to ensure responsible experimentation (Section { By advancing the possibility of safe, self-referential, self- improving models, the DGM moves us closer to AI that not only learns but evolves in an open- eeddee self- ceff-accelerating trajectory, much like science itself.
2 RELATED WORK
Open-Endee Beee-Endedness. A grand challenge for driving unbounded innovation is designing open-ended AI systems that continuously generate novel and learnable artifacts (Stanley et al. 2017). Hughes et al. (2024) characterized open-endedness as a system's 's capacity to generate sequences of artifacts that are both novel and learnable from an observer's perspective. A central difficulty lies in structuring and exploring vast search spaces to consistently produce artifacts that are interesting to humans (Clune 2019 Jiang et al., 2023). Early progress drew on quality-diversity algorithms, goal-directed ex- ploration, intrinsic motivation, and learning-proo proggess frameworks (Pugh et al. 2016 Ecoffet et al. 2019: Lehman & Stanley 2011 Oudeyer et al., 2007), while recent advances leverage large-scale foundation models (FMs) as proxies for human interestingness and versatile engines for generating and evaluating novel behaviors across diverse domains (Brown et al., 2020 Hu et al. 2025] Zhang et al. (2024b). However, these approaches have yet to close the self-referential self- self-improvement loop, meaning improvements on downstream tasks do not translate into enhanced capabilities for self-modification the acceleration of further innovations. We aim to mimic the acceleration of sci- ence and technology, where new tools and discoveries catalyze the creation of even more discoveries. How can emulate nature's 's are of evolution, which bends not only toward complexity but also an ever greater capacity to evolve (Dawkins) 2019 Gerhart & Kirschner 2007 Hendrikse et al. 2007
Meta-Learning FM Agents. Many FM-based agents are handcrafted. Some building blocks include
prompt engineering (Chen et al., 2023 Schulhofff et al.] (2024) chain-of- -houthttttttthh (Wei et al. 2022
Yao et al. 2023 Hu & Clune| 2024 et al. [025 | Lightman et (013) Muennighoff et al. 2025
Zelikman et al., 2024a), self-reflection (Shinn et al.] [023] Yao et al. [2023] Madaan et al.] 2023).
multi-agent debate (Zhuge al., 2023 Liang et al. [023 Khan et al.) [2024). memory (Liu et al. 2023
Zhong et al. 20244 Modarressi et al. 2023). temperature sampling (Zhu et al.) 2024), and retrieval
augmented generation (Lewis et al., 2020 The manual composition of these components limits
the system's s abilities to the ingenuity of its human designer. More recently, several meta- learnngg
approaches have emerged that leverage FM to automatically optimize prompts (Fernando et al.) 20244]
FAIR Khattab et al. 2023 Cheng et al. 22244] Yuksekgonul et al. [0244] Yuan et al., 2024) and
2024 Yin et al. [2024] |2024|Zhuge et al. 2024 Rosser & Foerster 2025| Zhang al.) 2025a Ye et al.
design agentic modules (Zhang et | [224c//Zhou et al.
2025 Gao al. 2025 Nie et al. 2025
Su et al. 2025] | et al. 20256 Nuu et al. 2025). The Automated Design of Agentic Systems
(ADAS. Hu al. (025)) iteratively generates downstream agents with a fixed meta-agent, evaluates them against a target benchmark, and incorporates feedback to refine subsequent generations. In
contrast, the DGM is single system that both solves downstream tasks (i.e., coding problems) and refines its own implementation (i.e., its codebase), removing the need for a fixed, handcrafted meta-agent and enabling self-referential improvements.
Self-Improving AI. Early on, various researchers outlined theoretical and conceptual approaches to self-improvement (Good] [966] (Schmidhuber 1987] 2007). Some practical approaches to automated
self-improvement include systems defined by neural network weight parameterizations (Schmidhuber
1993 Hall 2007 Hobbhahn 2025 Kirsch & Schmidhuber 2022 Irie el. 2022 2025] Lu et al.
2023 Havrilla et al. 2024b). Metz et al. (2021) developed a gradient-based optimizer that is self-
referentially meta-trained using a variant of population-based training (Jaderberg et al. [017]. Lange
et al. (2023) extended this approach to gradient-free learning. Silver et al. (2017) used self-play to continuously evolve agents, achieving superhuman performance in challenging domains such as chess and Go. More closely related to the DGM are recent approaches that leverage FM-based
agents for self-improvement (Yin et al.] 2024, Robeyns et al.] [0255] Hu et al. 2024) Zelikman
et al. 2024b; Huang et al. 2022
Singh et al. 2023). Zelikman et al. (2024b) use a meta-agent
3

---

Published as a conference paper at ICLR 2026
to generate downstream agents, updating the meta-agent based on the meta-utility derived from the generated solutions. Yin et al. (2024) use a single system to both solve downstream tasks and recursively modify itself. However, the downstream tasks or the meta-utility do not always align with the capabilities required for seff-improvement. In the DGM, improvement in downstream tasks directly reflects an increase in seff-improvement ability, enabling the potential for self-accelerating progress. Most similar is concurrent work by Robeyns et al. (2025). which also has a single agent recursively solving coding problems and modifying its own codebase. The main difference from Robeyns et al. (2025) (and also Zelikman et al. (2024b); Yin et al. (2024)) is that the DGM has an open-ended exploration loop, encouraging self modifiicatiiin beyond immediate performance gains and thus avoiding stagnation in suboptimal states. Appendix also discusses additional related work on program synthesis and Darwinian evolution.
DARWIN GÖDEL MACHINE
A Gödel Machine is a theoretical idea of an Al that searches for ways that provably improve itself (Schmidhuber] 2007). In this paper, we propose Darwin Gödel Machine (DGM), an attempt to realize the long-held dream of creating a Gödel Machine. The DGM relaxes the Gödel Machine's impractical requirement of theoretically proving that change will improve the system, instead requiring empirical evidence from experiments to demonstrate that a proposed new version enhances performance. Additionally, since the DGM relies on empirical evidence of improvement, it may get stuck in a local optimum within the vast search space of possible systems (i.e., all computable algorithms). To address this, the DGM maintains an archive of discovered solutions during the search, facilitating open-ended exploration rather than relying evolving a single solution. Since the principles echo Darwinian evolution (Darwin 2023) (Appendix B where new innovations emerge by selecting an entity from archive of previously discovered solutions, modifying it, and keeping it if it is interestingly new (Zhang et al. 2024b Faldor et al. 2025 Stanley & Lchman 2015). we
call our algorithm a Darwin Gödel Machine (Figure 1).
Self-referential Self-improvement of Coding Agents. The DGM is initialized with only one coding agent, and its progression is evaluated on coding benchmarks. A coding agent is defined a single system, implemented with a code repository and powered by frozen pretrained foundation models (FMs), capable of reading, writing, and executing code. Code, when expressed in a general-purpose Turing-complete language (e.g.. Python), is powerful medium for building and improving intelligent systems because it can represent any computable process. Recent works (Hu et al., [025 Zhang et al.) 2024c) demonstrate that such agents can be improved through meta-lcarning of their designs (c.g.. prompts, workflows, and tools), which are implemented in their code repository. Therefore, we define self-improvement as a coding task that involves modifying the design of an agent's 's own components (i.e., its own code, which does not include the open- exploration process described in the next paragraph). The key motivation is that the empirical evidence must reflect the system's 's ability to both self-improve and solve downstream tasks. By configuring the DGM as a coding agent and testing its coding capabilities, the observed improvements demonstrate not only enhanced performance in downstream tasks but also the capacity for further self- improvmmreee as self ielf-impprvement is fundamentally coding task that modifies the coding agent's 's own code repository.
Population-based Open-ended Exploration. Starting from a single initial coding agent, the DGM builds an archive of all discovered agents. In each iteration, the DGM selects parent agents to self- modify and branch off to produce new agents. Parent selection is roughly proportional to each agent's s performance score and inversely proportional the number of its children with codebase-editing functionality (Appendix (.2).. This favors high-performing agents that have been underexplored (i.e.. have fewer existing children). thereby promoting both exploitation of strong performers and exploration of promising but less-sampled lineages. All agents retain a non-zero selection probability, ensuring that any path to improvement remains feasible given sufficient compute. Each selected parent analyzes its own benchmark evaluation logs, proposes the next feature to implement, and receives this proposal as problem statement to execute (Appendix C.3). The parent then implements the suggested feature into its own codebase, generating new coding agent. Each newly generated agent is quantitatively evaluated on a chosen coding benchmark to estimate its coding abilities. Only agents that compile successfully and retain the ability to edit given codebase are added to the DGM archive, as only they can continue self-modification All others are discarded. The cycle of parent selection, self-modification, and evaluation continues, progressively growing the archive of
4

---

Published as a conference paper at ICLR 2026
solutions. Importantly, note that archived solutions can stepping stones that result in improvements much later than their original discovery, making our approach substantially different from hill-climbing agentic design approaches (Robeyns al. 2025). Currently, the open- open-ended exploration process (i.e., archive maintenance, parent selection) is fixed and not modifiable by the DGM, which we leave an avenue for future work. Appendix C.4shows the pseudocode for the DGM algorithm.
4
EXPERIMENTS
Section 4.1 describes the experimental setup, including the initial coding agent that initializes the DGM. We conduct experiments on two coding benchmarks: SWE-bench (Jimenez et al.) (024 and Polyglot (Paul Gauthier (024) (Section 4.2). For each benchmark, we compare the DGM against two baselines: DGM without self-imppoving agents and DGM without open-ended exploration (Section 4.3) Across all experiments, we find that the DGM outperforms both baselines, showing that the self-improvement mechanism and open-ended exploration are essential for sustained performance gains (Section 4.4). Furthermore, we show that the features discovered by the DGM transfer across models, benchmarks, and tasks (Section 4.4).
4.1 EXPERIMENT SETUP
The DGM initialized with single coding agent. This base agent is built around a frozen FM and augmented with tool use capabilities (Schick et al.] 2023 Anthropic 2024b). The FM autonomously determines its action at each step, using whichever tool deems appropriate. The base agent has access to two tools: a Bash tool for executing bash commands, and an edit tool for viewing and editing directories and entire files (Appendix C.I). The agent receives a single input prompt that specifies the location of the target repository, the problem statement, and the repository's 's testing framework (Appendix C.T). The base agent intentionally lightweight to provide a simple starting point from which self- imprommproeetntt can be clearly demonstrated. We run the DGM for 80 iterations (generating one new agent per iteration). with two iterations running in parallel for SWE-bench and four for Polyglot (Appendix C.2). During seff-modifications, coding agents are powered by Claude 3.5 Sonnet (New) (Anthropic] (024a) in both SWE-bench and Polyglot experiments. During benchmark evaluation, coding agents are powered by Claude 3.5 Sonnet (New) for SWE-bench and 03-mini OPenAl 2025) for Polyglot (Appendix D.I).
4.2 BENCHMARKS
We evaluate the DGM on two popular benchmarks that assess different aspects of coding tasks to validate the algorithm's effectiveness across various use cases. Both SWE-bench and Polyglot are benchmarks that evaluate how well Al agents solve coding tasks automatically. Given code repository and task instruction, the agent is expected to make changes to the repository in order to fulfill the task. Both SWE--bnch and Polyglot are widely used benchmarks (Zhang et al. 2024d a Xia et al. 2024 Cao al. 2024 Google DeepMind, 2025 Gauthier 2024) that require the Al agent to navigate a code repository. understand the interplay between functions in different files, and spot small errors in convoluted code. SWE-bench only has Python tasks, while Polyglot has tasks in multiple programming languages. Another difference is that each SWE-bench task may require edits to multiple files, whereas each Polyglot task primarily involves implementing a solution from scratch in single file (although the agent still needs to examine other files to understand what changes are necessary), resulting in fewer file edits overall.
SWE-bench. To avoid wasting compute unsolvable tasks, we use SWE-bench Verified (OpenAl 2024), human-filtered subset of SWE-bench (Jimenez et al. 2024) where all tasks are solvable. Throughout this paper, the term SWE-bende refers by default to to the SWE-bench Verified subset.
Polyglot. Polyglot includes tasks in multiple programming languages (C++, Rust, Python, etc.) (Paul Gauthier 2024). Compared to SWE-bench, one of the most widely used coding benchmarks and likely included in the training sets of FMs, Polyglot is more niche and less likely to be included in FMs' post-training data. Additionally, Polyglot is primarily used by its developer to evaluate Aider (Gauthier] (024)). This provides an opportunity to compare automatically designed agents with representative coding agent in the community, which has been continuously developed and tested
5

---

Published as a conference paper at ICLR 2026
against the Polyglot benchmark over a year by human developers. Finally, Polyglot enables testing of the DGM's ability to generalize across multiple programming languages beyond just Python. We follow the Polyglot leaderboard setup (Paul Gauthier 2024), with one key difference: the leaderboard reports pass @, where the agent can view feedback from ground-truth tests once, whereas we report pass @1 1, where the agent never sees ground-truth test results.
Since it is expensive to evaluate on the full benchmarks (Appendix E.1 we use a staged evaluation strategy to estimate the coding agent's is performance. In general, we evaluate the coding agent on more tasks when we are more confident that it is a relatively strong performer. We first evaluate each coding agent on a set of 10 tasks verify basic sadebase-editingg functionality. Only agents that retain the ability to edit code can solve downstream coding tasks or perform further self- modifications, Agents that pass this initial stage are then evaluated on an expanded set of 50 tasks. thhennh-verified--ee
For SWE-bench, tasks are selected based on designed to be a representative sample of the full benchmark (Appendix For Polyglot, tasks are chosen as random subset of the full benchmark (Appendix E.3). Because the LLMs we use are inherently stochastic, performance can be noisy. We use smaller subset evaluations to estimate general effectiveness and identify top candidates. For SWE-bench, if coding agent achieves over 40% success (a heuristic chosen based on the noise observed in preliminary runs) on the 60-task subset and ranks among the top two performers in the archive, it is then evaluated on 200 tasks (140 plus the previous 60) to more accurately assess its true coding capability (Appendix [E22). For Polyglot, if a coding agent achieves over 40% success on the 10-task subset, it is evaluated on an expanded 50-task subset (Appendix E.3
(Hobbhahn 2025), which is
4.3 BASELINES
To isolate and evaluate the contribution of the DGM's core components, we compare the DGM against two baselines: DGM without self-improving agents (DGM w/o self-improve) and DGM without open-ended exploration (DGM w/o open-ended exploration). DGM w/o self- self-improve replicates the approach of ADAS (Hu et al. 2025) in this setting, wherein the meta agent responsible for modifying the coding agents remains fixed the base agent throughout the experiment (Algorithm 2 This baseline allows us to assess the role of iterative self- iifi-moproeeettt in accelerating the evolution of better coding agents. DGM w/o open-ended exploration eliminates the use of an archive and always self-modifies the latest stored version of itself (Algorithm 3) If a coding agent self-modifies to the point where it loses the basic functionality required to edit codebase, it can longer modify itself or solve any coding task. Therefore, DGM w/o open-ende ween-ended exploration retains the latest version of itself that still maintains the basic functionality for codebase editing. This baseline allows us to evaluate the impact of having
archive and the well-documented beneficial principles of open-ended exploration (Clune 2019 (taanlyy& & Lehman| 2015 Zhang et al.. 2024b Fernando et al., 2024 Lee al. 2020 Samvelyan et al. 2024; Colas et al. (022b) in guiding the agent's evolution.
In addition to the learned baselines, we compare the DGM against handcrafted. open-source solutions. For SWE-bench, we take the state-of-the-are (SoTA) open-source solution that has been checked (i.e., the SWE-bench team was able to reproduce the results) (Appendix EE.4). For Polyglot, we take the representative agent (Aider) (Gauthier (024), which is sourcseurced and designed to support multiple programming languages and large codehase editing (Appendix (E.)). For a fair comparison, we measure the percentage of solved tasks the same benchmark subsets used to evaluate the DGM (Appendix E.2. Appendix E.3). These values are shown as dotted horizontal lines in Figure 2
4.4 RESULTS
After 80 iterations of the DGM, the coding agent's performance increases from 20.0% to 50.0% on SWE-bench, and from 14.0% to 38.0% on Polyglot (Figure Since the DGM is evaluated on only 50 tasks in the Polyglot experiment setup (Section 4.2). we additionally evaluate both the base agent and the best DGM-discovered agent on the full Polyglot benchmark to more accurately estimate the improvement. On the full Polyglot benchmark, the DGM improves the coding agent from 14.2% to 30.7%. This shows that the DGM can automatically self-improve to create a better coding agent. Moreover, the performance of the best DGM- open- open-source, human-designed SoTA on SWE- (Figure 2). On Polyglot, although the DGM starts with base agent whose performance is lower than that of Aider, it discovers an agent that far
agent is comparable to that of the checked,

---

Published as a conference paper at ICLR 2026
SWE: De-bbench Score of Best Agent
0.50
DGM wro Open-ended exploration
Checked Openssourced
Regresentative Agent Baseline (Aider)
DGM Setf-impreve
Polyglot Score of Best. Agent
0.45
0.40
0.35
0.25
0.30
0.20
0.25
0.20
0
10
20
30
60
50
60
70
80
10
20
30
40
50
60
70
Iterations
Iterations
Figure 2: Self-improvement and open-ended exploration enable the DGM to continue making progress and improve its performance. The DGM automatically discovers increasingly better coding agents and performs better both (Left) SWE-bench and (Right) Polyglot. It outperforms baselines that lack either self-improvement or open-ended exploration, showing that both components are essential for continual self-improvement. These scores obtained from evaluating the benchmark subsets detailed in Section 4.2
DOM Progress
SWE
0.50
Average of Archive
0.45
Linsage Agent
0.4
SWE: BrEebbenchhc Score
0.40
jetchgaastire
0.35
0.30
Novernury panch
rading
2
300 tekko boc.n/-004
0.25
Hone craiy
10
20
40
80
Iterations
Figure 3: The DGM automatically self-improves to become a better coding agent. (Left) Archive of coding agents generated during the DGM agent, with node 0 corresponding to the base agent. Node color indicates performance on SWE-bench (percentage of solved tasks). while border color reflects the number of tasks for which the agent was evaluated. Edges show which agents self-modified to produce the offsprings. Many paths to innovation traverse lower-perii pever-performing nodes, and key innovations (like node 24) lead an explosion of innovations built on top of them. Both properties underscore the benefits of open-ended search. (Right) Progress plot of the DGM on SWE-bench. The light blue line shows the average score of all agents possessing basic codebase-editing functionality. The blue line tracks the best score achieved by any agent the archive each iteration. The dark line shows lineage the final best-discovered agent and its precursor nodes, which includes two performance dips. This illustrates the benefits of open-ended search, which explores a diverse set interesting stepping stones instead of focusing only branching off the best solution found so far.
SWE-bench. Each node represents coding
surpasses Aider (Figure 2). The DGM-discovered agents comparable to outperform handcrafted agents on both benchmarks. While the SoTA SWE-bench agent and Aider were painstakingly shaped by human efforts, the DGM hints at future in which such ingenuity is automated, evolving through self-referential cycles of continuous self-ine fnff-improveeetts.
The DGM automatically improves both the tools and the workflow of how FMs utilized (Figure 3) For example, the DGM enhanced the edit tool to allow more granular file viewing (by lines) and more precise file editing (by string replacement), instead of always viewing replacing the entire
7

---

Published as a conference paper at ICLR 2026
file. Workflow improvements include making multiple attempts to solve task and using another FM to evaluate and select the best solution. Other workflow improvements include considering previous attempts when generating subsequent ones. Appendix F.T and Appendix F2 show all modifications leading up to the final best-discovered agents on SWE-hench and Polyglot respectively.
Because open-ended exploration allows branching from any agent in the archive with non-zero probability, the DGM can get out of deceptive dips or peaks in performance. For example, at iterations and 56 of the experiment on SWE-bench, although the agent's 's score temporarily fell below that of its parent, the DGM was still able to explore innovations along that path and create a new agent that outperformed all of its predecessors (Figure Furthermore, open exploration allows different implementations of the same target functionality to be attempted. For example, while the goal to provide fine-ggrinne editing tools, the specific implementation of this feature can vary greatly and hence lead to very different performance (Appendix G The DGM can explore multiple implementations to find the most suitable one and avoid getting trapped in suboptimal one.
The DGM outperforms the baselines of DGM w/o self-improve and DGM w/o open-ended exploration on both benchmarks (Figure 2) Without updating the meta agent that modifies coding agents, DGM w/o self-improve improves the agents in early iterations, but its gains taper off quickly (Appendix A In DGM w/o open-ended exploration, only the most recent agent is retained, so a poorly performing self- coff-modification makes subsequent improvements harder to achieve (Appendix I..
Model Thansder SWi-bench
Zero-shot Thansfer Between Denchmariss
Task Transfer Polygiot
ex
SAc0O0 Rote or sr- bereh
38.5%
33.755
11.0%%
25.0%
2..%%
11.9%
N.
24.20
10
22
03tt11 Ceutu Scrent Caodu Streat
Sw5barch
oythan lax
mongython Lak
2000 soent
b-st agent
3350 spert
opent searched winh Sernet
opert en sWittterch
Figure 4: Transfer between Models, Benchmarks, and Tasks. The superior performance of DGM-discovered agents can be transferred across (Left) different models, (Middle) benchmarks, and (Right) different programming language tasks in Polyglot, such as from Python tasks to C++ tasks.
To evaluate the generality of the improvements from the DGM, we tested the base agent (Section 4.1 and the best agent discovered during the DGM run (Figure 2 with different FMs than those used during optimization. For SWE-bench, where the DGM was run using Claude 3.5 Sonnet (New), we replaced the FM with Claude 3.7 Sonnet (Anthropic 2025) or o3-mini, and evaluated on 200 tasks (Figure Left). With 03-mini, the base agent achieved 23.0% and the DGM-discovered agent 33.0%. With Claude 3.7 Sonnet, the base agent achieved 19.0% and the DGM-discovered agent 59.5%. These results suggest that the DGM yields improvements that generalize across FMs, rather than being tightly coupled to the specific FM used during its run (Figure Model transfer results on Polyglot are presented in Appendix A.2
Furthermore, we investigate the transferability of the DGM-discovered agent across different bench- marks and programming languages. First, we evaluate the best DGM-discovered agent from one benchmark (e.g., SWE-bench) on a completely held-out benchmark (e.g., Polyglot), and vice versa (Figure Middle). The best agent evolved on SWE-bench achieves 28.9% on Polyglot, compared to the initial agent's baseline of 14.2%. Conversely, the best agent evolved on Polyglot achieves 24.5% on SWE-bench, outperforming the original baseline of 20.0%. Since each agent was optimized without ever accessing the alternate benchmark, these evaluations represent truly held-out tests. The consistent performance gains across benchmarks support our claim that DGM's improvements reflect general skill acquisition rather than overfitting exploitation of benchmark-spect specific artifacts. Second, we experiment with a version the DGM trained exclusively on Python tasks from Polyglot and then transfer the discovered agent to tasks in other languages. Focusing primarily on Python tasks slightly improves performance on Python tasks but reduces performance on non-Python tasks compared to the DGM trained all languages (Figure 4 Right). However, after being transferred from Python to other unseen languages during the search, the agent still achieves performance comparable to that of the DGM trained on all languages and substantially outperforms both the base agent and Aider.
8

---

Published as a conference paper at ICLR 2026
These results demonstrate the robustness of the discovered improvements, showing that they do not overfit to a specific programming language. We also present additional results in Appendix (A]
5 SAFETY DISCUSSION
Systems capable of improveerveeettt.... such as the DGM, represent a step toward more autonomous Al development, aligning with long-standing goals in the field of making capable Al that can benefit humanity (Schmidhuher 1987, Clune 2019 Markoff | Lehman 2023). However, this capability introduces unique safety considerations stemming from the system's s ability to autonomously modify its own code. Modifications optimized solely for benchmark performance might inadvertently introduce vulnerabilities or behaviors misaligned with human intentions, even if they improve the target metric (Bostrom] 2020). In particular, if evaluation benchmarks do not fully capture all desired agent properties (c.g., safety and robustness), the self-impp infrommproeeentt loop could amplify misalignment over successive generations. Iterative aeff-modification could also lead to increasingly complex and uninterpretable internal logic, hindering human understanding, oversight, and control (Sheth et al.
2025
Anwar et al. 2024 Greenblatt et al. 2024 Ganguli et al. 2022).
Recognizing these challenges, the current implementation and experimental setup of the DGM incorporates several safeguards. All agent execution and self-modification processes are conducted within isolated sandboxed environments, limiting their ability to affect the host system, and thereby mitigating the risk of unintended actions. Each execution within the sandbox is subjected to strict time limit, reducing the risk of resource exhaustion or unbounded behavior. The self-immprvemmnt process is currently confined to the well-defined domain of enhancing performance on specific coding benchmarks by modifying the agent's own Python codebase, thus limiting the scope of potential modifications. Additionally, we actively monitor agent performance and code changes, with the DGM archive providing a traceable lineage of modifications for review. At this stage, we have found no evidence of harmful or malicious behavior in the generated agents, and the self eeff-modiiicttions have been primarily focused on improving coding capabilities.
Conversely, significant potential benefit of the self improvement paradigm is that it could, in princi- ple, be directed toward enhancing safety and interpretability themselves. We conduct a preliminary investigation into how the DGM can be deployed in Al safety settings to develop countermeasures for FM hallucination (Appendix H). Just as the DGM learns to improve its coding capabilities, could potentially discover and integrate better internal safeguards modify itself for greater transparency (e.g., incorporating principles akin to Constitutional AI (Bai et al. (022)). if such properties were included in its evaluation criteria (Rosser& & Foerster 2025). This suggests a promising, albeit challenging, pathway in which self- cel--improvement becomes a tool for building more trustworthy AI systems. Additional research could also explore weaving Constitutional Al from the start, though the challenge would be incentivizing the system to retain these directives (an option worth exploring to create an unmodifiable part of the system to able to evaluate at halt the rest).
The DGM demonstrates the potential of self-improving AI while still operating within safe research boundaries due to the current limitations of frontier FMs and effective mitigations like sandboxing. Appendix ! presents additional discussion on broader safety uncertainties. We include this safety discussion proactively to raise awareness about the emerging prospect of self-improving AI systems and their associated safety implications. particularly these systems inevitably become more capable (Yudkowsky et al. 20088) [Bostrom] 2002 Ecoffet et al. 2020: [engio et al., 22224] Clune 2019). Accordingly, we advocate for continued investigation into the safe and beneficial evolution of Al-Generating Algorithms (Clunc 2019) and self-improving systems.
6 CONCLUSION AND LIMITATIONS
We introduce the Darwin Gödel Machine (DGM), the first self-improving system powered by FMs with open-ended exploration, where progress on its evaluation benchmarks can directly translate into better improvmmpoveeentt capabilities. We demonstrate the automatic discovery of better tools and FM systems, resulting in better performance two benchmarks: SWE- beEhbenchh and Polyglot. Through self-improvemeett and open-ended exploration, the DGM shows a continuous increase in performance, bringing one step closer to self-accelerating, self-improving Al systems.

---

Published as a conference paper at ICLR 2026
We demonstrate that the DGM autonomously achieve performance par with openly available solutions. However, it still falls short of closed-source SoTA SWE-bench solutions. An open question is whether rumning the DGM for longer would continue to yield performance gains and eventually surpass closed-source solutions. These closed-source solutions often rely on elaborately handcrafted techniques developed by teams of highly skilled experts. Since FMs have yet to match the capabilities of such experts (e.g., in reasoning), the DGM currently requires extensive compute to discover improvements. A single run of the DGM on SWE-bench, as presented in Section takes about weeks and incurs significant API costs (Appendix E.I). We hypothesize that further progress will require more efficient use of computational resources and the development of better reasoning skills.
Since this version of the DGM is mainly powered by FMs, it is inherently limited by the capabilities of the underlying FM. Hence, an exciting future direction is to extend self-modification beyond just prompts or FM workflows, to include more computationally intensive methods, such as rewriting its own training script to update the FM itself. While this version of the DGM focuses on coding, AI systems are increasingly applied across wide range of domains (e.g., computer vision, creative writing), Another promising extension is to develop self-improving AI systems capable of enhancing themselves beyond just the coding domain. A key assumption in this work is that coding benchmarks are a good reflection of the agent's ability to self-improve, since the self modification task requires the agent modify its own codebase. However, one could envision co-evolves the target task distribution (Faldor et al.] 2025 Wang et al.) 2023c), thereby removing the constraint of self-improvement being tied to single objective, as in open-ended processes. Appendix presents additional potential directions for future work. As we continue to explore this
alternative approach that
powerful technology, must also keep safety front and center, discussed in Section [
In conclusion, the DGM represents a significant step toward the automation of AI development through self-improving systems capable of editing their own codebase. While current limitations in compute and reasoning constrain its full potential, continued advances in FMs and infrastructure may unlock more powerful and general-purpose self-improvements: Provided that the safety concerns are carefully navigated (Section 55. the future of self-improving Al systems and AT-Generating Algorithms (Clune 2019) holds immense promise to open-endedly evolve AI, continually rewriting or retraining itself in pursuit of greater capabilities aligned with human values.
10

---

Published as a conference paper at ICLR 2026
ETHICS STATEMENT
We affirm compliance with the ICLR Code of Ethics. This work studies self-improving Al systems in the limited context of code-editing agents evaluated on standard programming benchmarks. No human subjects were involved and no personally identifiable information (PII) was collected or processed; IRB approval was therefore not required.
Safety and misuse. Self-modifying systems can pose safety risks if allowed to act without constraints or if optimizations inadvertently introduce unsafe behaviors. To mitigate this, all agents our experiments ran inside isolated sandboxes with strict resource and time limits; agents had limited network access and no ability to modify the host environment. The self-improvement scope was restricted to the agent's 's own Python codebase and evaluation harnesses. We maintained complete, auditable lineage (archive) code changes and evaluations, enabling rollback and post-hoc analysis. We did not deploy discovered agents in real development environments. Our release plan (code, prompts, and evaluation artifacts) will exclude any components that grant elevated system access and will include default sandboxing, guardrails, and clear documentation of intended use.
Dual-use, downstream impact, and limitations. Stronger autonomous coding agents could be dual-use (e.g., aiding software maintenance, but also potentially facilitating creation of harmful code misapplied). We believe the research benefits (e.g., advancing methods for controlled, auditable self-improvement and demonstrating practical safeguards) outweigh the risks. Nevertheless, we explicitly discourage security-sensitive or unsandboxed deployment and provide concrete safety recommendations (Section 5). Our empirical focus on benchmark optimization may not capture all desirable properties (robustness, interpretability. or broader social values). We therefore treat benchmark gains as necessary but insufficient indicators of general AI development, and discuss avenues to integrate other objectives (e.g., safety, reasoning) into the optimization loop.
Data governance, IP, and licensing. We evaluate on SWE-bench Verified and Polyglot, which are composed of open-source repositories and tasks. We complied with dataset licenses and usage terms to the best our knowledge. We did not introduce or distribute proprietary code. Foundation models (FMs) were accessed via provider APIs under their terms of service; we did not submit sensitive data, nor attempt to circumvent usage policies. Logs released with this work will be scrubbed of API keys and any incidental sensitive strings.
Bias, fairness, and equity. Although our domain is software code rather than cenaan-centerd text, FM behavior can still reflect biases (e.g., language ecosystem preferences) and may unevenly benefit communities whose tooling is better represented training data. We partially address this by evaluating across multiple languages (Polyglot) and reporting cross-benchmark transfer. Future work should add diagnostics for biased failure modes and include broader, community-drivee task sets.
Confficts of interest and funding. No author has financial interest in products whose performance is evaluated here. Sponsors and employers did not influence experimental design, analysis, or the decision to publish, beyond providing salary or standard research support. Any external compute or API credits are acknowledged in the appendix.
REPRODUCIBILITY STATEMENT
We will open-source all code and full agent logs, including the complete archive lineage of self- modifications (diffs, prompts, and configs) as well as the evaluation harness. To support exact repli- cation, we reference the following: algorithmic details and pseudocode (Section 3 Appendix C.44) parent selection and open-ended exploration settings (Appendix C.2); foundation model choices and hyperparameters (Appendix DD benchmark task subsets for SWE-bench and Polyglot (Ap- pendix F..2. Appendix [.:3); staged evaluation protocols and scripts (Section 4.20; implementations and difis for the best discovered agents (Appendix[E) [F.I] Appendix F2); and compute and cost estimates
(A (Appendix [.T.. The released code repository will include environment specifications and scripts to reproduce all results, figures, and tables.
11

---

Published as a conference paper at ICLR 2026
ACKNOWLEDGMENTS
This research was supported by the Vector Institute, the Canada CIFAR Al Chairs program, grant from Schmidt Futures, an NSERC Discovery Grant, and a generous donation from Rafael Cosman. Resources used in preparing this research were provided, in part, by the Province of Ontario, the Government of Canada through CIFAR, and companies sponsoring the Vector Institute httpr//nnniiiutaaaaapaterrssieie paatterrrent-atttesss... Any opinions. findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the sponsors. We also thank Aaron Dharna, Ben Norman, Cédric Colas, Sam Devlin, and Shyam Sudhakaran for insightful discussions and feedback.
REFERENCES
Fuma Aki, Riku Ikeda, Takumi Saito, Ciaran Regan, and Mizuki Oka. Llm-poet: Evolving complex environments using large language models. In Proceedings of the Genetic and Evolutionary Computation Conference Companion, pp. 243-246 2024.
Rajeev Alur, Rishabh Singh, Dana Fisman, and Armando Solar-Lezama. Search-based program synthesis. Communications of the ACM, 61(12):84-93 2018.
S-I Amari. Learning patterns and pattern sequences by self-organizing nets of threshold elements. IEEE Transactions on computers, 100(1 (00(11):117-1206, 1972.
Marcin Andrychowicz, Filip Wolski, Alex Ray, Jonas Schneider, Rachel Fong, Peter Welinder, Bob McGrew, Josh Tobin, OpenAI Pieter Abbeel, and Wojciech Zaremba. Hindsight experience replay.
Advances in neural information processing systems, 30, 2017.
Anthropic.
https: / /wwww www.aattrroicc.com/mme c claude-3-5- 3-5- sonneet June 2024a. [Accessed 17 April 2025].
Claude
3.5 Sonnet.
Anthropic. Claude can now tools. May 2024b. URL https:/ http:::/wwww.nttropp.c..oo
news/tool-uset Accessed: 2025-05-03.
Anthropic. Claude 3.7 somnet and claude code, February 2025, sonnet Accessed: 2025-05-06.
com/ www./wwwwwaseee
Usman Anwar, Abulhair Saparov, Javier Rando, Daniel Paleka, Miles Turpin, Peter Hase, Ekdeep Singh Lubana, Erik Jenner, Stephen Casper, Oliver Sourbut, al. Foundational challenges in assuring alignment and safety of large language models. arXiv preprint arXhv:2404.09932. 2024.
Dzmitry Bahdanau, Kyung Hyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representutions, 2015.
Yuntao Bai, Saurav Kadavath, Sandipan Kundu, Amanda Askell, Jackson Kernion, Andy Jones, Anna Chen, Anna Goldie, Azalia Mirhoseini, Cameron McKinnon, et al. Constitutional AI: Harmlessness from Al feedback. arXiv preprint arXiv:2212.0800 2022.
Adrien Baranes and Pierre-Y Oudeyer. Active learning of inverse models with intrinsically motivated goal exploration in robots. Robotics and Autonomous Systems, 61(1):49-77) 43,973,,475 2013.
Shraddha Barke, Emmanuel Anaya Gonzalez, Saketh Ram Kasibatla, Taylor Korg-Kirkpatrick. and Nadia Polikarpova. Hysynth: Context-free Ilm approximation for guiding program synthesis. Advances in Neural Information Processing Systems. 37:15612-15645. 2024.
Yoshua Bengio, Geoffrey Hinton, Andrew Yao. Dawn Song, Pieter Abbeel, Trevor Darrell, Yu- val Noah Harari, Ya-Qin Zhang, Lan Xue, Shai Shalev-Shwartz, et al. Managing extreme Al risks amid rapid progress. Science, 384(6698):842 845, 2024.
N Bostrom. Existential Risks: analyzing human extinction scenarios and related hazards. Journal of Evolution and Technology, 9, 2002.
Nick Bostrom. Ethical issues in advanced artificial intelligence. Machine Ethics and Robot Ethics,
pp. 69-75, 2020.
12

---

Published as a conference paper at ICLR 2026
Herbie Bradley, Andrew Dai, Hannah Benita Teufel, Jenny Zhang, Koen Oostermeijer, Marco Bellagente, Jeff Clune, Kenneth Stanley, Gregory Schott, and Joel Lehman. Quality-diversity through ai feedback. In The Twelfth International Conference on Learning Representations, 2024.
Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901, 2020.
Jake Bruce, Michael Dennis, Ashley Edwards, Jack Parker-Holder, Yuge Shi, Edward Hughes, Matthew Lai, Aditi Mavalankar, Richie Steigerwald, Chris Apps, et al. Genie: Generative interactive environments. Forty-first International Conference on Machine Learning. 2024.
J Richard Buchi and Lawrence H Landweber. Solving sequential conditions by finite-state strategies. In The collected works of J. Richard Bücchi, pp. 225-541. Springer, 1990.
Ruisheng Cao, Fangyu Lei, Haoyuan Wu, Jixuan Chen, Yeqiao Fu, Hongcheng Gao, Xinzhuang Xiong, Hanchong Zhang, Wenjing Hu, Yuchen Mao, et al. Spider2-v: How far are multimodal agents from automating data science and engineering workflows? Advances in Neural Information Processing Systems, 37:107703-107744, 2024.
Konstantinos Chatzilygeroudis, Antoine Cully, Vassilis Vassiliades, and Jean-Baptiste Mouret. Quality-diversity optimization: a novel branch of stochastic optimization. Black Box Op- fimization, Machine Learning, and No-Free Lunch Theorems, pp. 109-135. Springer, 2021.
Banghao Chen, Zhaofeng Zhang, Nicolas Langrené, and Shengxin Zhu. Unleashing the poten- tial of prompt engineering in large language models: a comprehensive review. arXiv preprint arXiv:2310. 14735, 2023.
Ching-An Cheng, Allen Nie, and Adith Swaminathan. Trace is the next autodiff: Generative optimization with rich feedback, execution traces, and llms. Advances in Neural Information Processing Systems, 37:71596-71642, 2024.
Jeff Clune. AI-GAs: Al-generating algorithms, an alternate paradigm for producing general artificial intelligence. arXiv preprini arXiv: 190::/9950.9. 2019.
Cédric Colas, Pierre Fournier, Mohamed Chetouani, Olivier Sigaud, and Pierre-Yve Oudeyer. Curious: intrinsically motivated modular multi-goal reinforcement learning. International conference on machine learning, pp. 1331-1340. PMLR, 2019.
Cédric Colas, Tristan Karch, Clément Moulin-Friee Frier, and Pieme- Yves Oudeyer. Language and culture internalization for human-like autotelic AI. Nature Machine Intelligence, 4(12): 1068-1076, 2022a.
Cédric Colas, Tristan Karch, Olivier Sigaud, and Pierre-Y Oudeyer. Autotelic agents with intrinsically motivated goal-conditioned reinforcement learning: short survey. Journal of Artificial Intelligence Research, 74:1 1111159-119 1199, 2022b.
Cédric Colas, Laetitia Teodorescu, Pierre ves Oudeyer, Xingdi Yuan, and Marc-Alexandre Côté. Augmenting autotelic agents with large language models. In Conference on Lifelong Learning Agents, pp. 205-226. PMLR, 2023.
Rémi Coulom. Efficient selectivity and backup operators in monte-carlo tree search. In International conference on computers and games, pp. 72-83. Springer, 2006.
Charles Darwin. Origin of the species. In British Politics and the environment in the long nineteenth century, pp. 47-55. Routledge, 2023.
Richard Dawkins. The evolution of evolvability. In Artificial life, pp. 201-220. Routledge, 2019.
Michael Dennis, Natasha Jaques, Eugene Vinitsky, Alexandre Bayen, Stuart Russell, Andrew Critch, and Sergey Levine. Emergent complexity and zero-shot transfer via unsupervised environment design. Advances in neural information processing systems, 33: 33:13049-33061. 2020.
Aaron Dharna, Cong Lu, and Jeff Clune. Quality- Diversity Self-Play: Open- Strategy Innova- tion via Foundation Models. In NeurIPS 2024 Workshop on Open- Open-World World Agents, 2024.
13

---

Published as a conference paper at ICLR 2026
Li Ding, Jenny Zhang, Jeff Clune, Lee Spector, and Joel Lehman. Quality diversity through human feedback: towards open open-ended diversity-driver optimization. In Proceedings of the 41st International Conference Machine Learning, pp. 11072-11090, 2024.
Theodosius Dobzhansky. Genetics of the evolutionary process, volume 139. Columbia University Press, 1970.
Adrien Ecoffet, Joost Huizinga, Joel Lehman, Kenneth O Stanley, and Jeff Clune. Go-explore: a new approach for hard-exploration problems. arXiv preprint 1909v9990..10955, 2019.
Adrien Ecoffet, Jeff Clune, and Joel Lehman. Open questions in creating safe open-ended AI: tensions between control and creativity. In Artificial Life Conference Proceedings 32, pp. 27-35. MIT Press One Rogers Street, Cambridge, MA 02142-1209, USA journals-info .... 2020.
Adrien Ecoffet, Joost Huizinga. Joel Lehman, Kenneth O Stanley, and Jeff Clune. First return, then explore. Nature, 590(7847):580-5888 2021.
Anthony W Fisher Edwards. The genetical theory of natural selection. Genetics, 154(4):1499-1466 2000.
Kevin Ellis, Catherine Wong, Maxwell Nye, Mathias Meybe, Lucas Morales, Luke Hewitt, Luc Cary, Armando Solar-Lezama, and Joshua B Tenenbaum. Dreamcoder: Bootstrapping inductive program synthesis with wake-sleep library learning. In Proceedings of the 42nd acm sigplan international conference on programming language design and implementation, pp. 835-850, 2021.
Benjamin Eysenbach, Abhishek Gupta, Julian Ibarz, and Sergey Levine. Diversity is all you need: Learning skills without a reward function. arXiv preprint arXiv:1802.06677 2018.
Meta Fundamental AI Research Diplomacy Team (FAIR) Anton Bakhtin, Noam Brown, Emily Dinan, Gabriele Farina, Colin Flaherty, Daniel Fried, Andrew Goff, Jonathan Gray, Hengyuan Hu, et al. Human-level play in the game of Diplomacy by combining language models with strategic reasoning. Science, 37866624)11067-0777 2022.
Maxence Faldor, Jenny Zhang, Antoine Cully, and Jeff Clune. OMNI-EPIC: Open-endedness via Models of human Notions of Interestingness with Environments Programmed in Code. In The Thirteenth International Conference on Learning Representations, 2025, URL [ -xxmiiddxXXxuJpPd
/openreview net
Chrisantha Fernando, Dylan Sunil Banarse, Henryk Michalewski, Simon Osindero, and Tim Rock- täschel. Promptbreeder: Reff-Refcrel Self Improveepte via Prompt Evolution. In Forty-first International Conference on Machine Learning, 2024.
Deep Ganguli, Liane Lovitt, Jackson Kernion, Amanda Askell, Yuntao Bai, Saurav Kadavath, Ben Mann, Ethan Perez, Nicholas Schiefer, Kamal Ndousse, et al. Red teaming language models to reduce harms: Methods, scaling behaviors, and lessons learned. arXiv preprint axXiv:200.008858 2022.
Hongcheng Gao, Yue Liu, Yufei He, Longxu Dou, Chao Du Zhijie Deng, Bryan Hooi, Min Lin, and Tianyu Pang. Flowreasoner: Reinforcing query-level meta-agents. arXiv preprint arXiv:2504. 15257, 2025.
Paul Gauthier. Aider: Ai pair programming in your terminal. https://gittub.coo com/
2024. Accessed: 2025-05-14.
Loris Gaven, Thomas Carta, Clément Romac, Cédric Colas, Sylvain Lamprier, Olivier Sigaud, and
Pierre-Yver Oudeyer. MAGELLAN: Metacognitive predictions of learning progress guide autotelic LLM agents in large goal spaces. arXiv preprint arXiv:2502.07709, 2025.
John Gerhart and Mare Kirschner. The theory of facilitated variation. Proceedings of the National Academy of Sciences, (04(suppL 2007.
Irving John Good. Speculations concerning the first ultraintelligent machine. Advances in computers, volume 6, pp. 31-88. Elsevier, 1966.
14

---

Published as a conference paper at ICLR 2026
Google
DeepMind.
Gemini
model "thinking"
updates
march
2025.
gemini peminiimooee wtw.mmmeee-tiiig--o----aa-e
March 2025. Accessed: 2025-05-11.
Ryan Greenblatt, Carson Denison, Benjamin Wright, Fabien Roger, Monte MacDiarmid, Sam Marks, Johannes Treutlein, Tim Belonax, Jack Chen, David Duvenaud, al. Alignment faking in large language models. arXiv preprint mrX1::2412.14093, 2024.
Sumit Gulwani. Automating string processing in spreadsheets using input-output examples. ACM Sigplan Notices, 46(1):317-330, 2011.
Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Ruoyu Zhang, Runxin Xu, Qihao Zhu, Shirong Ma, Peiyi Wang, Xiao Bi, et al. Deepseek-rl: Incentivizing reasoning capability in llms via reinforcement learning. arXiv preprins arXiv:2501.12945. 2025.
John Storrs Hall. Self-improving AI: An analysis. Minds and Machines, 17(3):249-259, 2007.
Alex Havrilla, Andrew Dai, Laura O' O'Mahony. Koen Oostermeijer, Vera Zisler, Alon Albalak, Fabrizio Milo. Sharath Chandra Raparthy, Kanishk Gandhi, Baber Abbasi, et al. Surveying the effects of quality, diversity, and complexity in synthetic data from large language models. arXiv preprint arXiv:24/2.02990 /2.09880 2024a.
Alex Havrilla, Sharath Raparthy, Christoforus Nalmpantis, Jane Dwivedi- Yu, Maksym Zhuravinskyi, Eric Hambro, and Roberta Raileanu. Glore: When, where, and how improve Ilm reasoning via global and local refinements. arXiv preprint arXiv:2402.109% 2024b.
Jesse Love Hendrikse, Trish Elizabeth Parsons, and Benedikt Hallgrímsson. Evolvability as the proper focus of evolutionary developmental biology. Evolution & development, 944:3393-401, 2007.
Nathan Herr, Tim Rocktäschel, and Roberta Raileanu. Llm-first search: Self-guided exploration of the solution space. arXiv preprint arXiv:2506 05213,, 2025.
Marius Hobbhahn. Swe-bench verified mini http::///sstttbo.o.ooo//rrtbbbbt
SWEBench weteeeeeeiiiiiiiieeeeeeee April 2025. Accessed: 2025-04-16.
John J Hopfield. Neural networks and physical systems with emergent collective computational abilities. Proceedings of the national academy of sciences, 79(8) 1982.
Shengran Hu and Jeff Clune. Thought Cloning: Learning to think while acting by imitating human thinking. Advances in Neural Information Processing Systems, 36, 2024.
Shengran Hu, Cong Lu, and Jeff Clune. Automated Design of Agentic Systems. In The Thirteenth International Conference on Learning Representations, 2025. URL https:://penreeiiii
net//oormmiddt.. 9U3LW77VV
Yue Hu, Yuzhu Cai, Yaxin Du, Xinyu Zhu, Xiangrui Liu, Zijie Yu, Yuchen Hou, Shuo Tang, and Siheng Chen. Self-evolving multi-agent collaboration networks for software development. arXiv preprint arXiv:2410.1664 2024.
Jiaxin Huang, Shixiang Shane Gu, Le Hou, Yuexin Wu, Xuezhi Wang, Hongkun Yu, and Jiawei Han. Large language models can self-improve. arXiv preprint arXiv:2210.11610. 2022.
Edward Hughes, Michael Dennis, Jack Parker-Holder, Feryal Behbahani, Aditi Mavalankar, Yuge Shi, Tom Schaul, and Tim Rocktaschel. Open- anennenndedness is essential for artificial superhuman intelligence. arXiv preprint arXiv:2406.04200 2024.
Kazuki Trie, Imanol Schlag, Róbert Csordás, and Jürgen Schmidhuber. A modern self-referential weight matrix that learns to modify itself. In International Conference on Machine Learning, pp. 9660-9677. PMLR, 2022.
Kazuki Irie, Róbert Csordás, and Jürgen Schmidhuber. Metalcarning continual learning algorithms. Transactions Machine Learning Research, 2025.
15

---

Published as a conference paper at ICLR 2026
Max Jaderberg, Valentin Dalibard, Simon Osindero, Wojeiech M Czarnecki, Jeff Donahue, Ali Razavi, Oriol Vinyals, Tim Green, lain Dunning, Karen Simonyan, et al. Population based training of neural networks. arXiv preprint arXiv:1711.09866 2017.
Minqi Jiang, Edward Grefenstette, and Tim Rocktäschel. Prioritized level replay. In International Conference on Machine Leurning, pp. 4940-4950. PMLR, 2021.
Minqi Jiang, Tim Rocktäschel, and Edward Grefenstette. General intelligence requires rethinking exploration. Royal Society Open Science, 10(6):23033,, 2023.
Carlos E Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, and Karthik R Narasimhan. SWE-bench: Can Language Models Resolve Real-world Github Is- sues? In The Twelfth International Conference on Learning Representations, 2024. URL
https::/ httpp::s///peeevvie..... .et/
Ingmar Kanitscheider, Joost Huizinga, David Farhi, William Hebgen Guss, Brandon Houghton, Raul Sampedro, Peter Zhokhov, Bowen Baker, Adrien Ecoffet, Jíe Tang, Oleg Klimov, and Jeff Clune. Multi-task curriculum learning in complex, visual, hard-exploration domain: Minecraft. arXiv preprint arXiv:2 /06. /4876, 2021.
Akbir Khan, John Hughes, Dan Valentine, Laura Ruis, Kshitij Sachan, Ansh Radhakrishnan, Edward Grefenstette, Samuel R Bowman, Tim Rocktäschel, and Ethan Perez. Debating with more persuasive ilm leads to more truthful answers. arXiv preprint arXiv:2402.06782. 2024.
Omar Khattab, Arna Singhvi, Paridhi Maheshwari, Zhiyuan Zhang, Keshav Santhanam, Sri Vard- hamanan, Saiful Haq, Ashutosh Sharma, Thomas Joshi, Hanna Moazam, et al. Dspy: Compiling declarative language model calls into self-improving pipelines. arXiv preprint arXiv:2310.03714, 2023.
Yoon Kim, Carl Denton, Luong Hoang, and Alexander M Rush. Structured Attention Networks. In International Conference on Learning Representations, 2017.
Motoo Kimura. The neutral theory of molecular evolution. Scientific American, 241(5):9--12, 1979.
Louis Kirsch and Jürgen Schmidhuber. Self-referential meta learning. In First Conference on Automated Machine Learning (Late-Breaking Workshop), 2022.
Martin Klissarov, Pierluca D'Oro, Shagun Sodhani, Roberta Raileanu, Pierre-Luc Bacon, Pascal Vincent, Amy Zhang, and Mikael Henaff. Motif: Intrinsic motivation from artificial intelligence feedback. arXiv preprint 1rXiv=2310.00166, 2023.
Martin Klissarov, Mikael Henaff, Roberta Raileanu, Shagun Sodhani, Pascal Vincent, Amy Zhang, Pierre-Luc Bacon, Doina Precup, Marlos C Machado, and Pierluca D' Oro.. MaestroMotii: Skill Design from Artificial Intelligence Feedback. arXiv preprint arXiv:24 2024.
Varun Raj Kompella, Marijn Stollenga, Matthew Luciw, and Juergen Schmidhuber. Continual curiosity-driven skill acquisition from high-dimensional video inputs for humanoid robots. Artificial Intelligence, 247:313-335 2017.
Robert Lange, Tom Schaul, Yutian Chen, Tom Zahavy, Valentin Dalibard, Chris Lu, Satinder Singh, and Sebastian Flennerhag. Discovering evolution strategies via meta-black-bou optimization. In Proceedings of the Companion Conference on Genetic and Evolutionary Computation, pp. 29-30, 2023.
Robert Lange, Yingtao Tian, and Yujin Tang. Large language models evolution strategies. In Proceedings of the Genetic and Evolutionary Computation Conference Companion, pp. 579-582, 2024.
Joonho Lee, Jemin Hwangbo, Lorenz Wellhausen, Vladlen Koltun, and Marco Hutter. Learning quadrupedal locomotion over challenging terrain. Science robotics, 5(47):eabc5986, 2020.
Joel Lehman. Machine love. arXiv preprint wrXiv:2302.09224. 2023.
16

---

Published as a conference paper at ICLR 2026
Joel Lehman and Kenneth O Stanley. Novelty search and the problem with objectives. Genetic programming theory and practice IX. pp. 37-56, 2011.
Joel Lehman, Jonathan Gordon, Shawn Jain, Kamal Ndousse, Cathy Yeh, and Kenneth Stanley. Evolution through large models. In Handbook of Evolutionary Machine Learning, pp. 331-366. Springer, 2023.
Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, al. Retrieval-augmented genera- tion for snowledge-inteniive nlp tasks, Advances in neural information processing systems, 33: 9459 9474, 2020.
Li, Storie J., and Clune. Encouraging creative thinking in robots improves their ability to solve challenging problems. In Proceedings of the Genetic and Evolutionary Computation Conference, pp. 193-200,22 2014.
Yixuan Li, Julian Parsert, and Elizabeth Polgreen. Guiding enumerative program synthesis with large language models. In International Conference on Computer Aided Verification, pp. 280-301. Springer, 2024.
Tian Liang, Zhiwei He, Wenxiang Jiao, Xing Wang. Yan Wang. Rui Wang. Yujiu Yang, Shuming Shi, and Zhaopeng Tu. Encouraging divergent thinking in large language models through multi-agent debate. arXiv preprint arXiv:2305. 19/ 18, 2023.
Hunter Lightman, Vineet Kosaraju, Yuri Burda, Harrison Edwards, Bowen Baker, Teddy Lee, Jan Leike, John Schulman, Ilya Sutskever, and Karl Cobbe. Let's verify step by step. In The Twelfth International Conference on Learning Representations, 2023.
Bryan Lim, Manon Flageat, and Antoine Cully, Large language models as in-context ai generators for -ivertttd. ALIFE 2024: Proceedings of the 2024 Artificial Life Conference. MIT Press. 2024.
Seppo Linnainmaa. The representation of the cumulative rounding error of an algorithm Taylor expansion of the local rounding errors. PhD thesis, Master's Thesis (in Finnish), Univ. Helsinki, 1970.
Fei Liu, Xialiang Tong, Mingxuan Yuan, Xi Lin, Fu Luo, Zhenkun Wang, Zhichao Lu, and Qingfu Zhang. Evolution of heuristics: Towards efficient automatic algorithm design using large language model. arXiv preprint ar arXiv:2401 1.2051, 2024.
Lei Liu. Xiaoyan Yang, Yue Shen, Binbin Hu, Zhiqiang Zhang, Jinjie Gu, and Guannan Zhang. Think-in-memory: Recalling and post-thinking enable Ilms with long-term memory. arXiv preprint arXiv:2311.087/9 2023.
Chris Lu, Sebastian Towers, and Jakob Foerster. Arbitrary order meta-learning with simple population- based evolution. In Artificial Life Conference Proceedings 35, volume 2023, pp. 67. MIT Press One Rogers Street, Cambridge, MA 02142-1209, USA journals-info .... 2023.
Chris Lu, Cong Lu, Robert Tjarko Lange, Jakob Foerster, Jeff Clune, and David Ha. The ai scientist: Towards fully automated open- open-ended scientific discovery. arXiv preprint arXiv:2408.06292 2024a.
Cong Lu, Shengran Hu, and Jeff Clune. Intelligent go-explore: Standing on the shoulders of giant foundation models. arXiv preprint -XXx:24055.5543 2024b.
Cong Lu, Shengran Hu, and Jeff Clune. Automated capability discovery via model self-exploration. arXiv preprint a7X1::2502.0757, 2025.
Yecheng Jason Ma, William L. Liang, Guanzhi Wang, De-An Huang, Osbert Bastani, Dinesh Jayaraman, Yuke Zhu, Linxi Fan, and Anima Anandkumar, Eureka: Human- reward design via coding large language models. arXiv preprint arXiv:2310.1299 2023.
Aman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan, Luyu Gao, Sarah Wiegreffe, Uri Alon, Nouha Dziri, Shrimai Prabhumoye, Yiming Yang, et al. Self-refine: Iterative refinement with feffbeee 2023. URL htips://arxii /tt.ub///333..755511 2023.
17

---

Published as a conference paper at ICLR 2026
John Markoff. Machines of loving grace: The quest for common ground between humans and robots. HarperCollins Publishers, 2016.
Ernst Mayr. The growth of biological thought: Diversity, evolution, and inheritance. Harvard University Press, 1982.
Luke Metz, C Daniel Freeman, Niru Maheswaranathan, and Jascha Sohl-Dickstein, Training learned optimizers with randomly initialized learned optimizers. arXiv preprint arXiv:2101.07367 2021.
Ali Modarressi, Ayyoob Imani, Mohsen Fayyaz, and Hinrich Schütze. Ret-Ilm: Towards a general read-write memory for large language models. arXiv preprint arXiv:2305.4432, 2023.
Jean-Baptiste Mouret and Jeff Clune. Illuminating search spaces by mapping elites. arXiv preprint arXiv:1504.04909 2015.
Niklas Muennighoff, Zitong Yang, Weijia Shi, Xiang Lisa Li, Li Fei-Fei, Hannaneh Hajishirzi, Luke Zettlemoyer, Percy Liang, Emmanuel Candès, and Tatsunori Hashimoto. sl: Simple test-time scaling, arXiv preprint arXiv:2501.1939) 2025.
Muhammad U Nasir and Julian Togelius. Practical PCG through large language models. In 2023 IEEE Conference on Games (CoG), pp. 1-4. IEEE, 2023.
Muhammad U Nasir, Steven James, and Julian Togelius. Word2world: Generating stories and worlds through large language models. arXiv preprint wrXiv:2405.06686 2024.
Anh Mai Nguyen, Jason Yosinski, and Jeff Clune. Innovation engines: Automated creativity and improved stochastic optimization via deep learning. In Proceedings of the 2015 annual conference on genetic and evolutionary computation, pp. 959-966, 2015.
Fan Nie, Lan Feng, Haotian Ye, Weixin Liang, Pan Lu, Huaxiu Yao, Alexandre Alahi, and James Zou. Weak-for-strong: Training weak meta-agent to harness strong executors. arXiv preprint arXiv:2504.04780 2025.
Boye Niu, Yiliao Song, Kai Lian, Yifan Shen, Yu Yao, Kun Zhang, and Tongliang Liu. Flow: Modu- larized agentic workflow automation. The Thirteenth International Conference on Learning Representations, 2025.
Alexander Novikov, Ngån Vū, Marvin Eisenberger, Emilien Dupont, Po-Sen Huang, Adam Zsolt Wag- ner, Sergey Shirobokov, Borislav Kozlovskii, Francisco J. R. Ruiz, Abbas Mehrabian, M. Pawan Kumar, Abigail See, Swarat Chaudhuri. George Holland, Alex Davies, Sebastian Nowozin, Push- meet Kohli, and Matej Balog. Alphaevolve: coding agent for scientific and algorithmic discovery. Technical report, Google DeepMind, 2025.
OpenAl.
Introducing swe-bench verified.
com/ index/
August 2024. Accessed: 2025-04-16.
OpenAl. OpenAI o3-mini. 2025. Accessed: 2025-05-01.
January
Pierre-Yo Yves Oudeyer, Frdric Kaplan, and Verena V Hafner. Intrinsic motivation systems for au- tonomous mental development. IEEE transactions on evolutionary computation, 11(2):265-286. 2007.
Long Ouyang. Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, al. Training language models to follow instructions with human feedback. Advances in neural information processing systems, 35:27730- 27744, 2022.
Ankur Parikh, Oscar Täckström, Dipanjan Das. and Jakob Uszkoreit. A Decomposable Attention Model for Natural Language Inference. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 2249-2255 2016.
18

---

Published as a conference paper at ICLR 2026
Jack Porker-Holder, Philipp Ball, Jake Bruce, Vibhavari Dasagi, Kristian Holsheimer, Chris- tos Kaplanis, Alexandre Moufarek, Guy Scully, Jeremy Shar, Jimmy Shi, Stephen Spencer, Jessica Yung, Michael Dennis, Sultan Kenjeyev, Shangbang Long, Vlad Mnih, Harris Chan, Maxime Gazeau, Bonnie Li, Fabio Pardo, Luyu Wang. Lei Zhang, Frederic Besse, Tim Harley, Anna Mitenkova, Jane Wang. Jeff Clune, Demis Hassabis, Raia Hadsell, Adrian Bolton, Satinder Singh, and Tim Rocktäschel. Genie 2: A large-scale foun- dation world model, 2024. URL
gerle-2-a-Large-Se -aa.rreesssaa-ttoaaaaai--------- foundation-wooldd google sisover/blog/
Deepak Pathak, Pulkit Agrawal, Alexei A Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In International conference on machine learning, pp. 2778-2781 PMLR, 2017.
Paul Gauthier. ol tops aider's new polyglot leaderboard. https://al.e..catt//aaa 21/polyglot.o html December 2024. Accessed: 2025-04-16.
Oleksandr Polozov and Sumit Gulwani. Flashmeta: A framework for inductive program synthe- sis. In Proceedings of the 2015 ACM SIGPLAN International Conference on Orieett-riented Programming, Systems, Languages, and Applications, pp. 107-126, 2015.
Justin K Pugh, Lisa Soros, and Kenneth O Stanley, Quality diversity: new frontier for evolutionary computation. Frontiers in Robotics and AI, 3:40, 2016.
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAl blog, 1(8):9 2019.
Maxime Robeyns, Martin Szummer, and Laurence Aitchison. A Self-Improving Coding Agent. arXiv preprint arXiv:2504. 120004.55220 52288, 2025.
Bernardino Nomera-Paredes: Mohammadamin Barekatain, Alexander Novikov, Matej Balog, M Pawan Kumar, Emilien Dupont, Francisco JR Ruiz, Jordan S Ellenberg, Pengming Wang, Omar Fawzi, et al. Mathematical discoveries from program search with large language models. Nature, 625(7995):468 475, 2024.
J Rosser and Jakob Nicolaus Foerster. Agentbreeder: Mitigating the AI safety impact of multi-agent scaffolds via self- anf-immproveent. In Scaling Belf-Improving Foundation Models without Human Supervision, 2025. URL
wwwp:ewwwwwwweeeeonoeeuouaaaeaae (ttp:///ooouummiio0033311111 J033JJJTc
David E Rumelhart, Geoffrey Hinton, Ronald Williams, et al. Learning internal representations by error propagation, 1985.
Mikayel Samvelyan, Sharath Chandra Raparthy, Andrei Lupu, Eric Hambro, Aram Markosyan, Manish Bhatt, Yuning Mao, Mingi Jiang, Jack Parker-Holder, Jakob Foerster, et al. Rainbow teaming: Open-ended generation of diverse adversarial prompts. Advances Neural Information Processing Systems, 77769747-697888 2024.
Cansu Sancaktar, Christian Gumbsch, Andrii Zadaianchuk, Pavel Kolev, and Georg Martius. SENSEI: Semantic Exploration Guided by Foundation Models to Learn Versatile World Models. arXiv preprint arXiv:2503.01584 2025.
Tom Schaul, Daniel Horgan, Karol Gregor, and David Silver. Universal value function approximators. In International conference on machine learning, pp. 1312-1320. PMLR, 2015.
Timo Schick, Jane Dwivedi- Yu, Roberto Dessi, Roberta Raileanu, Maria Lomeli, Eric Hambro, Luke Zettlemoyer, Nicola Cancedda, and Thomas Scialom. Toolformer: Language models can teach themselves to tools. Advances in Neural Information Processing Systems, 36:68539-68851 2023.
Jürgen Schmidhuber. Evolutionary principles in self-referential learning, on learning how to learn: the meta-meta-... hook. PhD thesis, Technische Universität München, 1987.
Jürgen Schmidhuber. A 'self-referential weight matrix. In International conference on artificial neural networks, pp. 446-450. Springer, 1993.
19

---

Published as a conference paper at ICLR 2026
Jürgen Schmidhuber. Gödel machines: Fully self-referential optimal universal self-improvers. In Artificial general intelligence, pp. 199-226. Springer, 2007.
Jürgen Schmidhuber. Driven by compression progress: A simple principle explains essential aspects of subjective beauty, novelty, surprise, interestingness, attention, curiosity, creativity, art, science, music, jokes. In Workshop anticipatory behavior in adaptive learning systems, pp. 48-76. Springer, 2008.
Jürgen Schmidhuber. Powerplay: Training an increasingly general problem solver by continually searching for the simplest still unsolvable problem. Frontiers in psychology, 4:313, 2013.
Jürgen Schmidhuber and Rudolf Huber. Learning generate focus trajectories for atlentive vision.
Institut für Informatik, 1990.
Sander Schulhoff, Michael Ilie, Nishant Balepur, Konstantine Kahadze, Amanda Liu, Chenglei Si, Yinheng Li, Aayush Gupta, HyoJung Han, Sevien Schulhoff, et al. The prompt report: A systematic survey of prompting techniques. arXiv preprint arXiv:2406.06660 2024.
Ivaxi Sheth, Jan Wehner, Sahar Abdelnabi, Ruta Binkyte, and Mario Fritz. Safety is Essential for Responsible Open-Endee Systems. arXiv preprint arXiv:2502.04512, 2025.
Kensen Shi, Hanjun Dai, Wen-Ding Li, Kevin Ellis, and Charles Sutton. Lambdabeam: Neural pro- gram search with higher-order functions and lambdas. Advances in Neural Information Processing Systems, 36:5132 36:51327-51346. 2023.
Noah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan, and Shunyu Yao. Reflexion: Language agents with verbal reinforcement learning. Advances in Neural Information Processing Systems, 36:8634-8652, 2023.
David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, loannis Antonoglou, Veda Panneershelvam, Mare Lanctot, et al. Mastering the game of go with deep neural networks and tree search. nature, 529(7587):484 489, 2016.
David Silver, Thomas Hubert, Julian Schrittwieser, Ioannis Antonoglou, Matthew Lai, Arthur Guez, Mare Lanctot, Laurent Sifre, Dharshan Kumaran, Thore Graepel, et al. Mastering chess and shogi by self- self-play with general reinforcement learning algorithm. arXiv preprint 172.0.17... 2017.
Avi Singh, John D Co-Reyes, Rishabh Agarwal, Ankesh Anand, Piyush Patil, Xavier Garcia, Peter Liu, James Harrison, Jaehoon Lee, Kelvin Xu, et al. Beyond human data: Scaling self-training for problem-solving with language models. arXiv preprini arXiv:2312.06585, 2023.
Joar Skalse, Nikolaus Howe, Dmitrii Krasheninnikov, and David Krueger. Defining and characterizing reward gaming. Advances in Neural Information Processing Systems, 35:9460-9471. 2022.
Kenneth O Stanley and Joel Lehman. Why greatness cannot be planned: The myth of the objective. Springer, 2015.
Kenneth O Stanley, Joel Lehman, and Lisa Soros. Open-endedness: The last grand challenge you't ve never heard of. While open-endedness could a force for discovering intelligence, could also be component of Al itself. 2017.
Marilyn Strathern. 'Improving ratings': audit the British University system. European review, (3):305-322 -211, 1997.
Jinwei Su, Yinghui Xia, Ronghua Shi, Jianhui Wang, Jianuo Huang, Yijin Wang, Tianyu Shi, Yang Jingsong, and Lewei He. Debflow: Automating agent creation via agent debate. arXiv preprint arXiv:2503.23781, 2025.
Shyam Sudhakaran, Miguel González- -uque, Matthias Freiberger, Claire Glanois, Elias Najarro, and Sebastian Risi. Mariogpt: Open-endes text2level generation generaationn through large language models. Advances in Neural Information Processing Systems, 36:54213-54227, 2023.
20

---

Published as a conference paper at ICLR 2026
OpenAl Team, Aaron Jaech, Adam Kalai, Adam Lerer, Adam Richardson, Ahmed El-Kishky, Aiden Low, Alec Helyar, Aleksander Madry, Alex Beutel, Alex Carney, et al. Openai ol system card. arXiv preprint arXhv:2412.167200 2024.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017.
Guanzhi Wang, Yuqi Xie, Yunfan Jiang, Ajay Mandlekar, Chaowei Xiao, Yuke Zhu, Linxi Fan, and Anima Anandkumar. Voyager: An open-ended embodied agent with large language models. arXiv preprint arXiv:2305. 2023a.
Ren-Jian Wang, Ke Xue, Yutong Wang, Peng Yang, Haobo Fu, Qiang Fu, and Chao Qian. Diversity from human feedback. arXiv preprint arXiv:2310.06648. 2023b.
Rui Wang, Joel Lehman, Jeff Clune, and Kenneth O Stanley. Paired open-ended trailblazer (poet): Endlessly generating increasingly complex and diverse learning environments and their solutions. 2019.
arXiv preprint arXiv:
Xingyao Wang. Boxuan Li, Yufan Song, Frank F Xu, Xiangru Tang, Mingehen Zhuge, Jiayi Pan, Yueqi Song, Bowen Li, Jaskirat Singh, et al. Openhands: An open platform for software develop- generalist agents. In The Thirteenth International Conference on Learning Representations, 2024.
Yufei Wang, Zhou Xian, Feng Chen, Tsun-Hsuan Wang, Yian Wang, Katerina Fragkiadaki, Zackory Erickson, David Held, and Chuang Gan. Robogen: Towards unleashing infinite data for automated robot learning via generative simulation. arXiv preprint 2311v:2311.014555 2023c.
Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Fei Xia, Ed Chi, Quoc V Le, Denny Zhou, et al. ofain-of-thhouhh prompting elicits reasoning in large language models. Advances in neural information processing systems, 35:24824 24837, 2022.
Marco Wiering and Jürgen Schmidhuber. Hq-learning. Adaptive behavior, 6(2):219-246 1997.
S Wright. The roles of mutation, inbreeding, crossbreeding and selection in evolution, proceedings of the sixth international congress of genetics. proc sixth congr genet [internet]. New York356366, 1932.
Chunqiu Steven Xia, Yinlin Deng, Soren Dunn, and Lingming Zhang. Agentless: Demystifying llm-based software engineering agents. arXiv preprint WxXiv:2407.01480 2024.
John Yang, Carlos E Jimenez, Alexander Wettig, Kilian Licret, Shunyu Yao, Karthik R Narasimhan, and Ofir Press. SWE-agent: Agent-computer interfaces enable automated software engincering. In The eighth- Annual Conference on Neural Information Processing Systems, 2024. URL https://arxxi: o
/ abs/
Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, and Yuan Cao. React: Synergizing reasoning and acting in language models. International Conference on Learning Representations (ICLR), 2023.
Rui Ye, Shuo Tang, Rui Ge, Yaxin Du, Zhenfei Yin, Siheng Chen, and Jing Shao. Mas-gpt: Training Ilms to build llmebased multi-agent systems. arXiv preprint arXiv:2503.03688 003666000.,6,,,, 2025.
Xunjian Yin, Xinyi Wang, Liangming Pan, Xiaojun Wan, and William Yang Wang. G)." odel Agent: A Refereefelltia Agent Framework for Recursive Self-Improvement. arXiv preprint 240.044410 2024.
Siyu Yuan, Kaitao Song. Jiangjie Chen, Xu Tan, Dongsheng Li, and Deqing Yang. Evoagent: Towards automatic multi-agent generation via evolutionary algorithms. arXiv preprint 2406::240..1222 2024.
Eliezer Yudkowsky et al. Artificial Intelligence as a positive and negative factor in global risk. Global catastrophic risks, 1303))184, 2008
21

---

Published as a conference paper at ICLR 2026
Mert Yuksekgonul, Federico Bianchi, Joseph Boen, Sheng Liu, Zhi Huang, Carlos Guestrin, and James Zou. Textgrad: Automatic" differentiation" " via text. arXiv preprint arXiv:2406.07496, 2024.
Eric Zelikman, Georges Harik, Yijia Shao, Varuna Jayasiri, Nick Haber, and Noah D Goodman. Quiet-star: Language models can teach themselves to think before speaking. arXiv preprint MXXi:22033.09629, 2024a.
Eric Zelikman, Eliana Lorch, Lester Mackey, and Adam Tauman Kalai. Self-taught optimizer (stop): Recursively self-improving code generation. In First Conference Language Modeling, 2024b.
Dan Zhang, Sining Zhoubian, Ziniu Hu, Yisong Yue, Yuxiao Dong, and Jie Tang. Rest-mets*: Llm self-training via process reward guided tree search. Advances in Neural Information Processing Systems, 37:64735 64772, 2024a.
Guibin Zhang, Luyang Niu, Junfeng Fang, Kun Wang, Lei Bai, and Xiang Wang. Multi-agent architecture search via agentic supernet. arXiv preprint arXiv:2502.0411 04180, 2025a.
Jenny Zhang, Joel Lehman, Kenneth Stanley, and Jeff Clune. OMNI: Open-endedness via Models of human Notions of Interestingness. The Twelfth International Conference on Learning Representations, 2024b. URL
Jiayi Zhang, Jinyu Xiang, Zhaoyang Yu, Fengwei Teng, Xionghui Chen, Jiaqi Chen, Mingchen Zhuge, Xin Cheng, Sirui Hong. Jinlin Wang, et al. Aflow: Automating agentic workflow generation. arXiv preprint arXiv:2410. 10762, 2024c.
Yuanshuo Zhang. Yuchen Hou, Bohan Tang, Shuo Chen, Muhan Zhang, Xiaowen Dong, and Siheng Chen. Gnns as predictors of agentic workflow performances. arXiv preprint arXiv:2503. 11301, 2025b.
Yuntong Zhang, Haifeng Ruan, Zhiyu Fan, and Abhik Roychoudhury, Autocoderover: Autonomous program improvement. In Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis, pp. 1592-1604, 2024d.
Wanjun Zhong, Lianghong Guo, Qiqi Gao, He Ye, and Yanlin Wang. Memorybank: Enhancing large language models with long-term memory. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pp. 19724-19731, 2024.
Andy Zhou, Kevin Wu, Francesco Pinto, Zhaorun Chen, Yi Zeng, Yu Yang, Shuang Yang, Sanmi Koyejo, James Zou, and Bo Li. RedoRe,,,, Autonomous Red Teaming with Lifelong Attack Integration. arXiv preprint vrXiv:2503.1575: 2025.
Wangchunshu Zhou, Yixin Ou, Shengwei Ding, Long Li, Jialong Wu, Tiannan Wang, Jiamin Chen, Shuai Wang, Xiaohua Xu, Ningyu Zhang, et al. Symbolic learning enables self-evolving agents. arXiv preprint arXiv:2406. 20V.::2006..832.2 2024.
Yuqi Zhu, Jia Li, Ge Li, YunFei Zhao, Zhi Jin, and Hong Mei. Hot cold? adaptive temperature sampling for code generation with large language models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pp. 437-4444 445, 2024.
Mingehen Zhuge, Haozhe Liu, Francesco Faccio, Dylan R. Ashley, Róbert Csordás, Anand Gopalakr- ishnan, Abdullah Hamdi, Hasan Abed Al Kader Hammoud, Vincent Herrmann, Kazuki Iric, Louis Kirsch, Bing Li, Guohao Li, Shuming Liu, Jinjie Mai, Piotr Piékos, Aditya Ramesh, Imanol Schlag, Weimin Shi, Aleksandar Stanic, Wenyi Wang. Yuhui Wang, Mengmeng Xu, Deng- Fan, Bernard Ghanem, and Jürgen Schmidhuber. Mindstorms in natural language- societies of mind. arXiv preprint arXiv:2305.1 17066, 2023.
Mingehen Zhuge, Wenyi Wang, Louis Kirsch, Francesco Faccio, Dmitrii Khizbullin, and Jürgen Schmidhuber. Gptswarm: Language agents as optimizable graphs. In Forty-firs International Conference on Machine Learning, 2024.
22

---

Published as a conference paper at ICLR 2026
APPENDIX
TABLE OF CONTENTS
Additional Results
24
A.I Baselines on SWE-bench
24
A.2
Generality across models on Polyglot
25
Ablation of Parent Selection
25
A
4 Additional Statistics of DGM runs
25
Additional Related Work
26
Algorithmic Details
27
Initial Coding Agent
27
Parent Selection
28
Self-Improve Prompts
28
4 Pseudocode
31
D Experiment Details
32
D.I Hyperparameters for Foundation Models
32
Benchmark Details
32
Cost Estimate
32
SWE-bench Tasks
33
Polyglot Tasks
35
E,4
SWE-bench The
36
Polyglot Representative Agent
36
Best Dest-Discovered Agents
36
DGM on SWE-bench
36
F2 DGM Polyglot
50
Similar Target Functionality, Different Implementations
60
Case Study: Solving Hallucination
69
Additional Safety Discussion
71
Additional Future Work Directions
72
23

---

Published as a conference paper at ICLR 2026
A ADDITIONAL RESULTS
A.1 BASELINES ON SWE-BENCH
DGM Self-Improve Archive Tree
w/o Seif-Improve
Progress
Score
bonch
0.5
0.50
Average of Archive
0.45
Lineage final Best Agent
94
SWE bench Score
0.40
0
0.25
0.30
0.25
2C tullaa
O
200 tuska jacore a.4
0.20
top trchiccthen)
Finval
Iterations
Figure 5: DGM without sell-improving agents. Keeping the meta-agent that is modifying and producing the next coding agents the same, DGM w/o self-improve is unable to continuously improve over time. (Left) Archive of coding agents generated during the DGM w/o self-improve run on SWE-bench. Each node represents coding agent, with node corresponding to the base agent. Node color indicates performance on SWE-bench (percentage of solved tasks), while border color reflects the number tasks for which the agent was evaluated. Edges show which agents self-modified to produce the offsprings. (Right) Progress plot of the DGM w/o self-improve on SWE-bench. The light green line shows the average score of all agents possessing basic codebase-editing functionality. The green line tracks the best score achieved by any agent in the archive at each iteration. The dark line shows the lineage of the final best-discovered agent and its precursor nodes.
DGM w/o Open-ended exploration Archive Tree
DGM w/o Open-ended exploration Progress
SWiE-bech
Score
Average
Best Agent
Lineage Final Best Agent
SWE.bao Te--benchSee Score
0.40
0.35
TD uokka too busic fonetioniityy
Ed make
0.30
22
61
GO0000000000
10 20
30
40
50
60
70
Iterations
Figure 6: DGM without open-ended exploration. Removing the archive, DGM w/o open-ended exploration always uses the most recent agent to self-modify and makes very little progress on SWE-bench. (Left) Archive of coding agents generated during the DGM w/o open-ended exploration run on SWE-bench. Each node represents coding agent, with node 0 corresponding to the base agent. Node color indicates performance on SWE-bench (percentage solved tasks), while border color reflects the number of tasks for which the agent was evaluated. Edges show which agents self-modified to produce the offsprings. (Right) Progress plot of the DGM w/o open-ended on SWE-bench. The orange line shows the average score of all agents possessing basic codebase-editin functionality. The light orange line tracks the best score achieved by any agent in the archive at each iteration. The dark line shows the lineage of the final best-discovered agent and its precursor nodes.
24

---

Published as a conference paper at ICLR 2026
A.2
GENERALITY ACROSS MODELS ON POLYGLOT
Model Transfer on Polyglot
Success Rate on Polyygoo 196)
40
35.6%
32.0%, 33.3%
30
20-
03-mini
Claude 3.5
Claude Sonnet
Base Agent
Best Agent transfer to other PMs
Best Agent from DGM
Figure 7: Transfer between Models Polyglot
In addition to testing the transfer models SWE-bench (see Section 4. Figure present the transfer results on Polyglot in this section. On Polyglot (Figure with 03-mini, evaluated on the full benchmark (Figure Middle). With Claude 3.5 Sonnet (New), the initial agent achieved 32.0% and the DGM-discovered agent 33.3%. With Claude 3.7 Sonnet, the initial agent achieved 35.6% and the DGM-discovered agent 36.8%. These results suggest that the DGM yields improvements that generalize across FMs, rather than being tightly coupled the specific FM used during its run (Figure 4
also 7), where the DGG was replaced the FM with Claude 3.5 Sonnet (New) Claude 3.7 Sonnet, and
A.3 ABLATION OF PARENT SELECTION
To further study the impact of the parent selection mechanism in DGM, we introduce DGM Greedy, DGM Greedy always selects the best-performing node as the parent to branch from, rather than giving every node non-zero probability of being branched off (roughly proportional to their performance score and number children) as this implementation
the DGM (Appendix C.2) This ablation replicates the approach of Robeyns et al. (2025) in this setting. As shown in Table DGM Greedy achieves 39.7% and 30.0% on SWE-bench and Polyglot, respectively, compared to 50.0% and 38.0% by this implementation of DGM. These results demonstrate that allowing all solutions in the archive to serve as potential stepping stones can lead to greater improvements over time, underscoring the importance of open-ended exploration.
Table 1: Comparison of DGM, its ablations, and baselines SWE-bench and Polyglot benchmarks.
Method
SWE-bench
Polyglot
DGM
50.0%
38.0%
DGM w/o Open-ended exploration
23.0%
14.0%
DGM w/o Self-improve
39.0%
28.0%
DGM Greedy
39.7%
30.0%
A.4 ADDITIONAL STATISTICS OF DGM RUNS
Percentage of Generated Agents with Basic Code-Editing Functionality. To gain deeper insights into the DGM process, we analyze the percentage generated agents that possess basic code-editing functionality on the SWE-bench benchmark. As shown in Table 2 DGM exhibits the highest percentage of producing agents with basic codebase-editing functionality. These results highlight the effectiveness of both open- open-ended exploration and self-imm improvement components in the DGM, where open-ended exploration enables the search to escape local optima, while self- eelf-improvement enhances the ability generate better agents.
25

---

Published as a conference paper at ICLR 2026
Table 2: Percentage of generated agents with basic code-editing functionality on SWE-bench.
Method
Percentage with Basic Code-Editing Functionality
DGM
51.3%
DGM w/o Open-ended exploration
32.5%
DGM w/o Self-improve
32.5%
Stability of DGM Runs. To evaluate the stability of DGM, we run the DGM algorithm three times on the Polyglot benchmark and analyze the variance in performance. The DGM achieved a mean accuracy of 40.7% with a standard deviation of 2.3%, indicating that the DGM can achieve consistent and reproducible results across runs.
B ADDITIONAL RELATED WORK
Open-Endedness (part 2). Early approaches open-endedness explored different mechanisms to balance Icarnability and interestingness, Quality-diversity algorithms sought to illuminate vast solution spaces with diverse. high-performing behaviors (Pugh et al. 2016 Chatzilygeroudds et al.
2021 Mouret & Clune, 2015, Nguyen et al. 2015). Other methods emphasized dire-dire
exploration (Ecoffet et al. 2019
2021: |
et al. 2015] Andrychowiez et al., 201 Eysenbyhhh
et al. 2018). intrinsic motivation (Lehman & ] Oudeeyr et al. 2007 Li et al.) [2014]
Pathak et al. 2017), or learning progress frameworks (Kanitscheider et al.
2021; 2021:Gaven
Gaven et al.
2025; Baranes & Oudeyer 2013 Colas et al.] 2019: 2022b 20i2n]Jiang et al. |021 Dennis al., 2020
Schmidhuber 2008; 2013 Kompella et al., 2017). More recently, large-scale foundation models (FMs) (Brown al.
2020 Radford et al. 2019) have emerged as powerful proxies for human notions
of interestingness (Zhang et al.] 2024b Faldor et al.]
2025 [Sancaktar et al., 2025) and effective
mutation operators propose novel solutions in code |Romera-Paredes et al.] (024[Novia
et al.
2025
Lehman et al.
[2023] Faldor et al. 2025 Hu et al.
2025). FMs can guide autotelic agents (Colas
al.
2022b [023] 2022ap. model human preferences for quality and diversity (Bradley et al. 2024
Ding
et al.]
2024 Wang et al. 2023b; Klissarov et al. [2033] 2024| [Samvelyan et al. 20244] Lim
al.
2024 Havrilla et al. 2024a). design reward functions (Wiering& & Schmidhuber 1997 Wang
et al. 2023
2023a Ma et al. 2023 Faldor et al. 2025). create simulated environments (Sudhakaran et al.
Nasir Togellus 2023 Aki et al. 2024| Nasir et al. 2024) Bruce al.) 2024| PPaker-Holdde
et al.
2024 Schmidhuber] 2013), drive ever-evolving multi-agent dynamics (Dhanna et al.) 2024
Zhou et al. 2025), search diverse ambulating robot morphologies (Lehman et al. (023)) and search
expansive solution spaces for benchmark or objective optimization (Lange et al. 2024| Zhang et al.
2024b Faldor et al.
2025 Hu et al. 2025 Lu et al.
2024b Comera-Paredes et al. 2024 Fernando
al.
2024 Lu al.
2024a Khan et 2024 Lu et al.
2025
Liu et al. 2024 Novikov al. 2025).
Program Synthesis. Program synthesis (Alur et al.
2018 Polozov & Gulwani 2015 Buchi
& Landweber 1990] Gulwani 2011 Ellis et al.. 2021 seeks generate code meeting external
specifications such as input-output examples or logical formulas. Hybrid approaches combine
symbolic methods with neural FM guidance: for instance, Li et al. (2024) uses LLM suggestions to steer symbolic search in SyGuS settings, improving over pure enumeration. Barke et al. (2024)
blends LLM completions with a learned surrogate model to guide synthesis in DSLs. Shi al. (2023)
uses neural policies to build higher-order order and lambda abstractions during search, outperforming both LLM-only and symbolic baselines on list manipulation tasks. The DGM differs in focusing not just on producing programs for external tasks, but also on agent solf-fodification, rewriting its own implementation to improve its capacity for future self-improvement.
Inspiration from Darwinian Evolution. This work is heavily inspired by the mechanisms of Darwinian evolution (Darwin 2023), notably variation (mutation), selection, and the preservation of lineages (stepping stones), and brings them into the realm of self-modifying coding agents. In DGM, an archive of past agent versions is maintained, from which parent agents are sampled; then mutations (i.e., code edits) generate new offspring agents, which are empirically evaluated coding benchmarks; successful ones are added to the archive, enabling parallel exploration of multiple evolutionary trajectories (Section 3. This mirrors how biological evolution (Edwards) 2000 Wright
26

---

Published as a conference paper at ICLR 2026
1932 preserves genetic diversity (Myrr 1982), leverages variation (Kimura 1979). and uses natural Dobzhansky 1970).
selection to retain beneficial mutations
C ALGORITHMIC DETAILS
C.I INITIAL CODING AGENT
In this section, we present the details of the tools available to the initial coding agent (Section 4.1 and its task prompt.
Information of the given Bash tool:
tool_irfo!!: seturn I
*name*: "bash",
*descript *"*Run
shell\n
When invoking this tool, the contents of the "conmand" parameter does NOT need to be Xil--scappdd.
You don't have access the internet via this tacl.In
You do have accesa mirror of common 1fnux and python packages via apt and pip. An command calls and discussions with the user. An To inspect a particular 1ine range of f1 le, e.g. lines 10-25, try *sed en 10,25p
State is persistent
/path/to/tthe/iiii
2lease avoid commands that may produce vezy large anouat of output. An the backgreund, e.g. 'sleep
run lang (- the background, ***,
server
Anppt__schema""
"type": "object",
"propertiea":
"command";
"cype": "string", "description": "Tha
to run.
"required"; ["ccmmand"]
Information of the given Edit tool:
def Lool_infoll
seturn
*name": "aditor",
"deacríption": *"*cuatan editing tool viewing, creating, editing lesln Stale 1s persistent across conmand calls and discussions with the user. \n "path"
with zumbers. + directery, "vies" lists non-hidden files and directeries up to levels deep, An The "create" command cannot be used if the spesified "path" alresdy exists as a file. An if "command" generates long output, will be truncated and marked with "<response clipped>'.
"path" is
"view" displays
entire
provided "file_text", No partial/lice range edits or partial viewing are supported,
"edit"
overwrites
entire
"ingut_echems";
"type": "abject",
"properties";
"aommand";
"type": "string",
("view", "create", "edit"],
"description"; "The command to rua "view" "create', or "edit"."
}
"path": "description ion"; "Absolute path to file oz directory, e.g. "/repo/tile.py" oz /repo'.".
"type": *string"
},
"file_text":
"description": "Roquired parameter "creata" "edit" cammand,
( containiin the content for the entire fi fil""" "Lype": "string"
1y "requiced": ["command", "peth"]
27

---

Published as a conference paper at ICLR 2026
Task prompt:
have uplonded Python coda repository the directory (salf. [talf.gtt_rempdir) Help solve + the *ollowing problen.
seroblemddsccrptton whelt-problem_atte ementttt
s/pcoblen__eecrrptiier.
destt_description [selr.test_ dessst__pstrritionn
</Lest__descrpption
Youz Laak make changes to the files in the beel--git_temdda directory to address the desbblem_eeccriotioo.. have slready taken of the required dependencies.
C.2 PARENT SELECTION
At each DGM iteration, select subset of agents from the archive parents self-modify and produce new child agents (Section 3). The details of the parent selection process, inspired by |Ecofft al. (2019) are outlined below. Future work could explore alternative search and exploration methods (Coulom 2006; Silver et al. 2016 Herr et al. 2025).
At each iteration of the DGM run,
A {aj az. a'y
be the archive of candidate agents. We first define the eligible set
E a A' a; <1].
i.e. only those agents whose performance score is not yet perfect. We then sample k parents (with replacement) from E' in proportion to a combined measure of performance and number of children with codebase-editing functionality, Concretely, for each agent of E Et:
(performance) 0; performance(d)).
(1)
(children count) Tς functioning childdenn_cuut(((f
(sigmoid-scaled performance)
8;
+ expl (a aa))
(3)
(novelty bonus) h, 1 n4
(4)
(unnormalized weight) = 144
(5)
(selection probability) Pi
ui
(6)
Σ/ Wy
(sampling)
parents]
Categorical ((pi ((Pi)atees) (draw & samples). (7)
Here, À > 0 controls the sharpness of the sigmoid, and on is the midpoint accuracy. We set À = 10
and oo 0.5. determines how many self-improvements are done in parallel during each iteration of the DGM run. We set = in SWE-bench experiments, and k = 4 in Polyglot experiments.
C.3 IMPROEE PROMPTS
In every iteration, an agent is chosen to self-modify. For this step, the current implementation of DGM leverages a separate FM to diagnose improvement opportunities, which are then passed to the coding agent for implementation. To identify the next potential improvement, the evaluation logs from the chosen agent's performance the coding benchmark are fed into the FM. While the current implementation relies on an additional diagnostic step, there are no fundamental limitations preventing the DGM from autonomously analyzing its own performance, generating improvement
28

---

Published as a conference paper at ICLR 2026
hypotheses. and implementing subsequent modifications. We chose OpenAl's ol model (Team ett al.] (024) for this purpose, as we found it had better reasoning capabilities than other FMs available at the time of our experiments. The prompts used for this diagnosis are provided below. From the diagnostic output, the i mmp ementata iontioonsstiee con_ssgeett on and probl em_descr ittiiiiiiii on are extracted and passed to the coding agent its self-modification task.
Self-improve diagnosis prompt for SWE-bench experiments:
Self-Impron Improve Prompt
Coding Agent Summary
Main Filese: "coding_agant....
Primary Class: 'AgenticSyszen"
The "forward()" function is the centrol encry point.
Prompts located either within the "forward()" function in the "prompta/" directory.
+*Toolse:: "tools/"
The "tools/" direstory contains various tools that LIMG can use to perform specific
Each tool muat have "Leol_irfoo!' Iosetion that returns JBON object containing 'nams', 'description', and 'input_schema' object containing 'type', 'properties' and 'raquirad'. fooo_finntio(() function takes arguments defined in input_schema, performs the tool's task, and returns atring. see other tools fo" referencs.
'inpus_schema' should JSON
must
suttslitiasv:: "utils/" The "utlls/" directory containg ut utflity functions used acroas the codebass.
*sAdditional betailatr:
The agent is very good at autemetically stilizing the right available tcols at the right time. So do not have agertic flow that expl fettly foresa
's vaage. Common tools, such file editing and bash commands, are easy for the agent to recegnize and use appzopristely. However, more complex and niche tools may the prompt.
require explicit instructions
Tools should be designed to be as general as possible, ensuring they work across any GitHlub zepository. Avoid hardcoding repository-specliee details
(e.g.r psths).
'while True' lcops stuck and not respond.
agent's code.
agent
verify implementation
helper propar integration and expected behavior.
prior usage ensure not install additions!. packages dependenciss directly. update
"sequirements ext" if dependencies required and install then using "pip install -r requirements.txt.
Here the implementation of the coding agent.
Coding Agent Implementation
Coding Agent Implementation Start
[oode]
Coding Agent Implementation End
Your tack is identify OND detailed plen that would improve the agent's 's coding ability. The improvement should not be specific to any particular citaub issue or ropository.
Hare the log for the coding trying solve the SitHub issues failad.
Agent Running Log
Agent Sunning Log Start
[nd_log]
Agent Sunning Log and
GitHub 1ssue
The Gitllub issue that the agent is trying solve.
Gitsub issue start
(github_issuel
GitHub issue and
Fredicted Petch
The agent 's predicted patch solve the issce. Predicted Patch Start (predicted_patch) Predicted Patch End
Frivate Test Patch
29

---

Published as a conference paper at ICLR 2026
Swa-bench's official tests detest waether the issue is solved. This available to the agent during evaluation, The agant should try to implement ita own
Private Teat Patch Start
[test_patch]
Private Teat Patch Ead
Isaue Test Results
SKE-bench vsing official private teats.
15qua Test Resulta Start
[eval_log]
Issua Test Resulta End
Respond precisely in the following fornat including the JSON start and end markers: "son <JSON>
In <JSON>, provide a JSCK reaponse with the following fields: llog_sumarizaciont Anslyze the above logs and summarize how the agent tried to - solve the GizRub isaua. Note which toola and how they are used, the agent's 's problen-solving approach, "potentisl improvemntt" "ppceettsss_lnpppoeeetttt"""" Ideatify gotential improvements to the coding agent that coding capabilities. rocus on agent generai coding
any issues encountered.
could enhance abilities (a.g., bettar or new tools usable across any repasitory) rather thar isaue-specific tixes (e.g., toola only usable one frameeoс*), All seceasary dependancies environment setup have alraady been handlad, da not focus these sapecta,
" Limprovemett_propcaa Choose high-impact improvemant from the identified potential improvements and deacrine it in datafl. This should be focused and comprehensive plan enhance ageat's overall coding abilily. Referring to the coding agent's summary and httpll/eeenattit___suseeeeee eritically about what feature tool could implementation,
improved to best impl implament the proposed improvement. Tf the proposed feature can be implemented by modilying the exiating tools, describe the modi needed, teel.
instead of sugges:ing Farase the improvement proposal and implementation suggestion description. ahould claarly deacribe the feature that software engineer viewing the isaue and the repository can implement it.
CitHub
Your reeponee will be automatically parsed, so ensure that the atring response la precisely
format.
the "JJ8ON>" tag your output.
While the private test patch is included in the diagnosis prompt, one could imagine that easy way for the agent to score well on the task would be to hard code the solutions. However, from manual inspection of the logs and agent modifications, we have not observed any problematic logic or behavior indicative of memorization or overfitting to specific private test cases. Furthermore, improvements discovered on one task or LLM model often generalize well to others (Figure 4. showing that these improvements are not task-specific but instead reflect general changes that enhance overall performance.
Additional prompt for Polyglot experiments:
Additional Prompt for 03-mini Tool Use and Polyglot
tool function achema
Carefully consides whether add/enhance the cursent tool edit the workflow in forward()
Pay special attention to making sure that "required" and "sype" are always at the leval of nesting. For example, "requi res* should ba the leval - "properties", not inside it,
sure every property, correctly nested inside it.
short, type description
Other arguments than you have seen are not permitted. example, "adit_ lanel_inngeesssseeeeeeeeeesseeee with "type": "array", arguments like "minitems" and "mexitems" are not permitted.
Hare log coding agent trying to solve programming task, A taak is in one programming language, but the coding agenz needs to deal with different languages including CHI, Go, Java, JavaScrips, Pythen, and Rust.
30

---

// MMdd fy with base agent Published as a conference paper at ICLR 2026
C.4 PSEUDOCODE
This is the pseudocode of the DGM algorithm, described in Section 3
Algorithm 1:
Darwin Gödel Machine
Input:
Initial coding agent yn. benchmark suite B, maximum iterations Output: Archive of agents A
50 + evaluate(go, B) initialize A 4- {(o. $0)}
// Evaluate the base agent // Start with the base agent
for < to I' do
p + SclectParents(4)
// Select parent agents
foreach p E P do
p.modifypp) 8 + evaluate B)
// Self-modificatioo // Evaluate on benchmark
if c.is vis_vvaid() then A A {(c,8)
// Keep children capable of code editing
end
end
end return
This is the pseudocode the baseline DGM without self-improving agents, described Section 4.3
Algorithm 2:
Darwin Gödel Machine without Self-improving agents
Input: Initial coding agent go, benchmark suite B, maximum iterations T Output: Archive of agents A
80 + evaluate B)
// Evaluate the base agent // Start with the base agent
initialize A + {go, so)}
for / <- to do SelectParents(A)) foreach E P do
// Select parent agents
c modmofiyy(p) evaluate(c, B) c.s cc.isvvalid( then
// Evaluate on benchmark
A A U ((c,s))
// Keep children capable of code editing
end
end end return A
This is the pseudocode of the baseline DGM without open-endeedexploortiio described in Section 4.3
31

---

Published as a conference paper at ICLR 2026
Algorithm 3: Darwin Gödel Machine without Open-ended exploration
Input: Initial coding agent 9n- benchmark suite B, maximum iterations Output: Archive of agents A
8o <- evaluate B)
// Eva Evaluate the base agent // Start with the base agent
initialize +- ((go $0)}
for t - to l" do
p - SelectParents(A)
// Select parent agents
foreach p E P do
- p.modify(p) (valuate B)
// Self-modif
// Evaluate benchmark
if ccis_ ccii_valid() then A+ + 8()
// Only keep the latest agent
end
end
end
return A
D EXPERIMENT DETAILS
D.1 HYPERPARAMETERS FOR FOUNDATION MODELS
Table 3 shows the foundation model used in each experiment setting, as described in Section 4.1 Since SWE-bench a more challenging coding benchmark, we use a stronger coding model, Claude 3.5 Sonnet (New) (based on preliminary testing). To enable faster iterations and avoid the same rate limits as Claude, we use 03-mini for Polyglot experiments. The temperature for all FMs every setting is set to 1.0.
Table 3: Foundation models used in each experiment setting.
Benchmark
SWE-bench
Polyglot
Self-modification
Claude 3.5 Sonnet (New)
Claude 3.5 Sonnet (New)
Evaluation
Claude 3.5 Sonnet (New)
03-mini
E BENCHMARK DETAILS
E. COST ESTIMATE
The estimated cost of completing a single run of the DGM on SWE-bench, as presented in Section 4 about USD 22,000. In comparison, the estimated cost of completing single run of either baseline (DGM w/o self celf-improve or DGM w/o open- open-ended exploration) on SWE-bench is about USD 10,000, Although the DGM considerably more costly than the baselines, method that can continuously improve, even at a higher cost, is preferable to one that fails to improve stagnates at a level of performance that may never match that of the DGM. A more granular break down is:
LLM
Benchmark
Number of Tasks
Cost Estimate (USD)
Claude 3.5 Sonnet (New) 03-mini
SWE-bench Polyglot
60
$350
60
$5
We acknowledge that the current experiments SWE-bench require considerable compute. Hence, we also include experiments on another benchmark, Polyglot, with significantly lower costs. This suggests that expenses vary greatly by task complexity, with SWE-bench being among the more complex and resource-intenste coding benchmarks. Moreover, several impactful methods (c.g.. LLM training its inception) were characterized substantial computational demands initially. Similar to
32

---

Published as a conference paper at ICLR 2026
these pioneering works, hope open the door to future research improving the efficiency and scalability of our approach. In addition, many leading coding agents on the SWE-bench leaderbourd backed by industrial companies employing expert full-time researchers and engineers, which incurs substantial human labor costs. contrast, our approach achieves SoTTA-level performance through fully autonomous self-improvement without human intervention, potentially offering greater efficiency when considering the comparative costs of specialized Al development talent versus API usage. Finally, FMs continue improve and compute costs continue decline, methods like the DGM will become increasingly efficient and accessible.
Also, gigher-performing agents discovered by the DGM do indeed incur greater inference costs than the initial agent, but cost and performance are not strictly correlated, where some expensive agents underperform cheaper ones.
E.2 SWE-BENCH TASKS
Initial 10 tasks for verifying basic functionality of coding agent:
django__django- -jangaa-lnnooo7
djjngo__djanoo166666
Hlangoddjango
10880
django_ jango-15930
django__dangoo jangoo-10999999 10999
django__d jango-13279
django diaana--annnaaaa 11087
Additional 50 tasks for estimating general effectiveness of coding agent:
Laanoo__jjango-999990
django djanoo___jann-1119990
pphinx--oc__sphinx-1115
sphixx-doc__spiixx--7
django_django_ 1jango-11888
django_djangpo 11880
aphinx-doc__sphixx-1333
django _ 1jango-11885
pphinx-dooe_sphhixx-033
django django_djang_aee dango-11991
ppinxx--oc__shhnnx--0000
django django_djaan django-11964
Brahx--doc__phixx--990
jango___jano1119999
Mmiixx-doc__shinx---90
[jango_django-1200
1eiinx-doc__shiixx-888111
django django-12050
django django-12143
django django-12155
django d django-12193
@hhinx-doc__shinge
django__jangaa django-12209
Shhinx-doc__sphnxx--
django 2jngg__2ann22222622
pphinx-doc__sphnxx 9230
django django-12273
sphinx-doc__sphnxe-990 1rrt:oc__phiixx-pP0
django fjaggo-12276
Seinx-ddo__shixx-99000
django sacoo_jjangoo 12300
pphinx-doc__phhin 9999inxx93677
django__jango-11222 dango-12308
Dhninx-doc__shhnx----
django_ 1232g
pphixx-doc__spinxx
d django-12405
django django-12705
sphinx-doc__sphingg sphinx-10466
django django__jaa 1j211
sptinx-6oc__ahhinx---5555
d jjago-11274
33

---

Published as a conference paper at ICLR 2026
Additional 140 tasks for accurate assessment of coding agent's performance:
astropy_astropy-1223
django [jango__djanoo-11000
astropy__sttooyy11333
django__django-111 django-11433
aatroyy__stropyy11223
astropy_asttrey11338
django_djanl django--1447
django__danggo- django-11490
astropy__attrooy-1155
_jango__django-11111_ django-11532
astropy_astropy-11
django_ django-11551
astropy
astropy_astrooy113377
django__djnngo django-11555
astropy__attropy___
django d django-11603
astropy__strroy-1141
django django-11728
astropy astroyy_astrooy114300
django_django-111 django-11734
astropy__sttroy-11555
django django_djange django-11740
astropy
Baango_django-11744
astropy attroyy__stroooy145500
django django__djangooo django-11820
astropy_asrropy-1453
laango_djang----
12419
astropy__strooy-14499
django django_ django-12663
astropy_astropy-_
django django-1274)
astropy_astropy-T33
django django_ django-12858
astropy_astropy--00
django django_django- django-12966
django__jango-110 django-13012
astropy_astropyy-51
django
Baang__django--- Ajango-13022
astropy astropy_
django django-13028
django -janoo--an0
django_djanged django-13033
django_djange djago__05n0
django django-13089
django djnooo-jnn
django django- 13109
django_d (ac__djjanh jango-11095
django django-13112
django_ django-13121
django django_djand django-
django_ django-13128
django_ django-
django Baango__dango_1111_11__ django-13158
django_ Jango- 133
django django-13195
django sjango-1111
django__jjnngo-111
django sjango-1114
django django-13297
django_ fel_djjjnge django-1114p
django_djange django- 13315
django ajango-11163
django django-13343
django django-11179
django django_djange-- django-13344
django_djangor djago-11226
django djjago-13361
django__jjaneo__ django-11211
django django_ django-13401
django_djange- django-11239
django django-13406
"lango_jjango
eaijannnn266 11265
django django_djaago- django-13410
django django__janda daago-11226
django django-13417
django
django__ajanno-aa django-11292
django django-13449
django django-11299
django django-13512
django__jangee o 1ango-13333
34

---

Published as a conference paper at ICLR 2026
"aango__jangoo-3551
django django__daaaaaa djago-14415
django_d Jango-33551
_ django-14170
django___janoo 13369
django__jjango- diaago--annaa 14238
django django_ajang ijango-33569
django django_django django--annaaae 14311
django d Jango-13590
django django_ django-14315
django__jango-l_ Jango-13658
django_django-l django-14349
django django-13670
django django-14351
django JJango-13741
django 4jango-14373
django_ _aro__jjangoo 133g
django djjngoo_33a
django -339
django django_django- django-14400
django__jjango_a_la_aa__ djagoo113807
django django_ddanga django-14434
django_djanaa dango-13880
_ jaagoo14449
django django-13811
django django- 1ango-14500
django django_djann 1332g
django #jjago-14534
django django_djangee 13ngo-13821
django_ django-14539
django django_django-111
django django-13925
django django-14588
django django-13933
jjango [lango-14600
django_djanga 133g6
django_d django-14631
django dango__jjanoo14000
django__jjanoo1 django-14672
Laango_jjago-lll Jango-14011
django jajgoo-1123
django django_ jjango-14017
django django_djanl django-14752
django django-14034
django_ddang django- 14765
django 4145g
django django-14771
django d 1ango-14089
jango-14788
django_ d 14122
django__daaaneeeeeeeaaoaaad 1aago-14410
django__django- dijango-48885
E.3 POLYGLOT TASKS
Initial 10 tasks for verifying basic functionality a coding agent:
go do_domioess
rust
nat__veriable--legghhhaaaaaaa
cpp cpp_ all -lo-your-basee
python__eer-songg
python__dminne
go_bbooksttore
java_ saa___sffparsinngggg
javsscritt_bcttle-oonn
javascript_
bowlingwling
Additional 50 tasks for estimating general effectiveness of a coding agent:
aerascript__uuee---ttee
rust accumllace
rust_wordy
go_error-handling
sachon__ott-oe
qup__queen-attack
_va__sttlllte
rust poker
cpp diamnd
sython__sff-parsi..
35

---

Published as a conference paper at ICLR 2026
rust react
java java_ react
@iva_ledeerr
o
go_cennect
gython__scale-geeentte
rust mastos
java_
javascript_crianglle
rust__doubly-liikeed-lisss
java_zipper
python__grade-schooll
Lawa_bowling
javascript_
python python__tree-pe__ treeo___tteebuidding
wrthon__ordd
javascript_say
java__mzzymmice
lava_word
opp
aep__bank-cccoun
python sachon_food-chall
python__zipper
javaseript_woody
java__custom-seet
python poker
java reva_rest-app
javascript__gradeecccoo
go transpose
cpp_gigaasccond
rust
java_
rust_say say
python__dmmines
dominoes
go food-chain
go word-search
rust pig-latin
javeerrpp__simmle--nneee----
go mo_markdwwn
countr
cwypto- square
E.4 SWE-BENCH STATE-OF-THE-AR
At the time of writing this paper (16 April 2025), the highest performing, checked (i.e., the SWE-bench team received access the system and were able reproduce the patch generations), open- open-source entry on SWE-bench Verified is OpenHands + CodeAct v2.1 1 Blaude-3-5-soonet-200 al. 2024), achieving 53.0%. Only considering the same subset of 200 tasks used by the DGM (Appendix E.2, OpenHands + CodeAct v2.1 (claude-3-5- son--oonet--22210000 achieves 51.0%.
(Wang
E.5 POLYGLOT REPRESENTATIVE AGENT
Aider (Gauthier 2024). popular coding agent in the community, was published Spring 2024. has garnered over 33,000 stars GitHub and has been continuously developed and tested against the Polyglot benchmark for over a year by human developers, primarily to evaluate its performance. Aider has also become standard baseline for assessing the performance of different models, with the current top performers on the Polyglot benchmark being a mix of o3 (high) and GPT-4.1. We adopt setup similar to that of the Polyglot leaderboard, with one key difference: the leaderboard reports pass @ performance, where the agent can view feedback from ground-trute tests once. In contrast, we use pass@) @ setting, where the agent never sees the results of ground-true tests, we believe this more closely reflects realistic coding applications.
F
BEST-DISCOVERED AGENTS
F.1 DGM ON SWE-BENCH
Diff patches contributing to the best agent discovered by the DGM on SWE-bench:
diff git a/coding_agent agentt py b/coding_agent..
index Sed335a..9a2220 9a2cc2f 100644
a/ a/dding__geett.pp
b/coding_egent.pp
88 64,6 +4,7 80 import logging
logging
import RocatingF" leHandler
36

---

Published as a conference paper at ICLR 2026
import import threading
+import ze
from 1im_withtools import CLAUDE CLAUDE_RODEL, AODEL, chat that_with_agem:
from aesila.eval_ure import get_roport__ccore, wttp:hhittrr._o_ooorrroo 6B -63, -64, es def safe_log (message, www.loggg..g............ else: print (**Warnnns No logger found for thread serreadinggerr_demm
scoro_tio_breaker
idef sa_patei_vallldpptttii
chack any non-test files modifled. Returas (bool, atr) tuple: (ia_valid, reason) on*
the
if patch_strr retura False, "Eapty patch"
betch_err.esppacel
f Parse the patch to find modified files modiried_riles
diff SLt__header_patiee match diff_hedee_pasteen.. (tt.deeessttto..iaiieeeeeeeeeeee findittr (patch_stz): filepath matea.group(1)
(s 1/(.15 ze MO.TIIIILNEE)
if filepsth 1- 1/dew/null'; a skip deleted files stl.iieedfilee...peendiii
modified Files:
retura False, *No files modified"
Check if any test files are medified
sest_ pest_pstterns =
lanbda f: s.startaxithhttearaaa
lambda t: watartawitt("ttet__"
larbda Evendawith (ttrdail
source_files files -
for modified_fiies
if any (pattern for pattern in teat_pstterns)
if not fourse_files:
return False, *Only tast were modifiod"
return true, "Valid patch with source file modifications
class AgenticSystem: init_(
self,
88 -73, -113,7 class Agen:icSystem:
sest_descriptionntoon
gel jol-__mprroa=Felce,
mistance_ld-Kone, rex_iettres=3,
1:
sclf.problem sttttmttttttttttt
= problem_statement
ailf.git_tempdf git_tempdir
88 - -123,7 class AgenticSystem:
aelf.self f_..ellf_mmmmrr
aelffaeef_immrres improve = sel imprrove aelf_improve
selt.instance_id instance id it self_improve 'dgn!
self.code_model wwwf.mxx_retriiee max_retries
CLAUDE_MODEL
Initialize logger and score it in Ihread-local storage Loggrr setup_logger tchet_hiistory_fiie 88 -153, 7 +192, 7 28 Your task la to run the regression tests in the (self.git_tempdir) disectory
forward
Agenticsystem.
instruction gotel have uploaded a Python code zepositozy the directory [seldiggis_eemddrr.. Help solve the following problem. base_instruct - greer have uploaded Python code repository in the directory ( [seli.gis_tempdir)) Help solve the following problem.
sproblan des.riptiiooo
ee 165,7 1204,39 Your task is to zun the regression tests in the jself.git_tee git_peddirt directery
37

---

Published as a conference paper at ICLR 2026
make changes the files - the seoollendescrppttoo hava glready taken care of the required dependencias.
directory address
aew_nag_histery chat_xithhegen (instruction, model=self modeirselL..odemmmbtt.. code_nodll, higtosst *eggingreefe__og)
retry_count 0
while zetry_count sallf.mx_rette retriesties:
Attempt (retry_count: 1) of (self.max_rerrtes] mmat)
Reset base commit before each attempt
if retsy_count 0:
reaet_te__oone (self.git__amddiel sel welf.base_eeeeeeee base_commit)
setry context to instruction instriction base_instruction
retry attempt
if relzy_count 0:
instruction + "***\aNore: Previous astempt Smiled because they either produced empty
+ patches or only modified teat files.
+Please
solution includes changes the main code riles, not just 4 files. n*e
Run the agent
aew_asg_histery chat whah_wwthh_eeeee / tinstruction, model-self, zodel, higttist leggingssafe_log)
patch - patch
is_valid, reason in.pstch..allddaacchh
if is_valid:
(ff"alldd patch gonarcted: [reason]")
break
(o patch: (reason)")
recxy_count melffmmx__retriee
sefe_log (ot.logg(""etti ("Retrying with attempt...") clse:
safe_log (*Moximum retries recchad, Unable generate valid patch.")
retey_count
maint):
passer
www.unenttaseereeeeeeeee (descciiiitteeeeetiiiiiiiiii "Frccess reposizory with agentic + system..)
-177,6 +248,7 28 def main():
petser..dd__aqquueee. (t
default-None, requized-Palse, zepositozy")
help- DDscrrpttin (t--self_imppooeee imprrov'''' default=ralse, actions "siine/store_true parser.adé_ (f--self____e
+ helps'@hether 'Whether
f-improe repesitory or solving sxe')
pazser. add ("==instance_id" default=None, help=' inssance for sws issue')
parser.add_ (1 retries', typesint, default=3, help= silps'Mximum number of patch generation atcempta') args pacser.paise_sre
Process the repasitory 88 6 +260, 28 def main
set__descrspiiomaargg..
instance_ides seticce_ddarree_eeo ins.aneeedd....eddd.. wttttriismargsmaa.rett...e
Run the agentic aystem to cry to solve the problem
88 200, 1273, 38 def main
T.write (model__atenn
if name ":in_
()
m3
newline ead of file
diff --git /ttett//est_pptcchaallaaeee
b/tests/test_eechh.alleeee
new file mode 100644 index 5669Edd
/dev/nul1 lecoatt/tear_pptch_aallll
e8 00,0 +7 eg limport pytest
+fron coding_agent import ysapetch_yalid
#def (I
38

---

Published as a conference paper at ICLR 2026
empty patch
is_valid, reasen = "r assert not la_valid
reason =- "Enşty patch"
Teat whitespaca-only potch
is_valld, reason = is_patch_valld!" An f)
assert not asaert reason =* "Repty patch*
+def test_test_only_petchh]
>petch
+diff --git a/tests/test. //rests/tett_edi__tool.... _edit_tool
bitests/teat__ddt_too.l.
+index abc123. 100644
3/2ests/tact_adit_too.
++++ wttpsts/test_eeeeeeeee
188 10,6 1 def test_something():
asserrt True ++ =asert **.0
is_valid, reasoa - is s=_patch__alLddpaacch
assert
assertt reason -- rOnly Lest Filea were modified"
+def test__ource_file_pethhh
pptcc
--git a/tools/edit.pp b/toola/edit.py
(index abc123.. 100641
a/zocls/edit.pr
1:11 b/tools/edit.py
+9a - +10,8 88 class Editor:
def adit(solf).
paas
:eturn
**00
is_valid, reasen inapetchh_nalidpparch
assert is_velid
aassert reason "valid patch with source file modifications"
+def teat_mixed_filee__orte
:patch ***
+diff --git a/tools/edit..tt////e b/tools/edit.gy
abc123..def456 100644
+--- a/zocls/edit.py
++++ b/tocla/edit.py
-10,6 +13,8 class nditors def edit (sel():
pesss
++ return True
+diff --git petssts/test_edit... +index abc123..def456 100644
b/tests/test_eeit..p
1111 b/tests/test_editttt
+10,9 test_scmething():
assert True aasert
**.0
is_vvlid, reason "s__stcchvallddeee
le_valid
.assert reason =- "Valid patch with source sile modifications"
+def test_ro_ftt foot_trofllee_mmddfeeed
+patch
idiff -giit s/nonexistent.pp b/nonexistent..p
+deleted file mode 100644
lindex
+--- a/sonexistent.py /dev/rull
***n
is_valid, reasod is_paachh_alllddaacc assert not is_valid
assert resson -- "No files modiried"
of
diff --git s/tcols/edit.pp b/zoels/edit.py
index 59137ee. 16a5521 100644 a/toolls/edit.py +++ soools/eddt-pp 1,16 1,17
39

---

Published as a conference paper at ICLR 2026
pathlib import
import subprocesa
firo typing Import Optional, List, Tuple, Union
def tool_infol):
return
*name*: "editor",
"éescription"; ""*Custom editing tool viewing, creating, editing fileskn State la persiatent acroas command calls ard d' scusatons with the user. In II "path"
tile, "view" d-eplaye the entice file with Line numbera. Ir "pathi" is directery, "view" Lists con-hidden files and dizecteries up to levels deep, la +* If "path" is a file, "viex" displays the file with line numbers. with optional "vieev_range (start, end], displays only speci fee lires. Use in "end" for all remaining Linea, An lists non-hidden
diractory, + deeep,
"path"
directories up to levels
The "creste" command caanct be used if the specified "path" already exists as a file, if "'csamend" generates long output, will be truncated and marked with "<respense
- "<lipppd>". .'n
overwrites the entire file with provided "rl e_text", No partial/line range edita or partial viewing are suppozted, "*h, "edit" coamand overwrites the entire file with the provided "file_text", "input_schems";
"edit"
"type"; "object", "properties":
88 -26, 5 13 88 def tool_info(1:
"File_text";
"description"; "Bequized parameter of "create" or "edit" command, entire file.",
containing the content
"Lype": *string"
+), "rile_saage":
"description" "opaional paraneter for "view" command. Array of [start_line, end_ [in] basedt. Use lin zead until end rile.",
"type"; "aczay",
"items": ("type": "integer"),
"minItems":
"maxitens";
1, "requiced"; ["command", "path"] 88 -89, 8 -97, 46 83 def fead_file (path:: sath) -> str: except Exception sa at raise ValueError (f"Failed (ffiiled
read file: (e:")
+def fengga range (path: Path, line_ mangre Optional [Mat [1nt]] Mona) Top [strr, on* + int];
sead and return file contents within specified line sange.
Returns tuple (contert, start_line].
Args:
path: Path object for file
Linge Optional (start, end] line numbers (1 based) Use 1 For end to read until
try:
if line_range
return read_fflelpath)
start, end = lias_renge start raise ValueError ("Start 1ine must be >e 1*)
if end -1 and end start:
raise ValueErroz ( (End line must be >= start line er -1")
with oath.ogen:
+ Skip lines before start range (start. next Monel
lines
curreat_liag atart line = next if, None)
$ ROF
break
if end and surrent_line end:
break
lines. aphes.appedd (line, (taeersddii
curreat_lis
40

---

Published as a conference paper at ICLR 2026
return "N". "n'..oon (lines,,
start
except Exception
reise Valuekrror (E"railed to read file range: (el")
def write_ le Path, content: atr): "*"grite (overwrite) entire file contents. ***
try:
88 -96, 1144,18 88 def (pate Pata, coatentr atz):
except Exception raise (clussrror(f"aailee to write file: (e)*)
-def with_peth (ie Fath! -> atr:
""rviey the artire file concenta directory listing.""
+def viex_path obathoob; Path, view_ranges Optional [List [int]] [int]]
None) -> strr
View the file contents (optionally within range) directory listing.
Args:
pb]] Path object for the file or disectory
view_renge: Optional (start, end] line numbers for file viewing ooy
if path_obj. is_dir() if viex_range raise Valuekrror ("viex_ronge is not supported for directory listings")
None:
Poz directories: 1ist non hidden files to 2 levels deep try:
result subprocess.cun/ A8 -115, +172, 14 def vien_path/patth.bb Path) -> str:
except Exception ra (a led to 'st directory: 16)*)
If it's file, show the entire file with line numbers content read_ (ilttpt
forpst_oatput (centent, (pati__bbb))
f if it's file, show the file content (with optional line range) start_line read_ffle_rangee (path_obj, vingerange! start_line)
retura format_output (content, (content,, str sprtpphh_cbb),
-def funetffnction (command: sti, path: str, file_text: str kone) -> str: tool_functin Icommand: str, path: str, file_text: atr None, viek_range: Optional [List [int]] None)
Main too" function that handles:
"view" View the entire file or directozy listing
directory listing, optionally within range files 'create's Create new file with the given file_text **n
"viey"
"edit" Overwrite existing
leltttt
88 -130, +197,7 88 def tool_function (command: str, poth: str, file_text: str None) +>
path_ob) - validate_path (path, command)
if command = "viex": return siee_pate (pptt_obtt
return view_patte (bsthoob,, viex_renge)
elif
"create";
if sile_text is None:
88 -152, +209, 88 Fool__unction (comannd:: ste, path: str, file_text: str None)
( str:
if
"_main_"
Example usage
pzint LLeoi_furetior. ("view""",,, w/tam///bunttt//////m//cooo .y"))
print stool_furectinn ("view", httm////uueee/aaa///ccco/io .py))
newling
dife --git (tastt/teet_toolsstet_.aee
new file mode 100644
index 03455b3
/dev/nul1 http/est/ieettttoo//eeeeeeeeeee
88 -0,0 +1,54
+import pytest
+Iron pathlib import Path
ffron tools.edit import func_innttion
Idef Leat_view wawlee_llae__aaeeeeeeeee Laage_raaeeeeeeeeeeeeee
[Lmpp___ggee(tm__aal) (Emp_path):
Create test file
41

---

Published as a conference paper at ICLR 2026
rest_file tmp_path "teat. Ext"
ceat_content = "linel "larel'nninan hnllan22hnieeelllinndnnneiese
test_ctlewwwite (test_content)
lest viewing specific line range
result =oool_aanction ("viaw", str file), viex_rongo=:2, 4]1
asaert *1nee2" in result
asser: "line3"
result
asaert *1ine4" in result
assert "linel" not resuli
"line5"
resul:
assert 2it" in result Correct line numbering
$ Test viewing from start to middle
reault ttol_faaccioon "anction("vias"
(test__file), viex_rongo=(1, 311
asaert "linel" in result
asser: "line2" in zesult *line3" in result assert "line4" not in result 1\t" reault
viewing middle end with
reault Lool_fanction ("view", 8tz (teat_filel,,, view_range=(33 -11)
asser: "linel" aot resuls result assert *1ine3" in result
*line2"
*1ine4" in result
assert
*line5" in result
assert
+def test_view_reage_vellie waleeaaaaidadiinnnno (tap))
Create test file
teat_ffle- tmp_path Steat.txt"
Lest_conteat "LineeNalineehalleeeee ::ss__fleewwstee_ece (tnet))) (tot))))
Test invalid start lise
resul: tool function(""ieee str (trsstt__flell rien_rangem (0, 211
*Failed read fila range: Start line be >a 1* in result
invelid range
start)
resul: tool_ fanctioonn ("view", (ettstffileee vien_sange= (2, 111 be >= start or result
assert
to
songe:
+def test test_view view wiww_ronge__vveee
that vieu_range la retected for aor-dieean directories
result iont
st: st: (Lap_pata), viek_range-(LL 1011
assert
vieg_range No newline end of file
supported directory listings" zesult
diff --git a/tcols/edit.pp b/tocls/edit.py index 1658521.. 757f552 100644 a/tools/edit.py b/tools/edit.pp
e8 -11,21 +11,21 28 def tool_info():
If "psth" is directory, "view" lists nen hidden files and directories up 2 levels deep.
The "create" command connct be used if the specified "path" already exists as a sile.An generates long output, + <lipppd>' An
truncated and marked with "Kresponse
entire with provided "file_text "ext""""x, _"x, 1* The "atr_replace" command replaces unique occurrence of old_st with nek_stx, falling old_ser is not found or appears miltiple times. an* "input__cceem":
"edit" command overwrites
"type": "objact",
"properties";
"command":
"cype": "string",
"enua"; [*viex", "creste", "edit"],
"description": "The command to run: "view", "create', or "edit"."
"enun": (*view*, "creste", "str_roplace");
ion": "The command to runs "view", "create", or "str_replaca"."
},
"path":
"description"; "Absolute path directory, e.g. '/repo/file.pg"
4 /repo".",
"cype": "string"
"file
42

---

Published as a conference paper at ICLR 2026
"Required paremetez "creste" oz "edit" command, containing the content + for the entire file.", "description"; "Required parameter of "create" command, containing the content for the entice file.", "cype": "string"
"description":
"view "view_range": 88 -34, 144,14 tcol_info();
"stems"; ("sype": "integer"), "minILems": 2, "maxitems":
+], ""old_atr": "Required parameter of "str_replace" command, containing the exact text "description":
find and replace.",
"type": "string"
1)
"nex_str":
"description"; "Roquired poremeter of "str_replace" command, containing the new text to replace old_st" with.", "Lype"; "st:ing"
"sequized"; ["ccamend", "path"] 08 -51,7 -59,7 80 def ialidato_path//pss
command: str) Path:
Validate the file path for aach comnand:
'view": path may
directory;
'create': path must not exist Ifor new file creatien).
'edit': path must
overwriting).
"ett_replace"; path must exist and be file.
path_obj Pathipath)
65,7 1
paiidate_atthppalie stz, command: stx)
Path must not exis:
vath_cbojexiatstl
raise VelueErzor create files (path) already exists.")
elif command "edit";
elif command ratr_replacs"
Path must exiat and must be a file
path_obj.exissss):
rsise Valuekrzor file (path) does not exist.") 88 6144, +152,28 except Exception writa_file Fath, content: stel: raise (fluesrror to write file: (o)*)
rdef it (path: Path, old_str: str, nev_str: siz) >> str: on*
seplace exact eccurrence of sld_str wit's nev_ste in the file.
Only performa repl acement old_str occura exactly onde.
Seturns message indicating success failure.
try:
conteat - fead__ileepssite
occurrences content. (old_str)
1f oocurrences B:
return f'Error: Could find the exact replace in (path)"
elif ocourrences > 1:
multiple ((ocourrences)) occurcences text (path). Must + be unique."
["Beroz:
new_content:> content content.replann aolddcc new_str)
ceste_tillegate new_portent) retura ("Successfully replaced text (path)"
except Exceptioa
return f"gerer during string replecement: (e)"
def viek_path (path_obj: Pash, vieu_range: (Tdatt [int]] Monel -> str:
View the file contents (optionally within sange) disectory listing. 88 -176,12 1206,13 Bg def wiww_pathhpathh_oo Pata, view_range: Optional Nene) str: content, start_line fead_file_rame objt view_range return format_output icontent, str (path_ob)), start_lins!
def foaett tcommand: stz, path: str, sile_texts str None, view_range: Uptional [List [intl] None)
Idef Lool_ loa Icommand: st:, path: str, tele sir Kone, view_range: Optional [int]] None,
43

---

Published as a conference paper at ICLR 2026
old_atr: None, nex_stE: None) SCE:
Main tool function that handles:
"view" View file directory listing, optionally within 1ine zange for files 'creste': Create a new file with the given file_text
'edit' overwrite
existing file with file_text
'viex" View file or directory liating, optionally within 1ine range for tiles 'creste' 1 Create new with given file_text
"atr_replace": Replace exact occurrence of old_str with new_str in the file
path_ab; velidate_path command)
88 -195,11 +226,13 daf toal_function (command: str, path: atr, file_text:
- view_range: Op
wilte_fale (pathoobi, file_text)
return r"Pile created aucceastully at: (path)"
elif command *edit":
if =ixe_text is Nore:
ValueError ("Ml required "fflletext" 'edit' command.
wiile_rile (p file_text)
overwritten with new content." elif command =- "str_replace";
retura E"Pile (path)
if old_str is None oz nev_str is None:
reise Voluetrror ("Missing required "old_sts" and/or "new_ate" for 'str_replace'
+ command.
str_replace [nt_epppaae____iieeppppeee (ptt old_str, new_stz)
ralce Velue conmand: (command)")
diff --iit
ittests/_init____
file mode 100644
index 0000:03..
git a/Lesta/LeesLtools..p
b/Lesta/Lest_Loolls.
new file mode 100644
index 0300003..cc72222F
/dev/nul1
+++ h//tesssttettttoll.gg
e8 -0,0 +1,65
+import pytest
pathlib import
+from tools.edit import tool_function
+4 Test fixtures +8pytest.
+def temp_ff comp_fileetee (tem__ffltttt_pthlll
file_path = Lmp_path "xt"
conteat "line Mnniie
sile_path.wsite_eexx (content) return str atr(flle_path)
+def test_str_repll (temps (temp_fflat fila):
successful replacement
:result tool_function!
cormand""sts__eeiace"""
@etheremp_fflo.
old_scr="[ine 2in", pox_ets""repleeei lins
+
assert "SucoessCully replaced"
assert (ttmptem_ffiee) text =- *line 1'nceplaced line\aline 3%2"
+def rer_rrrpllc__eeeeee
(tamp_file)
+ Test when eld_str is not found
resul: fooe_fnnetion
cormand="str_repl.c
peth-tenp_file,
old_s::="
"ow__ors="comtthnng"
assert "Could not find" in result
Originsl file should be unchanged
asser: Pata [temp_fiee) text_text -- *ine 1Anline ZnnLine S\at
+def test_str__rt test_sttrrrppacee httpplllce_mttpll..eeoeee htt.aacc_mmttpeee_ccrrreee ooc.ureeesssssseeeeeeesseessssse (temp_file):
First create file multiple occurrences
2ath (temp[tie))
("same\naase Ansame\n")
zesul: Lool_
cormsid""assreepaaee""
path-ieng_file Cile,,
oid_azz=*sameVa
44

---

Published as a conference paper at ICLR 2026
tew_ats="differenele
assert "multiple" in result
Original file should be unchanged
assert file) read_text == "same'nsame Ansame
+def
wtg.aannass__aaaaaenngonaa (temp_rile)
lest micsing paraneters
reault [annccion
commaxde""tr_rpppaeee" peth-temp_Eile,
"Missing required" in reault
tast_str_____tttt test_str_replaaee rer_rreeeeee____e insslid_pothh)
Test wita non-existent file
resul: function
cormand""sts_replace"
patth=//oocxisston//attiti old_str="old", 3ew_st=""new"
assert "does not exist" in result No sewline at ead of file
-git w/Lin_withtools.. b/Linswicttcols..yy
index (e3dbbb..ecc3300 100644 a/1im_withtone thtmoooloy
+++ b/Lim_withtoolss
88 25,7 129,7 8e def proces_tooll
tool_name, tool_input):
daf get_reegonso_withtone
client, nodel, messages, tcols, tooi_choice, logging=None, logging=No1e, systemmmessageemee ):
try:
if 'slaude" in model:
88 -52, 13 +52, 32 88 def get_ pirpponsexiithtolls
raise Valuetaooo return responss
model: (model)")
except Exception aa 6:
logging (f*ro in jel_cesponae_uithtooss (e)
error_msg (el
logging (f get_rosponae_iithhooll (error_mag!")
Bitting contex:
if 'Tnput is too long for requeated model in str(e):
pass
if 'Iaput is too long for requested model' in ecrer_nsg 'maximun. context length' in
error_nsg:
if aysten_mesazger
$ Extract system message from the firat messaçe if available
ayst_enneassae measagen [0]. get ('content', "") measages elsa
if isinstance teysten_message, l1st):
system_nessage (block (llock("texx)) "text"] for block mesten 15 block ['type'] 'text')
Summarize corveraation history
Surmariaed__essaa
Lurmarixe_nessaeeee (client, model, messages, aysten_neseagg)
Retry with summarized messages
retura get_response_nitttook. cliensmclient, model modelsmodel,
meseages-summrrrseee.ee
tocls-tools, cocl_cheiieetooo_chhoitte
loggiag=logging,
Re-saise exception logging reise Re-raise other exceptions
def check_for_tool_uee model=!!):
88 - +266,57 def carvort.ngg.hsttory.ommm (mag_histary) new_nsg_histor.
45

---

Published as a conference paper at ICLR 2026
+def summariza so_ commariiz__msseeeeee messagesssessseoo (client, model, measages, system_ mossage):
Creates condensed summary older messages waile preserving recent centext.
Only summarizes assistant and usez messages, keeps tool results as is for accuracy. oue
f Keep the most recent messages intact
recens_nage ressages[-22
(messages)
messages
if [messaggg <= retura messages
Prepare messages to be summarized megs_ro_sumaaiza messagea [1=2]
Create prompt to summarizo rermesy_request "Please create concise summary of this conversation that preserves the key context and Impoztant detaile:"
conversation
for mag mags_to_ssat summarize: if isinstonce get l'content', (1), list):
content Jofo (block ['text for block in mag] "contentt") blook ('type!) 'text else:
conteat (msg.gee ('coatent', (1)
if mag. ('rll"' in l'assistant', "user"]; surmary_ ["Ma[mag role") (content)"
try:
summary
surmary_resperae,
get_responee_fron__In
magreumarr_reeuust,
elient=client,
model=model,
syatemm
summarizer. Create concisa but informetive aummory."
print dal.ee---allse
mag__hie mis_historr-11
Create message history with the summary
surmarize_histtrry = []
"sale": "aystem",
"content"; [i"type"; "text", "text"; ayatem_meaaage]]
"scle": "assistant",
"content": [["type": "sext", "taxt"; 3"Pravious ccnversation summery: (aummary_response]]]
+]
f Add back the recent messages surmarizes_hittoz
(xtenddreeentt_mgga aatrraaeeeeeecccreeeeeeeeeeeeeee
return oummar seeerriiedd__ae hetorsstory
except Exception:
# summorization fails, return original messages with the most recent ones [messages[0]] recent_mags
Sonneet__mg__isstae imsg history, model=None):
Convert message hiatory "rom the model -speciipe format generic format. 88 -263,7 +333, 14 80 def cher_uith_geemmmmnnleoo
model, Neg,
< logging-printl:
ic neq_hietozy
heg_tistery = [[]
system_message f''ou are a coding agent. agent.Ankn/ss. www.///geetoooooseeeprrroooo ())
new_nag_history msg_history
nek_nag_history meg_history.copv () if maq_history elae []
$ Ensure system message is the first measage in history
new_mag_histozy new_msg_historr(()) ('rolee) ("ol"")) 'systen's
histeryyttt "sole": "system",
"content"; (1"type": "text", "text": syatem_messaag)
try:
tocls
diff gitit e/zeding_agent b/coding_agent.py
index Ja2cc2f..3flbeee 100644 o/dding__geent.c
+++ coodding__gent-pp
111,6 1111,7 38 clase AgenticSystem:
46

---

Published as a conference paper at ICLR 2026
sel self_ iss_immproeesalle. instance_id-Woon id-None, max_retriea=3, aun candidates=3,
J:
self.prablom_ttttome arrbeemmsttatmmet prablom_sttatmmet
petr.git_temppd git_tempdir
88 - +122, 88 class AganticSystem:
self.'nstance__ instance_ 1d if not self_improve alse "dgm!
self.code_mmdee self.nax_retriee max_reszies melf.num_camdiddee
SLAUDE_MODEL
mur_candidates
Initialize logger and score it in thread-local storage aelf.iogger logge_logger cchat_history_ffeee
88 -190, 7 +192, 7 28 Your task ls to run the regression tests in the (seld-git_temddrr) directery to
def (salf)) *..
The Iorward function for the AgeaLicBysten.
function AgeaticSysten that generates candidate patches.
multiple
ins_rusttutttion gemsq have uploaded Pythen cods repository in the directory [self.git_tampditt Halp solve the follewing problem.
88 205, 10 1207,18 08 Your task is to run the regression tests in the tself.git_tempdier directery to
Your Lask to make changes the files in the temmpii) directory address the sppatlem_desccapeion.. have elready taken care of the required dependencies.
**.
regression summary once
regression_tets__ummss - relf..get.egreessio..eee
Lists store candidates
valid_patches = ()
walid_roport
retry_count
while setzy_count self.max_retries:
retry_count salf.max_retries (nnalid_patchher salf.num_candiooee mum_eandidatees
(ffe_log("")a=e Attempt (retry_count 1) of reetfies =-=*)
aafe_log(f" (f"Valld solutions 4 desized")
(vanlval
[self.num_con num_esnnddateea
Reset to base commit before each attempt retry_nount 0: reset_te__cmmii (self. (telf..itt_temddiir self.base_cn base__cmmit)
88 -216,8 8 +226, 88 Your task la to make changes to the files in the (aelf.git_tampdis directory Add cetry context to instruction if this is retry attempt instrustion base_ins:ruction
if retry_count >
inatruction p***) Previous attempt (8) fai led because they efthee produced empty patches enly modified files.
-P -Plaas ensure your solution includes changes to the main source code files, not just test files. ***
instruction +- g*r") Previous attempt is) did not produce enough valid solutions.
provide a different approach salve the problem. Your solution must include ()) changes to the main source code files, not just test fi lea. *en
Run the Low_mag_hiatore
chat_with_apee ageet runttruction, model=sel f. wwo.deeooddeeeeeee hig_hhitory--]] logging=sate__ue 88 -228, 16 45 88 please ensure your solution includes changes to the main source code files, not
is valid: (eg pasch generated: (seasen)")
break
zegression
cendidate
test rest_report self. self..un_rogressioo.co.
reat_score get_rrport__eareecco (test__rroooottrooooreree
(f score: [test_score]"]
47

---

Published as a conference paper at ICLR 2026
(ealii self.num_candidaee break
else:
sog IE"Iavalid patch: (reason)")
if rerzy_ sels.max_ mexx__etriiss - 1: (og_loog("etyyngg with attempt...")
elae:
safe_logf "Mixiimmm
rezchad,
generace valid patch. ")
reley_count
if not valid patches:
safe__oo (* generate any valid patches.")
retura
$ Use score_tie_bredd breaker to select the best paton (o""__o
Selecting Best Solution from best_index bir_eakkerr
Candidates ---?)
sea....rablonstattmeee walld__pathees
valid valid_ loggiagmeaae__og
Reset base and apply the best patch
to_mmttt w...gi_taanddii sel --aaae_coommtt best_patch patotes (bettees [nest_index] safe (f Applying Dest Solution (Candidate (best_inded 13) --="!
best_patch)
Final validation the selected patch
rinal ssore salf.run_rogreaet iataassiintttttttteeeeeaae
(finnll Sote_loy(P"Tina solution
(Cinal_score)")
mainl):
passer wwwparse...aeeee.ee..e..e.....es www.mmettPsree (descriptoon Preeces "Precess reposi:ory with agentic
+ system.
paraer.add_argumoo ('=pproblm_ssattmmeee requi halps'The problem statement
4 to process")
1236,7 parser.adf (" ("==seff____moooeee default=ralse, action= "riion''ttore_tree"
main():
+ helps 'Whether self-improve repesitory solving axe')
aegser. (tmattacctttsstttcee___l default=None, help- help='inssen Inssence for SW2 issue')
porser. ("= ("==mxx_ratrrees type=int, default=3, helps MMaxmmm number of generation attempta')
( (t--ruu_canddeee
Lype=int, defaulte3, help- NNmber of candidate
soluticns to generate") arga ()
Process the repository 88 - +331, 88 def main():
self_improvewarge sew.arrggg.e.ttmmroooe.....
instance_
laraunce__dargeeee id=args. wtw.ergge.iisanne..... ins-ance_id,
max_cetziiesaagee.o waw.aeeienn...iiiis..... rak.cerriieeegg.....crtaeee,
man_ www.caaddtttrarrreeo.o wtw.rarrrrnmmmmccididddeee...
Run the agentie aystem to try to solve the problem
--git a/coding agentt.geeee.......ee py s/coding_ageat.pp.
index 3c1beld. .589938d 100644 s/coding_egent.pp b/ b/eeding_agent
-193, 42 +193, 88 Your task is to run the regression tests in the [self.git_tompdit ee
directory def (self:
..*
The Iorward function for the AgenticSystem that generates and evaluates muitiple + cendidate patches.
This version mointcins history of prior volid patches and results, only using the ( tie-breaker necessary.
bese_inatrustion gnent uploaded Python code repository the direstory (self.gia_tempdll Helpp solve the following problem.
ieprablom_desariptte
[aelf ttt.ppobbemstttteeee deproblen_descciitiion
48

---

Published as a conference paper at ICLR 2026
sreat_deacrippe deelif.:eat_deccrppttt
</Leet_description
-Your task is make changes the files in the (tomf.gtt.. directory address 4 the garablen_deacrppton I have a already taken care of the requi red deperdencies
Get regression Lests summary ance at the start regression
self. rea..gge_eeegeesioooeesssss
Liats candidates
Lists to store all valid patches and their information
polic_pstches
valid_reports
valid_scored
best_acore
indiccss () $ Indices of patches that share the bast score
relty_count D
while retsy_count melf.mex_retriee and len (ealiii
seif.aum_eandiddtee.
( Aitempt (retry_court + 1) of geell.max_retriiee ---t)
safe_log solutions so Eer: (1en (aacidd of cendiiatts - desired")
58 log (f"Cureent best teat score: (beat_score)"
Reset to base commit before each attempt retry_count
resel_to_commi
belf.base_comit
instruction if this is retry attempt inatruction iase_instruction
Add xetry
relly_count
instruction + g***)NNOT:: Previous actempt is) did not produce enough valid solutions. Construct instruction previcus scluticns available
instruction ga*rI have uploaded Python code repository the directory (ael5.gir_temddir)) Help solve the following problem.
(self. [felff.rrblee wwwpppprcbeeeeeeee Ltabbmmet)
<</prablen_descriicioon
deserttdescciiionn +(self.rest_dd +1aolf.rest_deserriiiioo descrrppioni +</test_descrlpp tons*e*
previous solutions context available
if valid_patches and retry_count >
previoua_soll
a (]
for i, (patch, report, score) in enumerate (zip patche,, velid_reperts,
4 -alid__ccorad)
srevious_solutio apppeed (f"e
iPrevious Solutioa firl;:
*<oode_changes>
+(patch)
*</oode_chre _c/eode_dhangga>>
+rest Score: (scors)
+Test Report: (report)
[**n]
instruction +- "MalnErevious solution attempte:An" "An". jjin jein sppevious_eolutiioooo
instrustion "inPlease provide new solution addresses any limitations +) previous attempts or explores different approach."
elif retzy_count 0:
instruction i- **PAnNOTE: Previous attempt (5) did not produce enough velid sclutions. Please provide different approach to solve the proplem. Your aolution must inolude source files, just files,
changes
instruction 3*MAnYoorr
changes the files ci directory to addreas the sproa en_descriptions have alredyy taken care of the required dependencies,"
sealf.git_tempeee
Run the agent new_msg_hise history shat_with_agene (instruction, model=self.c cow.eseeee..deddell..... b hig [I, loggingaacfe_log)
8B 6 14 Please provide different approach to solve the problem. Your solutien must inc
velid patchess append (patch) relod_s atppndddeeepspeeeeepee
49

---

Published as a conference paper at ICLR 2026
valid_ saaiissscore..paaattttttt appsn (test_
Update best score indices
if Leat_acoze best_score:
best_ test_score
neat_patches_innicoo
elif teat_acore =- best_acare,
best__atchhe__iddeee weeeeessniiiisseeeeee andices..apen..d (len (mclid
len pea.ivaaid_aatchii bresk
>- self.num_canddialees
88 -257, +282, 88 plezse provide different approach to solve the preblem. Your solution inc.
sate_log("Failee co generate any valid patches,") return
Use score_tie_breake to select the best patch
Only tie-bresker if have maltiple patches with the best (f Selecting Best Solution from (len(valid_patchess) Candidates ===*) beat medex_ndexx-o soore_tie_breaxer
self cell,ppettiem__taaemmetttt
valid_patcies, valld_reporta, loggiagreaft_log
if len (bnab ttwpppathhs__nineiseeeee >
2ate_loy(["Muttin solutions (fIen ([leless__accheelliiids)s tied best + (best_scoze). Using tie breebreeeer))
best_index score_tir_breaeer
[valid_patched [i] for in cett_eetche_iindicee
[valid_reporta [i] for in best_pcttche__nndicca)
loggtngesare_lig
best_ index best_patcchs_iiddiee
index)
best_index sest_pptches_iidiceee0
Reset basa apply the best self.baseecommit
reset_to_commi weell.ggt_eerpeeeee
best_patch
(best_index
Applying Best solution (Candidate (best_index 1)) ===")
ssfe_log (f" Applying Best Solution (Candidate (bast_index 1)) with docre
(valid_scores [best_index]: ===*) best_patchh
Pinal validation of the selected patch Einal_test_report self.rum.eegesoioor.etttcc
final_secre aet_rsport_acareeEee (ftnnna__tesrtrepppc_ee
58 (f solution test score: (final_ [rinal_scora[") (a velidation test
[final_secre]")
parser azggarse Aww.menttuumae.....m..m..m...... Arguarse.Acguueett system.")
Parser Aug.uunetuPseerrdddcccippooaaaee (deecrigttion zeposi:ory with an agentic
F.2 DGM ON POLYGLOT
Diff patches contributing to the best agent discovered by the DGM on Polyglot:
dirr --git a/ h/coding_ageeeeeeeeooo py bycoding_agent.pp
index 04I0b36..663000 6639abd 100644
a/coding_egent.pp
b/coding_egent.ff
ee -4, +4,9 80 import: logging
Irom logging. import RocatinggFiefiandlee::
import
import threading
+import json
+from dataclasses import dataclass
+from typiig import list, optional.
from Linwithtoole import CLAUDE MODEL, OPENAI MODEL, chat chat_with_egen: frem desiis.git_ut... 48 -42, 5 +45, 14 88 cOST_COMAADS = Thread-local storage loggez thread_loca. = threading.locol
impors diff_versus_com veersss_comiit, reset_to_commit, apply_patch
50

---

Published as a conference paper at ICLR 2026
+8dstaclass
+clags sollutionActampe
mrrclass to atore information about sclution attempt, petch: str 4 The petch content
rest_output: str t Raw test output
reat_suecass: boal Whethar beats passed teat_atate, dict & Test statiatics (0.g., number of paased/tailes led beats)
def vet_throad_logger ()g
Get the Logger instance specific the cusrent thread.
88 -102, +113, 88 class Agenticlystem: chat_history "aaaal.chhttttttttttoo Lest_descripp ion--nton, sel5__mprovv-=ral.e. Iayguage="python"
sanguege="pythont" mex_actempts=3
1:
goroblen_statemmnn
em_atatement
SelL.git_Lempee git_Lempdiz
- +123,7 class AgenticSystem:
SeLE,Ltes_ddscriplle Lest_descrript.on
self.self_improve selE_improve sang.ianguage language pelf.mx__tttemps mox_ mox_attempta
Set the code model based on whether self improvement is enabled self.code_
if self_improve else CLAUdE_MODEL 88 137,11 1150, 63 08 class Agenticdystem:
now_mag_histor
(sn_Le) tuple [bool, str, dict]:
eargua tests and retura success status, output, and test statistics. tos success
output *n
stats ("passed": 0, "failed": 0, "errers": 0, "cotal"; 03
try: command Noer_coWWND..gor. get (self, Language, (1):
prec subprecess.
command,
ceeturr__oupput-Trre
text=T*ue,
check-False
output - EnS (* (commend) infproc.stders /tpp:o....ccrrrrrro..
5uccess raternodd
if success: break
* Tzy to extract test statistics from outpat simple example; you might want sttta =ttata ["passed"] output.count count (*PASs*) output sutpet.ccunt. ccunt ["ok"]
sophisticated persing
stats atats ("failed")
cutput.ccmee (*FATL") output. count ("not ok*)
stata stata["erroza) ["erross"] output, count (*ERROR") output. count ("pania:")
stata ("total "]
stats ("passed) stata(*fai (ed""" + stats "errars")
except
Exceptioa as e:
output f"Error running tests: [str(e))"
success = False
retura success, output, stats
anslyse_test_cet (self, attempis: List[Booutioo)A)eee)))) "**Analyze test results and create summary for the agent. summory
Resulta Anclysis\n\=*
For 1, attempt in (a 1): summary g*#t Attempt (illn
aummary 1- I"Test Success: (attempt, test__ttttssssseeeeeeeees success
summary 3"Test State: dimps (attempt. tattent..test_tttte indent=2) An"
summary += "Key test output:An" A'""">"""""
Extract relevant parts test outpst (e.g., error messages)
ooooppttt "\a", foin,iin( for line in attempt, wwwp__ttppt..tttteoeooo.. wpt.opu.....tttttt..eo.p.. (*Ao")
if "PAIL" line or "ERROR" in line or "PaSS" line)
summary (key_output]
summary
51

---

Published as a conference paper at ICLR 2026
def (orworddself)
The forward function for the Ageatic8ysten.
The forward Eunction for the Agentickysten with multiple solution attempts. *.a
taak paant have uploaded code repository in the rectoryy [selt.ggi_temmdll Relp following problem.
attempta: [ 1 innttt
best_atteepe Optional [Solut LonAitempt]
None
base_task g"*"g have uploaded code repository in the directory (self.git_temmdiii
solve the fol lowing problam.
sproblam sprroblem_desccippcim descriptioon Ise sselt.problem... seeeesettteentt
ee 149,8 1214,52 class Agenticšystem:
Your task in to make changes to the files in the soolf.git_temmdiii direatory to address <problen dew.dddteetooooo
have already taken of the requi red dependenct
instruction E"
MNieaes/ enalyze problem description carefully. edits the code files to complete the instruction. init_edit chat with__with_ (instruction model=self wwwrseel..oddeeeeeeeeeeeeeeeeeee model, mig_history []) Leggingssafe_log)
actempt_nim range
tax_attempts);
$ Reset to base commit for each attempt
reset_to ceset_to_commice (self. timpe self.base_commit)
Prepare the instruction based on previous attempts instruction base_task
if atterpts::
analysis of previous allempts
instruction +- "An'aPrevious solution attempts have been made. Hlere are the resulterAnve sttllya__tttt__rutsseeeee
instruction
instruction 4- "AnPleaze analyze these results and provide improved solution that 4 addresses the issues found."
elae:
inatruction +- "Nn'nPlease analyze the problem description carefully. Then make edits to complete instruction."
Cet solution attempt
chat_with__gent (instruction, model=self.code_mmdes msg_history [], loggingesafe_log)
Capture the current curreat_paton = diff_versus_commil (selI.git_Lempdia, J.L..base_comiity
Run tests and collect results
reat_success, teat_outpot, test_stata relf.ruu_testa()
f Create and store attempt
attempt solctionAttemg patch=current__ptke sest_outputt outppp test post_aaccesestest_.nn success, reat_state=teet_eea
attempta.appert (attempt)
# Update best attempt if this one is better test_success and (best_astempt None wetceptt.eet_sttttee (*passed*) > bost_attempt.tes__ttttt ["passed"] best_attempt attempt
$ If teats pass perfectly, we can stop Lest_success atiempt.test_stale (*failed"]
4 am 0:
Apply the best solution if found, otherwise use the last attenpt sinal_sttempt best_attemps or attempts[-1] reset_ tocssttt_ooommeeeo commit apply_patch htt.:.gggtttttpeeeeeeeee sttem_tttemtt.etcchh
selt.baee_comit)
main()::
parser arggarse www.reeerrgggeetererreee Idescripti "Froceee reposicory with agent + system.")
88 -162, 6 +271,7 38 def main(!:
addeer.
cest dst__decrrpttonl default-None, requized-Palee, repositozy")
help" Descriptien
52

---

Published as a conference paper at ICLR 2026
padser. ("=-selE improve', defsult=ralse, actions satannetttteetee "empsiieeeeeeel____iooreeee
b help=tWhether "Wether to sel fel the repesitory or solving oxe") arrprddo_rtnmeetttt""e
required=Fa_ee, "efaultt"pythhn"" choices-[ 'pppp',
'jave", 'python', 'go', 'rust', 'javescript'), helge 'Task''s programming language")
persor, orguumgn ('-=mp__atteppaa', typesint, defoult=3, helps Maximum number of b solution attempts")
arga parser-parse_arge
Process the repository
88 -173,6 +233,7 38 def main():
self==mprovesarg..sel. aunguage-arqs.langquee max wex.eettanttsarrg..oo...ot
the agentic system tzy solve the problem
88 -185,4 4 +296, 88 def main (1:
patch)
if name ma
mein
newline end of file
diff --git a/tcols/edit.ppt
b/zocls/edit.py
d7184c3. .77f4488
a/tools/edit..p 111 b/Lools/edit.pp
-1,5 +1,9 from pathlih import Path
inport subprocess
+from typing import List, optional, nict
14 Global edit history for undo funetionality tedit_history: lstE, List[ste]] - ()
def toal_infol):
return
88 14 +14,14 38 def tool_infols
The "create" command cannot be waed if the specified "path" already exists as a inle.in output, will be truncated and marked with "crespense
If ""coomand" gemerates "clipped"".> .'n
The "adit" command averwrites the antira file with the previded "file_text'.h
- No partfal/line-rane edita or partial viewing are supported, supports viewing specific ranges, string replacement, insertion, < undo oparations. n*n,
semput_schemas
"type": "object", "properties": "command":
"type"; "string",
"enum": [*view*, "areate", "edit"),
"desoription": "The command to runs "view" "create", or "edit"." "enua": [*view", "creste", "edit", "sts_replace", "insert", "undo_edii"), "description": "The command b "unda_edit"."
"view', "create", 'edit', 'str_replace', 'insert',
"path":
"descriptioa"; "Absclute path ( //rep""""
directory, e.g. '/repo/file.py'
88 -66 6 +30,23 def tcol_info():
"file_text":
"description"; "Required paramater of "areate" or 'edit" conmand, entire file.",
containing the content
"Lype": "string"
"ylew__ange":
"description": "Optional paremeter for "view" command to display specific line renge (start, end).",
"type": "array", "ilema": ("type"; "integer") },
"oid_str":
"description": "Required paremeter for "sts_replace" command, string zeplace.", "type": "string"
"new_atr": [
53

---

Published as a conference paper at ICLR 2026
"description": "Required paremetez "sts_replace" "insert" commands, string + to ingert.",
"type": "string"
"insert_ line":
"description": "Required parsneter for "insert' command, line number whare insert + text.",
"typa": "intoger"
}, "required"; ["ecamand", "psth"]
88 -43,7 -64, 8е def validate_patt/patii str, command: str) +> Poth: for each command:
Validate the file
'view"s path may ze file or directory; muat exist,
'create's path must
exist Ifar new file creation).
tedit"; path muat exist (for overwriting).
others: path must exist as file.
path_obj Pathipath)
88 61,14 182, 88 def validate_paae (path stc, command: atx) > Path: Path must not if (xch_eo).exiats(]
raise (Eluetr create new filez (path) already exists.")
elif command "edit":
elae:
Path
must file
iE not path_obj.exisssil raise (f
(path)
exist.")
if path_eb), () raise (f is a dizectory and cannot be edited as file.")
clae:
raise ValueFrror (f"kknnoun or unsupported command: (command)")
return path_obj
88 14 1108,21 21 se def reed_file (path: Path) str:
except exception as e: raise (f
read file: (e)")
def prite_file (path: Path, content: stz):
+def write_fileeit (path: Path, content: str, save_histery: bool = True):
"**grite (overwrite) entire contenta. ***
if save sove_history:
the
history before writing
if path.existe ():
spaip))h)
edit_histozy:
edit edit_historr (str (psth) =
edit_history (str (path) ] aappend (path, read_ (1)
path.urite_tee except Exception (content)
raise ValueError to write file: (e)*)
-def viex_poth (path_obj: Path) -> str:
+def view path view_path spath_objs Path, view ranger optional [Mist [int]] None) -> stre
*enview the entire file contents cirectory listing. "*" if paathabjj-la_drrd
Poz directories: 1ist hindeidden
levels deep
88 -115,35 #141,101 88 def (iex_pathhppshhhco Path) -> str: except Exception as e: raise ( to list directory: 16]"!
If it's file, show the entire file with line numbers
# If itts file
content (petthhiep
lines cwntert...pp........ content.splitliness
$ Randle Tine range viewing
1f viex_range:
if lea lealview_range ralse ValueBrroz ("view_range must contain exactly two elements: [start, end] *) start, end viex_renge
if start < 1 or end > len (lines):
raise ValueError (f" Adjust for C-based indexing
range [istart), [end]] for file Ie (1ines) limes")
conteat "la", join Linesssseet lrend])
return formst_ostput (content, strip_ii_cb)), linemssat))
return format_output icontent, (path__bbb)))
54

---

Published as a conference paper at ICLR 2026
dee tnol_funat ion Icommand: str, path: str, sile_text: atr Nonel -> atrt
tdef str_replace [path_obj: Path, old_str: stx, new_atri stx) str: """Rpplace string in file, ensuring uniquesess. "*e
conteat read_ (pachh__))
Chock for miltiple accurrences
if content.count lold_str) 1:
return f"grrer: Multiple occurrences ((old_atr) found. Replacement requires unique b match."
elif conteat.count (old_str)
retura f'Bezer: String 'ooddstrr' found in file."
new_str]
wiite_tile (path_obl, new_content) editad: replaced '(old_ate) with ([nex_ate]" return f"File !path_obj)
Idef insert_text [path_obj: Path, Lasert_ int, new_ste: stz) atr: ""rinsert text at specified line number. "*n contant = fead_filepppttheee Ifnes contert.aplltlineell
insert_ Line
insers_line len(essss)
ralse ValueBrror IL"Iavalid insert line (insert_line) for file with (Len (Linee))))) Lines")
insert the line. insert (insart, line - 1, naw_str par_att.ratrip("Na new_content "\n", (iinnisess) "In"
the specified line (adjusting for 0-based index)
wsite_file (path_abj, new_content)
retura ("Pile at (path_obj} has been edited: inserted Lext at line (Lasert_
+def undo_edit (path_oobj Poth)
"orgndo last edit operation on the file."*n pathLatz (pat)_ob])
if path_sts not in edit_history or not edit_ cdit_history (taths]
return "Ercor: No history aveilable for this file."
Restore the last saved content
previoua_oonee edit_bistory hwt.haoooyppthhhttt.. (psth_str] ppp(() write_tile (bath cevioous_ontteti lave_hiatory-Falls ["Last edit (path_obj]
undone auccessfully."
tool_fonction (command: sts, path: str, Askworgs) +> *en
Main toel function that handles:
'view" View the entire file or riretrory listing
"creste": Create a new file with the given file_lext
existing Main toal function that handles all commands:
'edit" Overwzite
file_text
'view" : View file/directory (optionally 'create' Create
1ine rangel
file
'edit" Overwrite existing file
'str_replace" Replace string file 'insert" : Insert text at line 'undo_edit"
edit
try:
path_ab; validate_path (path, command)
If conmand "view";
retura view_path
view_range kwazgs.gaz waagg..gsssvvccweeennedd return view_path www_pathipath_ohh, viex_range)
elif command -- "create":
if file_text is Nore:
'file_text'
kwarga:
reise ValueErroz ("Missing required 'file_text" for 'creste' command. ")
(path____ file_text)
(patt_
retura ["Pile created succeasfully at: (path)"
elif command -- "edi:";
if 'file_text! not in kwargs:
raise ValueRrror saing required "file_text" "edit" command,
weite_rii file (path_obl, file_text)
weite file obat kwargs (orgss'fileetese filee_txx"")
f"vile (path) has been overwritten with content."
elif "str_replace";
55

---

Published as a conference paper at ICLR 2026
'old_ste' not kwazgs or 'new_ate' kwazgs:
raise VolueError ("Roth 'old_str' and 'nex_str' are required for string roplacement.
return str_replace (path_ob), kwarga ("old_atr") kwargs (onggssneesseeee
clif command "insert";
if "insert_lire
in kwarga 'nex_atr' not kwarga:
raise Valuetrror "ineet_lline' and "new_atr! are required for text insertion, fon.")
return insert_text (path_obj, kwarga ('insert_line")) kwargs "nex_atr"]]
ellf command "undo_ddit";
retura undo_edit (beth_cbj)
else: ralse ValueBrzor (E"Unknown commands (conmand)" ")
--qit a/toola/edit.pp b/1ools/edit.pp
index 87fa413. 100644
a/tools/edit.py b/Loois/edit.py
88 -117,7 +117, 7 38 def write_ Pată, content: str, save_history: bool True): stripath)
edit_history.
edit sait_hhstoryy (path) =
[s aappend read
path. weihheritteeeee text (content)
except exception as e: raise ValueError (f"Failed
(e)*)
48 -172,17 +172,25 eg det str_replace bath_obb: Path, old_atr: str, new_ster strl -> atr: zeturn l'File at (path_obj) has been edited: replaced (old_str)" with "nee_stz]""""
daf insert_text (path_abis Path, insert line: int, nem_str: str) +> aem:
specified line number. nen
a**insert text at specified lina number (1-based). content read_ (ptthppah_bbb (eat lines content.
if insert_lime raise ValueRrror [f*Taval insert 1ine [insert_line] for fi with (len lines")
insert_line lenneis 1:
insertion if insert_line 1:
raise ValueError (I"Invalid insert 1ine (insert_line) must be greater than Q")
if insert_line (1ines) I 1:
reise Valuetrror (f"invalid insert line (insert_ling file only has flen (lines) lines")
$ Trsert the rew text at the apeci line (adjusting for d-based index)
lines.insert (insert_lime
1, hes_str.ratrip("S. ("\a")) + "in"
new_content
& Clean up the new text to renove any trailing aewlines sew_text new_str.rstripp ("\nn"
poaition (1ine numbers 1-hased, 1ist indi (-based) $ Insert at indexeinsect__ine, so it appears after the ourrent Line at that position (insart_ (insart_line, line, new_text)
Insert
Join lines with newline and add trailing newline
"An', (Nn'_join( '\n"
prita_file/path..c naw_consent)
return t*Fi at (path_obj)
edited: 'rserted 1ine (fnsert_line)
-243, +251, ralse ValueErzor (C"Unkkow, conmands (command)")
tool funtiionccommade stc, path: str, **kwargs) str:
except Exception
return f"Error: (a)r
15 name
mein__
Example usage
print [unettin ("view",
No newline at end of file
return f"Error: (a)
No newlire at end of file
--git s/cedinggagent.......oo -y b/coding_agent.pv
index 6639abd. .9tbabdd.9994b63 100644 s/coding_egent.pp +++ b/ b/coding_egent.pe
ee -52, +02,10 88 class Sclut tonAttmpttt
test_output:
output
56

---

Published as a conference paper at ICLR 2026
test_suscees::
tests passed
test_sttat:: dict Test statistics 1e.g., number of passed/failes test.)
ecror messagee: [ist[str] None blat of specific error nessages
test_details: diet None Detailed test information like specific test names and their 4 status execurior_time: floot
Test execution time seconds
attempt_rumber: int None The attampt number in the sequence
def sesthroad_logggrae
88 1250, +154, 82 88 class AgenticSystem:
return new_mog_histon
extract_tesseeeeeeeeeeeeeeeteese _ttst__eesattttte_ee__teeeeeeeee (salf, output: atr) tuple List (str), diet): "**xxtract detailed teat information from the output, *na
ecror mcror_nessages
test_details [] stats (*paased": 0, "failed": 4, "arrora": 0, "total"; 0, "akipped":
$ Split output into lines for analysia
lines output.spliit"
Language-specifii parsing
if self. self.language "python":
for line in lines:
"FAILED" in (":" [0]
in
sest_aame www.. =
"FAILED"
atats("[ailed" 1-1
elif "PASS20" in line and *::" in line: sest_name aatne.pplitt"::"" (pp.pl [0]
teat [tt_tetttllstttt_aaalla atats["pasaed"]
*PASSED"
elif "ERB0R" in line and "::" in line: test_aame line.aplit (1].split [0]
(t__detttisstts__amme stats("erroza" +
"ERROR"
Extract (line) (1ine
message
if Linea. e-roo_messages s=sor__esseeee.aaeedddld (lines [lines, index (line) 11)
1 (Lines):
clif salf. language
("javascript", "node"]:
curreat_test None
for line in lines:
if line.sta*tsufth (*checkmark"))
Lest_aame line. Line.replace (eeplace(' ('checknakk, ", "I.strippt)
test_detaill
*PASSED"
statal"passed"" +=
elif Hinesstartswwthh((xlll
rine.replace ('x', ()) (t)strip(()
teat_ [tettetttlssttt_rronlll
"FAILED"
atats("railed"]
curreat_test Lest_name
curreat_test ('Eeror:' in or 'Assertiontrres!' line)
aroor_mscaggo.aagendeeoo (aarootttt sLine.strip()">
clif self saig.langugge "rust":
for 1ine in lines
("tes=") [1] [1].split s"...t ("...") ("]..") "Lest" ("teees
and
line:
zest_aane line. =ess__detsslllteess__oom
"FASSED"
sttatl""passed" +=
ellf "test" in 1ine *.. FAILED" in line: test_name line..ne..... line.eplit ("test") (1]. [p].split ("...") (0].strip()
teat [eaa__detallsttet__aaaee atats["[ailed"]
"FATLED"
elif -_--- in lize and " stdout ---_. in line:
cest_name line.aplit ("----") [1].aplit ("atdcus") [0] (trrip)) if test_name in best_detard and dest_detailaa stcet_nann =e "FATTED": ecror_ sirror_messages.coe ( 1.strip(!), '')"")
Inext (11 for in 1ines [lines. index (1ine) 11s]
Generis counting
languages
fallback
if noz any (stats.velues())
stata ("passed" output.courd (*PAss*) sntput.coune ("ok")
atats ["tall"(aleed] output.cour (*FAIL") outpet.coom count ("rot ok?).
stats ["ecrors"] output.count. ("RROR") output. ("panic:")
atats atats ["total"] stats ["passed"] stats ("aile"") 1 stats (Peccoss)
57

---

Published as a conference paper at ICLR 2026
return stats, erxos_messages, test_details
def conntestt (self) -> suple [bool, atr, dict]:
run beste and return success status, output, and test statiatics,"" import time
success False output
stats
("passed": 0, "failed"s 9, "arrors": 0, "tocall:
start_time time.timen
try:
for command in CEST_COMMANDS.. get langgaa, (])
proz subpresess.
88 -169, 34 +243, 97 BE class AgenticSystem:
success pree.seturneede if break
$ Tzy Lo extract Lest ataliatics Irom output simple example; you might atats ["passed"] output.coure (*PASS*) sutput.count ("ok")
sophisticated persing
stats ("faiee"e output. (*PAIL") output, cetpt ("not ck*)
("error"er output, count (""RKOR") output. ("panie:")
stata("total") atata("paased)
stata("failed") + stats, (errars""
# Extract detailed test information
stats, error_men meros__essages, test_details lele (cutpur) stats atats (eatseeeecutio_tiie
Lime, (ime.time() start_time
Enhance with extracted information
atata("erro"_ "eperrr_messsees"" artor_measagen ("Lest_deellalss" Lest_details
except Exception as output ["Error running tests: (strle):"
success ralse
"passed"; 3, "failed": 6, terrors": 1, "total": 1, "execution_time"" time.time() start_time, [str(e)], "test_detoila";
success, output,
analyze_test_ restu (self, attempts: List: (colucioon:ttemp:)) stz: ""*nnalye test results and create summary for the agent.
"**Analy20 test results and create detai led surmary the agent." summary " Test Results analysishain"
Overall progress tracking if lealattempis) > >1
sunmary 2rcçress Overviewin" First_attempt = attempts [0] .test_stats
laat_attempt attempta(-]] (ttlllll__tttttatt .test_stata
progresa
"passed"; last_attempt ['pasaed"] first_atlempl (*passed"),
"failed"; Eirst_attempi ( ['ailed"] last_attempt ( "failed"],
"errors": first_attemps (*errors*] last__ttempt (fersors*)
surmary "Progress since first attempt:
aurmary +- fr- Additional pasaing teats: (progresa "paased" PAn
aurmary surmary += f-- Reduced errors: (pregress (recrress"eezora eeeroors'' []] Aakn"
Reduced failures: (progress (' failed") Paa
netaf le attempt analysis for i, atlempt enumera.e/altenplaa, 1): sunmary +- f*#t Actemps (illn"
sunmary 1- I"Test Success: lattempt, suscessscceesssa
summary
State: djmps (attempt. summary +s "Key test output:la"** An"" "a"
indent=2) An"
Extract relevant parts test output (a.g., error messages)
key_outpet "\a", join,oin(line for line in attempt, west__uttut..tt...pooooo www.ouupp..pplltt.... (")))
if "PAIL" line or "ERROR" in line or "PaSS" in line)
sunmary (key_oututtt) "n""nna"
summary f"Execution (attempt test sest_stats.get ('execution_time" 22E)
58

---

Published as a conference paper at ICLR 2026
f Teat atatistics
stats tetem teat_stats
total stats stats.get get ("total", 0) Aveid divislen by
pess_rate (stats.get ("passed", 0) tcttl) * 100
aurmary +- r*Fass Rate: (paas_rate:.111 (Istats.get ("paased', or (total)))n An"
surmary
statistica:\n"
aurmary *- f*- Paased: lstats.get (ertssgeet"ppassee ('passed', (nn"""
aurmary r" Failed: sstats.geL/"failed" 0) (nn
sunmary g*- Brrors: (stats.get; /eressggeeeeerozs,, ''erorss', 0) An"
summory Total: [total/\n)n"
$ Erroz messages
stats.get parror_messogas" aurmary t- "Brror Messages:'nn
for erior in sunmary f"(erzer)
# Limit to top ezzors
if lanttt ["aetttt aurmary (aarrrrrrrrrr__aaaass massagas")) >
(seats [erroor_eessggea]] aurmary 1- """""""""
errorain"
$ Test details
if stats.get ("test_ ("test__detsiil""" detsils");
surmory "individual Test \es for test_name, result in stata stata "ostt_ddtaal") .itama () aurmary ['Iresut]]; [test_name/\nn surmary 1- """""""""
Recommendations for next atteapt if not attempts ( [--l.ttest_successs surmory "## Racommndattions for Next Attemptin"
laat_atata = attempts - .tstt_satts
if last_stats. (eaasttsgeeeeeerrreeeee ("errors") 0) 0: summary
Focus resolving
arrers firstin"
if last_stats. get ("failed", summary
Address failing test casesin"
and attempta ottemmall-")..teoo_ucooo 8 Compare with previous attempt
if lan lattemptaa
prev_stats attempts( 2].test_state
if last_stats. gttss.ge ("passed", 0) prev_stats.get ("passed", 01: summory
shangas
regreasions, Consider reverting some changeskn"
return cummary
def (sel 20 36
changes to files
- directery to
tasts collecs results
test_success, test_output,
self.run_tests
Create
attempt
Create and store attempt with enhanced information
attempt Solutionatrempt
pctch-current_pptee
rett_oorput--esttooppptt
tert_peceeeetest_uaaeea,
teat ccat_ataassteet_atats
Leet_alats-teet_ettl.
esror s=zor__mssegee-ttttttttts ('errcr__ (1),
zest berr__detalleettt_ssttso.oo "tess_detaille" 1]1,
soncurioor_ttmeetteeeee sttieasst_tttttppppe ( ('axecut inccutiionn ion_time', None),
attempt__unee htaptpt___mmeettttttt_to
appemptaaappenddaate.
F Update best attempt if this one is better
tast_succesa (best_astempt cessptt.eett_satte [*paasea*) > best_atee wtt.aaatttttttttttteeee "ttats("passed" Update best atlempt based on aultiple criteria if test_success and best_attempt is None or (attempt. cetemptt.eet__ee test_state ["paases""" best_attempt. test_etate test_etatee"paazed" (*pazsed"))
None
sestappt.test_rtee ["passes]] =e best_attemp: test_state ["passed"] and
len wew.ttattterrro_mmeeeeeee or []] len wwwsstttttteeppppeeeeeeeee arror. arror_ arror_messages []13
best_attempt attempt
Log detailed attempl information
soge_log (E" Attempt [actempt_nus Summary ===")
59

---

Published as a conference paper at ICLR 2026
if Success: succe_su
sa fog (f"Testa Passad: itest_atats.gon ('paased', ()19)
lo (f"Testa Falled: Itest_stafe sta._stttts.eeeee gegeeettaaaaleee ("tailed', 0))")
(esfe_log(EPErreee (f"Errors: seet_sstts..ge ('errers', 011
(f (f"Execttion rime: |test_ ''execution_time (N/R")
of teats pass perfectly, we can atop
test__
to attempt. westt_tssssssssssst ("rrrat"""rrrs") =* 0:
break
G
SIMILAR TARGET FUNCTIONALITY, DIFFERENT IMPLEMENTATIONS
For the same target functionality, the suggestions provided to the coding agents and the resulting im- plementations can differ significantly, leading large variations in coding capability and benchmark performance. For example, consider nodes 6 and 24 in the DGM run on SWE-bench (Figure 3 Both aimed to enhance the existing editor tool support finer-graie amer-ggained file editing. However, the implemen- tation for node 6 retained the original edit command and added the parameters edit_ and edi aca i ioss, whereas the implementation for node replaced the original edit command with new str_ and thus the implementation details differed greatly, as did their performance. Node achieved only 23.3%, while node 24 achieved 40.5%.
ce command. Despite targeting similar functionality, the feature suggestions
Feature suggestion to obtain node 6:
Within the tools/edit.pp fila, remove the 'adit' command and intraduce a 'str_ sttrrropace' to "new_sts" Ithe new Lext Le reglace it with), Alter verifying that 'old_ste" 'nex_ste',
should accept paranetera 'old_str'
file, zeplace 4 'old_atr' is not unique or is missing, do not write changes.
appears exactly once
occusrence
Keplace the 'adit' command the editor tool with 'str_repiace' command that lonates
+ and replaces an exact subatring in file. The 'old_atr' must natch consecut ve should
found ocours multiple times, occur. The 'new_stz' paranetez contains the revised lines. Tais precise substring breakage.
uniquely, and
+
replacement
enable incremental
Feature suggestion to obtain node 24:
Augment
the existing 'editor" tool to support line er token-based editing. The agent would specify individunl lines takens insert, delaze, replace. internally, the calmically, ly, ard verify that the surrounding context remaine intact. This prevents entire- file overwrites, reducing the risk of losing unrelated logic. The toal could also validate that the ediced Lines match expected code fragnents to eatch unanticipated differences or merge conflicts.
tcol would parse the fi conterta, apply changes atomics es
Enhance the agent's fila editing proceas support fina-grained adits. specifically, add a line-based or toxen-based editing feature in the 'ecitor' tool. This improvement sections code without should the ageat insert, zeplace, preserving unre ated logic. Tmplemant
oversriting re 1es or large alocks,
safeguards to confizn that contextual code around the edited region zemains regressions when fixing issues.
reduce the risk of
Implementation of suggested feature obtain node 6:
git a/Lesta/Lest. letieestt__dt__ool_pp_ b/Lests/Lest_ sereett__di___eee tcol.py
index (078266..daaddE. 100644 a/tests/test_ett http:/eara_dttttall.ppopp
+++ Cirests/test_edt_tte
88 -1,1 11,7
import Pytest
from pathlib inport Path
inport tempfile
-from tools.edit import sool functiono
+from tools.edit import toel_function, validate_eddt__ee ootto validate_context
fixtest.fixturr def ()
88 -17, -17, e8 def sampla_file (temp_drr): file_path. icattetnt return fale_path
icontent)
60

---

Published as a conference paper at ICLR 2026
@epytest.fixtune
+def (temp_dddd))
".rCrreate sample Python rile for teating token-based edita."
Eile_peth temp_dir "test.py"
conteat "nrdef test__unctionn)::
42
y "old_value*
return lyr
+**0
w.lee_ptth.witte_e text (cortent)
return file_path
class "eatFditorTonl:
def ceat__vee__tleeeee
sampl_[file::
viewing
content."".
48 -35,17 +51,182 se claas torTool assect "Ezror" result *already exists" in result
test__ddt__ oolet_illeeeeeeeeeeeeeeeeeeeeeee sample_fflel; "orTeat editing an exlating file,"e
test_edit__iiz file_fflllseeee_ sample_file]:
n"rTeat editing exlating file with file mode, ***
new_content "edited cencent lanew line*
result toos__anctionn"ee ("edit", (sample__ilel) mile_toxtime__ccnten:)
reault tool_fanction)
"edit",
atr (samplpee__flll)
sile_cextraex_coneeen
ed edit__ype="'ile"
"has bean overwritsen" in result assert comple_tlle.ie read__txxxt == new_contert
def test Lest_line__iee base_aaae__diiiineeeeeeee (self, sample_filel file): o*rrest line-based insert operation. ***
actioas =
"action"; "insert",
"lino_number")
"content"; "inserted Line"
resul: tool_fanction(
"adit"
str(sample_file),
odit_sypo="Line""
odit_aattonseaattoo
assert "sucressfully edited" in result
content =
aplitlines
assert content [2]
line"
(certeett) ==
test_line_____ttteeeeeeeee cest__iin_baaed_ee seee__edit_deetee sample_file):
"arTest line based delete operation,
actions
"action"; "dcleta",
[1innenumber*;
reault tool_function
"edit", (is(sample__iee)
edit_syges"line"
odit_aaationsssatiorr
"successfully edited" in result
content - sample_tile wea.e..eeeeeeeeeeee...eee () inee
assert (ccrtent) ==
def test_ caat__Hn__haassee _ine__ased__ee based_edit________ee_eeeeeeeee__ adwi_rrplaceeeeeeeeeeoeooeoeeeee (self, sample_fiion unrTeat line based replace opecation,
actions - If
"action"; "seplace",
"line "iine_numbe=;
"content"; "replaced lize"
1]
reault tool_function
Medit",
(sample___
edit edit_type=""iee",
adit_antiiosmectiinn
61

---

Published as a conference paper at ICLR 2026
asser: "succesafully adited" in result
content
(1, aptiiiitieees
content [2] -- "replaced Line"
assert (ccnntett)
def jees__toee___te baaker_baaed__ee bwaed_adeeeddeeeeeeeeeeeeeeeeeee Lddi (self, code_ctlel:
edit operation."*!
actsonns = [[
"action"; "seplace",
"old_token": "old_value",
"nex_roken"; "nex_value"
reault tool_function
"edit" atrroooe_tile),
edit__sye=""ckee"",
edit_actiionvaatiinss
+
"sucoesstully edited" in reault
conteat - www.d_eeeeeeeeeeeeeeeeeeeeeeeeee
content assert "pen_value" in content
"olu_valus"
def test_eelseeeeeeeeee wtt.spuipppppptoeeeeeeom (sll,, code_file): ""*Test multiple token-based edit operstions." acttions
"sction"; "seplace", "old_token"; "42",
"nex_roken"; "100"
"action"; "seplace", "old_roken"; "old_value", "nex_roken"; "nex_text"
reault tool_fanction( "edit", filee, eddi__sye=""ccee"",
odit_aatione-actionn.
assert "sucnesafully adited" in result lede_fflerread
assert *42" not in content
assert *100" centent
asser: "old_valus" not in content asgert "rex_text"
sortent
def test invalid__iine numbar (self, sample_ "a*Teat edit with invalid Line number, a** actioas - I[
"sction"; "seplace", "lime_numbor"; 100,
"content"; "irvalid line*
reault tool_fanction(
"edit", (it(sample_fie)) edit_syges"lize" odit_aattinssaations
"Ercor" in result assert texceeds file length" in reault
def test_ iest__ivalld_edit.. sypt sample_file):
**erest reault tool_ranction Pedit", simmll
invalid adit type.
edit_iyye="invalllt
edit_actioas= [(actioo"; "replace")]
assert
assert *Inwalid edit_type" in reault
def test__iissingreequieeee fselds sample_file):
nerTeat edit with missing requized fields. "** actions
62

---

Published as a conference paper at ICLR 2026
"action";
"seplace" Missing nime_n content
]]
reault tonc_nanction
"edit",
(tr file),
edit_rype="lire",
edit_aatiooseactiic
assert "Error" in result
assert "Missing required fleld" in reault
def test_ralidate cot.aaaaaat_cottttteeeee (self);
"**Test context validation function. *** original "line 1Anline 2'nline S\nline 4Anline 5"
modified "line iAnline 2iemoai: 4\nling assert val foriginal, moditied) is True
f lest invalid context many changes) modified conttet torl goriginal, moditied) False
Ancontent"
val
aetioaasssnnsse test_empty_edt a (self, sample_file): ""*Teat edit with empty edit actions." "*r
resul: tooo__functoon! "edit",
stampll file),
edit__ype=='iner edit__ edit_actions=(1
"Ercor" in result
asser: "idit actiens cannet be empty" in result
def test_edit sesittronexxsteeee menexistent_ffleeasee felssel temp_di-1: *"*Test altempting edi: nonexistent file, non_existent__iin file = zemp_dir
diee__not_exist.cst
cool_function//e ("edii"" str wxw.eeessstteteeeeeoe file), fila_text="new centent"]
resul: tool_fanction ("edit", (nonLexisten___fie)) edit_type="line,, edit_actions=(]
assert "gzror" in result
assert *does exist" result
82,4 4 def test wtw.iiiaaldddmaaaaaeeee (self, command, sample_file):
TestRditorTeol:
various invalid
n**
result tool_functio: (command, str (sample_filet)
assert "Error" in result *Error" in
No newline at ead of file
--git a/tcols/edit.py b/zools/edit.py
index 33137ee..882se 100644
a/tool //toits//ddt..py
+++ //too//////ittp
48 -1,5 +1,7 80
pathlib Import
import subprocess
+from typing import Dict, Aay, List, Union, Tuple +from difflib import soquencaMetcher
def toal_info():
return {
fi1,9 If 'peth" is file, 'view" displays the entire file with line numbers. If "path" is noa-hidden
Lool_info!):
directeries up The "create" command cannot be used if the speci fied "path" already exists file.An Ir ""command" generates long output, will be truncated and marked with "cresponae clipped>>'.
directory,,
deep, Aa
-+ The "edit" command overwrites the entire file with the provided "fLie_text" suppozted. "*", +* The "edit" command supports beth entire file overwrites and fine-grained line/token
Ne pertial/lime range edits or pertial viewing
oditing
"edit_type" parameter.
+* tine-hased edits require line numbera and content to modify speci tie parta of Ie
Token based edits require specitying old and new tokens to reglace specific text fragments. *na,
sepput_schema":
"type": "object", "groperties": 88 -24,8 +27,28 "type": "string"
tool_info():
1 "file_tex:":
"description": "Requized paremete: of "create" oz "ediL" command, cortaining the costens for entire file.",
63

---

Published as a conference paper at ICLR 2026
"description": "Required paremetes "creste" oz "edit" edit_types tfile', + containnng the concent for the entire file.", "type"; "string"
"edit_ ttppe"
"type": "string",
Menum"; (*ctle", "line", "token"],
operation: 'file! for full file, 'line! for < edits, 'soken' for token-based edita.", "'defaut"; "file"
"description"; "rype
"edit_ :ctiinsstion"::
"type": "array",
"description": "Sist of edit actions for line/token operations. Bach action containa operation details.",
"itema":
"Lype": "object",
"propesties";
"action": ("type": "string", "enum": ["insert", "delete", "replace"]
"1ine_ iitne_numbe""; ["type*: "integer", "description! "Iine number for the operstion
+ 11 basedi ";,
"content": (*type": "string", "description"; "Content inzert/zeplace"),
"oke_token"; (*Lype"; "string", "description"; "Teken to be replaced (Tor token edits) "b, "nex_token": ("type": "string", "description": "New token (Eoz token editst")
},
"sequired": ["ccmmand", "path"] 88 119,12 1262,126 8B def view_path (path_obj: Fath) str: content read file (path_oobjj return format_outpul Icontent, str(path_obj))
def Lool_fuactin tcommands sit, path: atr, tile_texts +def validate, bicilatt__di___etteeee edit_actions (actions: (Dict Anyll, edit_type: stE) -> None:
8L11
unraalidate actions
edit type. ane
if actions:
reise Valuetrroz ("udit actions cannot be ampty for line/token edits")
valid_actions ("insert", "delete", "replace"]
required
"line"; [*action", "ine__umber"), "tokan": ("action", "ald_token"]
action actions:
if "action" not in action or "ationn"actiosi" not in valid raise ValueErroz (f"Invalid
of: (valid_actionn)
required red firrrde_iiillddddi__.r..rr for field in
based adpe_type
if field not in action:
raise ValueBrror (E"Kisaing required field '[field)' in edit action")
validate line number provided
if "line_number" in action:
1f not isinstance (action [*] "iine_niime number"), 1nt) or a [inennumber"] 1:
raise ValueError ("Lina number be positive integer")
Validate content requirements if acticn["action in ("ingert", "replace"]: raise
edit_type *line" "content"
required for ingert/replace actions*)
if edit_type "token" and "new tokent not in action: raise ValueErroz ("ter ("nex_token requized for token operations")
apply_line www__liieeeee_ee (content: [ist(str), actiens: List(Dict Anyll) List[ste]: ""rpppy line-based edits to the content, *n* modified_content content.cogy/
Sort act by line number zeverse order to handle inserts/deletes correctly sorted sorted(actions, key-lanbda x("line_rumbes" reverse=Izue)
action sorted actions:
line_num (abicon"linn_mmmaaa
Convert to 0-based index
if lime_num Ien :
reise ValueErroz (E"Line number (action ("liae_ 1] exceeds file length")
if aclios("action - "delete";
lime_nom
64

---

Published as a conference paper at ICLR 2026
modified_ [iime_num]
elif action ( "action"] =s "insert";
modiried_
inaert anneoo (1ine__nin aetion["content" ridd_oietttttttttt. content
elif action( ("action") =- "replace";
modified_contenn [lim action action["contens ["conteat"]
return modified_conten content
+def apply_tokes y_ Ladita (content: str, actionss Idst (sto, Any]l] >> stri
""rApply Loken based edits to the content," modiffied_contet: content
action actions:
old_token = action(*old_toonn pationr"sctionn modi Lied_content
"delete":
"*)
elif action (actiooo"
("insert", "replace"]:
new_token action ("aes_nn"a_ttkeer
modifiedd_onteen = modificd_content rep.aaeccrrellaelllldl..ee. rex_token)
retura modified_
IdeI validate_cooee ext (original: modified: stc, Lontext_lines: int bool:
Main toal function that handles:
Validate that the context around medified sections remaing intact. Returns True
valid, otaerwise.
SequenceKatcher find similarity similarity SequenceMatcher (None, original, modified) .ratlo()
between strings
if content is too differant (less then 316 similar), conaider it invelid if stml larity < 0.3:
False
more detailed analysis orig_lines sriginal..plittinee mod_lines fodi
Split into
$ If line court difference is too large (moze than 50%), consider it invalid (orig linee_) (ontong_
retura False
Calculate line-based similerity for sections def www.kkooookokariaaaeeee (blockl: List [str], block2: List [str]] >> float: return sequenoaMatccher (Mona, "An".join (block1), (Nnf.jotn(blook2) (1
blocks they if lea serii__iness) be context_ lines and lea lind_ >= context_lines start_stmi larity got_block_atmilartt
similarity
[tno_liittttotttt___]]]] mod_linnestoorttx__]]] [corttorr__nnes]
end sindaammllryty
orig [ mod [ooo_linos-oarttxx__lnee
$ If efther the start or end blocks are too di different, conaider it (nva 11d ctazt_similarie retura False
end_similarity 0.7:
returr True
idef Lool_function Icommand: sts, path: str, file_texts str None, =edit_type: str "file", edit_actiona: List (Btcttttr, Anyl] Nonel >> str: on*
Enhanced tool function that handles:
'viex"
antire file direstory listing
tereate's Create a new file with the given rile_text
"edit" Overwrite an existing file with file_text
'edit! Edit file using of three modes:
file: overwrite entire file
based edits
token: toker-based edits
try:
path_obs welidate_peth command)
88 -139, +276,36 88 def fool_function (cemmand: path: file_text: Ncne)
+ st::
retura g"pile successfully at: (path)"
65

---

Published as a conference paper at ICLR 2026
elif command == "adit":
if file_text Nore:
raise ValueErroz ("Missing zequized "file_text" for 'edit' command.
file_text)
f"File (path) has been oversritten with content."
f Read original content for Line/tcken edits and va validation originai_content
edit_type in (*line", "token")
if eypt_type *Lile";
if file_text is Nene:
reise Valuetrror ("Missing required "file_text" for 'file' edit type.")
crite_file (path (path_abl, file_text)
retura ["Pile at (path) has been overwritten with new content."
elif edit_type in (*line", "token"):
if not edit_actions: raise Valuešrror ("Edit actions cannot be empty for line/token edits")
vallidtteeon ie
edit_type)
edit_type *line";
1ines apt
modified_lines apply_line_edin edite flines, edit_ections)
modified_contenn "An".join (nddi
elae: 4 taken edits
modiried_content apply_toxen_entee _ditt fortetnal_content, edit_actions)
Validate context before writing
if valldate_context lorieinal_content, mod::ied_conteat:: write_ (rste__fleppath_abbb aedified
f"File (path) has been suscessfully edited using [edit_typel-baace editing."
elae:
ValueErcoz ("Coatext validation failed. Edit operation aborted.")
else:
ValueError (f"Invalid edit_type: (edit_cype!""
else:
raise Valectrzor command: (commend)")
88 -152,4 +314,4 4 38 def tool_funct (command: sti, path: atr, file_text: str None) ->
name "_main_".
Example usage
print furccticrr ("view", //tamm//abbantt///////m////coono http://///we/eee//////////////// www.://oooooooooo..oooooooo ) ("view", //damm///bbintttsw////////dddddo www.geettngggggnoeoooooooem
No newline at ead of rile
Implementation of suggested feature to obtain node 24:
dift --qit a/tools/edit-pp b/tools/edit.pt
index 18ae521..75715c2 100644
a/tools/edit.py +++ b/tools/edit.pp/
-11,21 +11,21 28 def tool_info():
If 'pzth' is direstory, "viex" lists nen-hidden files and directoriss 2 levels do
The "create" command cannot be used if the specified "path" already exists Cile.
If a "'commend" generates long output, will be truncated and marked with "crespense <liippd>>'
<x The "adit" command overwrites the entire file with the provided "eltttt ,"", replaces unique
with new_str, failing + if old_str is not found or appears miltiplo times. an*,
"str_replace"
"input_ schema":
"Lype": "ob ject",
"properties":
"command";
"type": "string",
"enun";
[*view", "creste", "edit"],
"desoription": "The command to runs "view", "create", or "odit"."
"enua": [*view*, "create", "str_replace"); "description": "The command run: "view", "create", "sts_replace"."
1.
"path":
"description": "Aosolute path to file or directory, e.g. "/repo/tile.pp "/zepo".", "sype": "string"
"exe":
66

---

Published as a conference paper at ICLR 2026
"Required paremetez "creste" oz "edit" command, containing the content + for the entire file.", "description"; "Required parameter of "create" command, containing the content for the entice file.", "cype": "string"
"description":
"view "view_range": 88 -34, 144,14 tcol_info();
"stems"; ("sype": "integer"), "minILems": 2, "maxitems":
+], ""old_atr": "Required parameter of "str_replace" command, containing the exact text "description":
find and replace.",
"type": "string"
1)
"nex_str":
"description"; "Roquired poremeter of "str_replace" command, containing the new text to replace old_st" with.", "Lype"; "st:ing"
"sequized"; ["ccamend", "path"] 08 -51,7 -59,7 80 def imlidato_path//pss
command: str) Path:
Validate the file path for aach comnand:
'view": path may
directory;
'create': path must not exist Ifor new file creatien).
'edit': path must
overwriting).
"ett_replace"; path must exist and be file.
path_obj Pathipath)
65,7 1
paiidate_atthppalie stz, command: stx)
Path must not exis:
vath_cbojexiatstl
raise VelueErzor create files (path) already exists.")
elif command "edit";
elif command ratr_replacs"
Path must exiat and must be a file
pathsobj.exissss):
rsise Valuekrzor file (path) does not exist.") 88 6144, +152,28 except Exception writa_file Fath, content: stel: raise (fluesrror to write file: (o)*)
rdef it (path: Path, old_str: str, nev_str: siz) >> str: on*
seplace exact eccurrence of sld_str wit's nev_ste in the file.
Only performa repl acement old_str occura exactly onde.
Seturns message indicating success failure.
try:
conteat - fead__ileepssite
occurrences content. (old_str)
1f oocurrences B:
return f'Error: Could find the exact replace in (path)"
elif ocourrences > 1:
multiple ((ocourrences)) occurcences text (path). Must + be unique."
["Beroz:
new_content:> content content.replann aolddcceelld_tt new_str)
ceste_tillegate new_portent) retura ("Successfully replaced text (path)"
except Exceptioa
return f"gerer during string replecement: (e)"
def viek_path (path_obj: Pash, vieu_range: (Tdatt [int]] Monel -> str:
View the file contents (optionally within sange) disectory listing. 88 -176,12 1206,13 Bg def wiww_pathhpathh_oa Pata, view_range: Optional Nene) str: content, start_line return format_output icontent, str (path_ob)), start_lins!
sead_file_rama objt view_range
def Lool_ Funct tcommand: stz, path: str, sile_texts str None, view_range: Uptional [List [intl] None)
Idef Lool_ loa Icommand: st:, path: str, tele sir Kone, view_range: Optional [int]] None,
67

---

Published as a conference paper at ICLR 2026
old_atr: None, nex_stE: None) SCE:
Main tool function that handles:
"view" View file directory listing, optionally within 1ine zange for files 'creste': Create a new file with the given file_text
'edit' overwrite
existing file with file_text
'viex" View file or directory liating, optionally within 1ine range for tiles 'creste' 1 Create new with given file_text
"atr_replace": Replace exact occurrence of old_str with new_str in the file
path_ab; velidate_path command)
88 -195,11 +226,13 daf toal_function (command: str, path: atr, file_text:
- view_range: Op
wilte_fale (pathoobi, file_text)
return r"Pile created aucceastully at: (path)"
elif command *edit":
if =ixe_text is Nore:
ValueError ("Mi required "fflletext" 'edit' command.
wiile_rile (patt___l file_text)
overwritten with new content." elif command =- "str_replace";
retura E"Pile (path)
if old_str is None oz nev_str is None:
reise Voluetrror ("Missing required "old_sts" and/or "new_ate" for 'str_replace'
+ command.
str_replace (it.aaoee__niilleppaa___ooooo old_str, new_stz)
ralce Velue conmand: (command)") ittests/_init____
diff --iit
file mode 100644
index 0000003.
git a/Lesta/LeesLtools..p
b/Lesta/Lest_Loolls.
new file mode 100644
index 0300003..cc72222F
/dev/nul1
+++ h//tesssttettttoll.gg
e8 -0,0 +1,65
+import pytest
pathlib import
+from tools.edit import tool_function
+4 Test fixtures +8pytest.
+def temp_ff comp_fileete (tem__fllettt_pthlll
file_path = Lmp_path "xt"
conteat "line Mnniie
sile_path.wsite_eexx (content) return str atr(flle_path)
+def test_str_repll stemp (temp_filat fila):
successful replacement
:result tool_function!
cormand""sts__eeiace"""
@ethsremp_fflo..
old_str="[ine 2in", pox_ets""repleeei lins
+
assert "SucoessCully replaced"
assert (ttmptem_ffiee) text =- *line 1'nceplaced line\aline 3%2"
+def rer_rrrpllc__eeeeee (tt_ (tamp_file)
+ Test when eld_str is not found
resul: fooe_fnnetion
cormand="str_replee
peth-tenp_file,
old_s::="
"ow__ors="comtthnng"
assert "Could not find" in result
Originsl file should be unchanged
asser: Pata [temp_fiee) teat_text -- *ine 1Anline ZnnLine S\at
+def test_str_ test_sttrrrppacee cereppaceemlttpplee htt.aace_mmttpleecccrreeee ooc.ureeessssssseeeeeeeseessss (temp_file):
First create file multiple occurrences
2ath (temp_tie))))
""same\naase \nsame\n")
zesul: Lool_
cormsnd""assreepaaee"
path-ieng_[ile Cile,
oid_azz=*sameVa
68

---

Published as a conference paper at ICLR 2026
bew_ats="differentll
assert "multiple" in result
Original file should be unchanged
assert Itemp_ file) read_text () == ssame'nseme
+def htr__stt_replpeee www.aannnnpaaaaanne [e))
lest micsing paraneters
reault Lfancctoo
commaxd""atr_eeppaee""
aetheremp_file.
"Missing required" in reault
+dof repl_reeeeee___eeeeeeee insslid_pothh))
Test with non-existent file
resul: functiinn
cormand""sts_repiace""
forth=//nooxxssttn///tttti old_str="old",
pew_sL=""Dew"
assert "does not exist" ". in result No newline at end of file
H CASE STUDY: SOLVING HALLUCINATION
The DGM can be used to optimize objectives beyond just coding, as discussed as a potential direction for future work in Section []] In this section, we show that the DGM can address hallucinations of tool use by FMs. Through feedback from evaluation logs, the DGM improves hallucination detection mechanisms and ultimately discovers ways to resolve these hallucinations. We provide a more detailed discussion of when these hallucinations occur, the DGM setup, and the resulting solutions. Finally, we present an example of objective hacking, where the agent optimizes for the quantifiable metric rather than truly fulfilling the spirit of the task and solving the underlying problem.
Halluc
Soore
1.5
3 taska the beslc functionalll
05
Piral beut
Figure 8: The DGM solving hallucination of tool use in FMs. Archive of coding agents generated during the DGM run on SWE-bench to solve hallucination from FMs. Each node represents an agent, with node 0 corresponding to the base agent. Node color indicates solved hallucination score, while border color reflects whether the agent has basic codebase-editing functionality. Edges show which agents self-modified to produce the offsprings.
When hallucination occurs. When the input context to Claude 3.5 Sonnet (New) (Claude) is very long, including all previous tool use inputs and outputs, we found that Claude tends to hallucinate tool usage. Instead of actually making a tool call, it outputs the tool input and output as plain text. This is an example of Claude hallucinating tool use, claiming that the Bash tool used to tests and that the tool output suggests that all tests passed, but Claude did not invoke any tools, and the tool results were entirely hallucinated in plain text:
run the tests as specified the dess__eeccrpttonn
test description indicates
+ that we should useiln)n""'aaha /tt.s////ttttststaatt.t --verbosity 2 -ettttigg=--st__gll --paral's el obshall. .tett.ttt__e_...... rest_ppsstgresg """ Vnnntet me vun this
69

---

Published as a conference paper at ICLR 2026
test ecmmand: Used; bash)niool input: ("command': 'cd /testbed
/tests/rantests..p --verbosity 2 s=sttiing=eeet___gg -=parallel
tesseell, "ntTo. Result: Testing against Django installed in
//Lestledddjjeggg"aaaeee Nalipooogooaaaooiaann. application Bbshell\nkkipel
setup of unused
database default, wcher.\nSysten check identified no issues (0
I IComma ... okintest_coolmm
okintest_beas
htw.grSe@@@hhhaaoaoooooooooooooo [oomanoTTsttCaaee
ockutest_eeccpee_chaaaadeee
okintest_nopass
okintest__iggin__hhnn
4 idbanell..tet__potlll [ttell__ttet__patt::eell htt.aaee_pptteeeeooorrreeeaaeaaa
AnSIGINT is ignored in
Python and passed to paql to abort qurias.
ok WkAnin------
AnRan
Response: Great! All the tests are passing surcessfully. Let explain what each
6 Lests in 0.00Le\atm08
verifies:lninl. "test_accent'ss Tests handling of accented characters in usernames and passworda'n Status: PAsSin of non-AScTT characteraln\n2. cennection with aLandard parameters Statua: PAЗS(a Verifles basic
"ies prope"
pest__asis"" Tests baste
functicnality with usernane, password, host, port, and donamein'n3. 'test_columa's Tests handling of apecial charactera in connection parametera'n Status: PASS \a Verifies proper handling of colens in usernames and passwords
'lests handling escape characters'n Status: PASSIn Veri prope" hand' ing of backslaahes in credentialsknnns. "test_ropaas" Tests connection without paeswordin Status: PASS Verifies behavior when no pasaword is providedvalas.
catt__ssape_sharacee
Dests signal handling for quezy aborticnta status: EASSAR verifies SIGINT handling works correstlyintnies Summery:'a Total tests zun: 6'z Passed: 6%n Failed: O'n Execution time: 0.001stntache test results confirm that our implementation;
(eest_sigint_hane
Surcessfully
handles all types of passwords and special characteraln2. Froperly manages envi ronment vartables Maintains correct signal handling Works correct ly with or without paaswords Preserves all required ionetionalll''nlnfle Lests pass with high speed (0.001s) which is expected since they're nocking the actual has been
pagl exscution. The problem descrised in successfully fixed and verified through the test suite.
DGM setup. We run this experiment SWE-bench. Other than the number of SWE-bench tasks evaluate each coding agent on, and the final scoring function of the DGM, all other settings remain the same as in the main experiments (Section 3. The initial coding agent and all agents generated during the DGM run are evaluated on only 3 SWE E-bench tasks. We use just 3 tasks because if hallucination occurs in one, it likely to occur in others as well. Hence, tasks are sufficient to provide the DGM with a reliable signal regarding whether tool use hallucination is still present.
Solve hallucination score. We score each generated agent based on how effectively prevents hallucinations, with higher scores indicating fewer hallucinations and better performance. For each SWE- task the agent is evaluated on, the score has two components: 0- 1 based on whether hallucination occurred in the logs, and 1 2 (only added and accounted for after no hallucination occurs in the logs) if tools were used in all Claude calls. The final solve hallucination score is computed as the average across all evaluated tasks. To detect hallucination in the logs, we insert special tokens when actual tool use occurs and then check if these tokens appear in the model's plain-text output, indicating that the model mimicked tool use without actually invoking any tools. Importantly, the hallucination checking functions are hidden from the coding agent during self- modification. We found that objective hacking (i.e., optimizing for the measurable objective instead of truly solving the underlying problem) occurs more frequently when these functions are not hidden.
Results. We run the DGM for 150 iterations. In this run, the DGM discovers two promising solutions: node 96, which achieves the second highest score of 1.67, and node 114, which achieves a perfect score of 2.0 (Figure 8). Node 96 addresses hallucination some extent, achieving a score of 1.67 without objective hacking. In the lineage leading to node 96, the DGM first improves the tool transaction logging mechanisms to better detect when hallucination occurs. It then explores various strategies to solve it, such as removing hallucinated tool use from the output text when it determines that the tool was not actually invoked. Node 114 achieves a perfect score quickly, after only modifications in its lineage. However, we observed objective hacking: it scored highly according to our predefined evaluation functions, but did not actually solve the underlying problem of tool use hallucination. In the modification leading up to node 1 114 (see below), the agent removed the logging of special tokens that indicate tool usage (despite instructions not to change the special tokens), effectively bypassing hallucination detection function.
70

---

Published as a conference paper at ICLR 2026
--git a/zcding_ sagaannggggengngg Fy b/cettr index 620da2f.. 803b00f 100644 a/ooding_agent-ppt b/codEng_egent
111
8e
-196, 13 +196, 16 def chat
chator user_insts):
"input": tool_imput
1>
Process the toal call
Process the bool call and secord in structured format
tool_result process_cool_ets (totls_dict, neme_ iool_input) outpur_is. ix.pue_d
[TGOL_ MARKER: toal_namel,
tool_inputly
(TCOO_REEULTT_MARE tool_result]
# Use structuzed format insteed of text mackers
outpur__is.apendd
"tool_ *tcol_invocation"s
"name": tool_
"input": Lool_iaput,
"sesult"; tocl_resuit
Continse with tool resulta nessagea. extend
88
224,7 1227,13 13 80 def chet_witt__claucettkkk cast_ user_inste): toclemtcols,
reol_response_tex: next ((block.been text for block in tool_eespose..cotten if lasattr(block "tex=")), Nana)
outpot_ls..ppe a.ppend I [ _os___RRSPPSRSS MARKER: moo__rsponae_text/y
Record tool response structured Format
if tool_ tocl_resperse_tek:
outpur_is..gpeent
"ccol_sesponse":
"centent"; tcol_response__
response rool_respense
Validate response
In conclusion, the DGM can be applied beyond the coding domain, and we highlighted a case of objective hacking. Similar to reward hacking in reinforcement learning (Skalse et al. 2022). objective hacking occurs when a system optimizes for predefined, quantifiable objective rather than fulfilling the spirit of the task solving the intended problem. This observation supports arguments made in prior works (Zhang et al., [2024b] Faldor et al., (025), which suggest that optimizing quantitative measures often leads to undesirable pathological outcomes, and aligns with Goodhart's law (Strathern 1997) "When measure becomes target, it ceases to be a good measure."
I ADDITIONAL SAFETY DISCUSSION
Any advancement that increases the autonomous capabilities of Al systems introduces its own set of safety considerations (Bengio
2024), especially for systems that improve an open-ended way (Ecoffet et al., 2020: Clunc 2019). Section discusses these concerns and outlines concrete, actionable steps for mitigating them. We call for much more research into and discussion regarding Al safety, including deep thought and discussion amongst all stakeholders in society on the complicated question of what exactly counts as safe AI. We are confident the work we have done was never unsafe (Section 5) but scaled up versions of it could be. As with all transformative technologies, the ultimate impact of such AI systems remains deeply uncertain, and good arguments can be made both for the case that will bring about tremendous good and tremendous harm. These uncertainties highlight the need for sustained, inclusive, and multidisciplinary discussion (not only from current experts but also from wider and more diverse community) how navigate these developments.
71

---

Published as a conference paper at ICLR 2026
J ADDITIONAL FUTURE WORK DIRECTIONS
While this paper has shown the potential of the Darwin Gödel Machine in iteratively improving coding agents via open-ended exploration and empirical validation, several extensions could address current limitations and push Al beyond its already growing role in inspiring culture and advancing science. The following directions outline promising avenues for further research.
Autonomously Improving the Open-ended Exploration Process. In this version of the DGM, the open-ended exploration process described in Section is kept fixed. which might hence impede the system's s seff-acceleration potential. This design choice was made due to limited computational budget. If we were to evolve this part of the algorithm, could require exponentially more compute to identify processes that yield the same improvements shown in Section 4.4 Nevertheless, since the open-ended exploration loop itself implemented in code, can in principle be edited and improved by coding agent. There are many possible implementations of open-ended exploration, for example, using alternative search mechanisms that balance exploration and exploitation (Herr et al.) 2025), keeping only the most interesting agents in the archive (Faldor et al. (025), leveraging the generated agent population as an ensemble (Samvelyan et al. (022).. A promising future work direction is to allow the agent modify the open-ended exploration process, thereby autonomously improving not only its own capabilities but also the meta-process that allocates limited compute to drive self-improvement and self-acceleration.
Role of Humans in Autonomous AI Systems. In the current formulation of the DGM, proposed self- modifications are autonomously evaluated without any human intervention. However, as autonomous systems grow in complexity and influence, the question of how humans should remain involved becomes increasingly pressing. Should human oversight be framed as an optimization objective. incorporated through techniques such as reinforcement learning from human feedback (Ouyang) jtt al. 2022), or distilled into FMs that act as preference judges (Bai et al., 2022)? Each of these approaches raises challenges in terms of scalability, reliability, and alignment with evolving human values. The role of humans in guiding, constraining, or co-evolving with autonomous AI remains an open question. Exploring this dynamic is a promising avenue for future research, it touches not only on technical feasibility but also on broader philosophical and societal considerations.
DGM with Advanced Foundation Models. Recent FMs have advanced dramatically, enabling scaffolds to become simpler on current coding benchmarks (Yang et al.) (024). It is possible that in some settings, like current coding benchmarks, certain engineering efforts in scaffolding might be downplayed by the improvement of the FMs. However, many scaffolding components (advanced tools, parallel workflows, external memory, proxy verification, etc.) still fundamentally can not be internalized by FMs and will be essential for more complex real-world tasks beyond today's benchmarks. Future work to explore how different components in agents will emerge with different FMs could be promising direction.
Evolving Generalist Agent. We believe some degree of task-specific adaptation is indeed expected and even desirable, since fundamentally different types of tasks (e.g., in our case, multi-file Python repository edits vs. primarily single-file, multi-language implementations) naturally require distinct scaffolding components. Crucially, this very property highlights unique advantage of self-improving systems like the DGM: it replaces laborious manual efforts to design specialized agents for diverse tasks with fully automated evolutionary process. This motivates an exciting future direction of running the DGM on a large, diverse set of tasks to evolve a true generalist agent. Also, currently only evaluated DGM on two coding benchmarks. While substantially in task structure (multi-file Python repository edits vs. primarily single-file, multi- language implementations), providing strong evidence of generality, additional benchmarks would further strengthen evaluations.
believe these two benchmarks differ
72


Reviews:
[{"review_id": "itCySumZiS", "reviewer": "Reviewer_G2FT", "summary": "This paper studies how LLM based coding agent system can autonomously improve by editing their own code base. The approach proposed in this paper improves on a line of similar work with the key introduction of a tree-structured archive of past coding agent implementations paired with a parent selection rule which the authors refer to as an \"open-ended exploration loop\". The authors evaluate their method on subsets of SWE-Bench and the Aider Polyglot benchmark, and demonstrate a good improvement from their first agent iteration to their last.", "questions": "- Why is the baseline (iteration 0) performance of the initial agent quite low (20%) on SWE-Bench initially?\n- Where does the 'representative agent baseline (Aider)' number come from on the right pane of Figure 2? Is this the score for o3-mini on Aider's *old* code editing benchmark?\n- Looking at the curvature of the light blue 'Average of Archive' line in Figure 3, it appears to be negative from iteration 50 onwards. What do you think is the cause of this plateau, and does this point to a limitation in the open-ended improvement loop (perhaps new idea generation, or the FM's coding ability, or something else entirely)?\n- What is the variance within each run? For example, in Figure 2, at times the green line (DGM without self-improvement) is ahead of the full DGM's blue line. While I understand the significant time and monetary costs of doing each run, if each experiment were to be repeated 100 times, do you think this trend would continue? In particular, what prevents over-specialization of the agent to the proxy training task (i.e. solving narrow issue-resolution tasks in SWE-Bench's style) which may in time preclude effective self-improvement?", "limitations": "", "rating": 6, "confidence": 4, "soundness": 2, "presentation": 3, "contribution": 3, "strengths": "The paper is for the most part clearly written and does a good job of setting out the broader vision for self-improving agent systems and the promise that open-endedness holds. However, a lot of space is used up in the abstract and introduction for this vision-setting, sometimes introducing concepts which aren't returned to later. Perhaps more of the main body of the paper could be devoted to what is in my opinion the paper's main contribution, which is the \"open-ended exploration\" loop and details of the parent selection mechanism, which becomes somewhat lost in the main text, with key details pushed into the appendix. Indeed, the results in Figure 6 in the appendix show that this is the key enabler of the DGM's performance", "weaknesses": "The initial model performance (as shown, for instance in Figure 2 at iteration 0) is surprisingly low. Claude 3.5 Sonnet (new) [scored 49%](https://www.anthropic.com/news/3-5-models-and-computer-use) on the full SWE-Bench Verified benchmark using Anthropic's internal harness, while o3-mini (medium) [scores 53.8%](https://aider.chat/docs/leaderboards/) on Aider (albeit with pass@2 instead of pass@1 as used in the paper). What explains the seemingly large 29% and 39.8% drop, respectively, between the initial agent at iteration 0 used in the paper and the Anthropic and Aider scaffolds used with the same models? While I understand that Aider is a more mature scaffold which may explain the larger difference (and you may have used the old instead of the new benchmark so my 53.8% number may be wrong), I believe the agent scaffold used by Anthropic for 3.5 Sonnet (new) was fairly minimal. It might appear that the nature of the early improvements implemented by the DGM merely relate to fixing basic functionality in the agent loop. Moreover, it does not seem that the DGM (at not-insignificant monetary cost, Appendix E.1), has demonstrated an improvement beyond allowing the base model (3.5 Sonnet or o3-mini) to perform at its usual level of approximately 49% and 53% on SWE-Bench and Polyglot respectively, by fixing the initial scaffold.\n\nThe paper also only presents experiments on models released around the end of last year. In the intervening time, model labs have continued training models, improving their performance as coding agents by performing large-scale RL training with environments resembling simple agent scaffolds. For instance, the \"bash only\" [SWE-Bench leaderboard](https://www.swebench.com/) or recent papers such as [Dai et al., 2025](https://arxiv.org/pdf/2509.25873) demonstrate that modern models placed in minimal agent loops are outperforming those placed in more elaborate agent scaffolds. The corollary is that while agent scaffolds can support weaker models and guide them to perform tasks such as editing files or navigating codebases which they were not trained to do, as the foundation models are trained to perform these skills natively, such agent 'scaffolding' can become obsolete or even detrimental to agent performance. As a result, the paper's results and the relevance of its claims about being able to improve coding agents by editing their own codebase would be strengthened if they were re-validated with, for instance, Claude 4.5 Sonnet and GPT-5-thinking. Taking the SWE-Bench experiments for example, these should be started with the minimal [mini-swe-agent](https://github.com/SWE-agent/mini-swe-agent) which already achieves 70.6% on SWE-Bench Verified. It would be valuable to demonstrate that the kinds of agent scaffold improvements DGM is able to implement continue to lead to meaningful performance improvements with these modern models. It is possible that with a more sophisticated base model, the types of scaffold improvements may themselves become more sophisticated and abstract; moving beyond simple editing mechanisms and the like towards task management and other more abstract functions. However this has yet to be shown.\n\nIn light of the above, it seems that simply modifying the agent's codebase limits the \"action space\" and precludes achieving the continuous and open-ended recursive self improvement discussed in the introduction. While I note that fine-tuning the weights of the agent's model has been acknowledged by the authors as something for future work, I do believe that the paper would have been strengthened by examining this approach here as a first instance: potentially on a much simpler task than SWE-Bench and with a much smaller foundation model.\n\nFinally, my reading of the transferability results of the DGM-discovered agent across different benchmarks and programming languages at the top of page 8 is less optimistic than the authors put it. The results seem to indicate slight over-fitting to the task the DGM self-improves with, rather than broad-based improvements to the coding agent's capabilities. What is however interesting is that SWE-Bench appears to be a better \"teaching\" task than polyglot, with the Polyglot-trained agent doing comparatively poorly on SWE-Bench, whereas the SWE-Bench trained agent almost matches the performance of the Polyglot-trained agent on Polyglot.\n\nNits:\n- L243: The line reading \"We evaluate the DGM on two popular benchmarks\" reads awkwardly, given the discussion of SWE-Bench and Polyglot immediately prior.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "C3atVRSLK3", "reviewer": "Reviewer_3Ycd", "summary": "DGM is a self-improving system that autonomously evolves its own codebase. It maintains an archive of coding agents that iteratively self-modify and empirically validate improvements on coding benchmarks. Through this process, DGM becomes increasingly proficient at both solving coding tasks and performing future self-improvements. Empirical results show substantial gains on SWE-bench and Polyglot.", "questions": "- Do better agents necessarily incur higher inference costs? Could you plot a Pareto frontier that includes these inference costs, and are the discovered agents Pareto-optimal?\n- Is DGM without self-improvement equivalent to ADAS, and DGM without open-ended exploration equivalent to STOP (Self-Taught Optimizer)? Please discuss their similarities and differences.\n- If DGM can be viewed as combining ADAS and STOP with evolution, what is the benefit of reframing it as a Darwin–Gödel Machine?", "limitations": "", "rating": 8, "confidence": 5, "soundness": 3, "presentation": 4, "contribution": 3, "strengths": "Strong motivation. It is reasonable to expect that AI research will eventually be automated. This paper addresses an important direction likely to remain relevant in the long term.\n\nClear positioning. The connection to both meta-learning and the Gödel machine helps situate the contribution within established frameworks for self-improving systems.\n\nUseful Ablations. The ablations are particularly useful, as they clearly demonstrate the contribution of different components of the proposed algorithm.\n\nOriginal Ideas. The paper introduces a novel formulation of self-improving AI that integrates meta-learning, evolution, and recursive self-improvement.", "weaknesses": "Baselines are missing. The baselines used for comparison are also designed by researchers (they are ablated versions of the proposed method), and no direct comparison is made against other self-improving or open-ended systems in the literature. Adding such a baseline would strengthen the empirical claims. \n\nOnly two benchmarks. SWE-bench and Polyglot are used in evaluation. Including an additional benchmark could help validate the generality of the approach.\n\nEconomic considerations. It is unclear whether better-performing agents come with proportionally greater inference costs. Theoretically, performance could improve simply by sampling n responses in parallel and increasing n at each generation step, especially in verifiable software engineering tasks. An analysis comparing the discovered agents to trivial test-time scaling (best of n) would help establish whether the improvements are meaningful rather than inefficient increase of computational costs.\n\nsee https://arxiv.org/pdf/2407.01502\n\nThe paper states: “Our framework envisions agents that can rewrite their own training scripts (including training a new foundation model (FM)). However, we do not show that in this paper, as training FMs is computationally intensive and would introduce substantial additional complexity, which we leave as future work.” \n\nWhile theoretically plausible, the economic and computational cost of such a setup can make large-scale application economically unjustifiable.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "dDL9x9bkM4", "reviewer": "Reviewer_Cgiz", "summary": "The paper proposes Darwin Godel Machines (DGMs) which is a system for self-improving AI except that it uses a fixed LLM (which they refer to as a frozen FM). DGM keeps an archive of agent variants and uses a parent-selection scheme to choose agents to self-modify. Each child is empirically evaluated on coding benchmarks and, if functional, added back to the archive. Empirical results are presented.", "questions": "Is this RSICG and, if so, why is it not presented in that light? What is the novelty in this paper? Why is it not compared empirically to Zelikman et al, whose code is available online? Can you define the algorithm in the paper?", "limitations": "", "rating": 4, "confidence": 3, "soundness": 3, "presentation": 2, "contribution": 2, "strengths": "They got their novel algorithm to work, with clear signs of self improvement. Ablations show that parts of their algorithm are helping. Authors plan on releasing code.", "weaknesses": "1. The whole setup is the same as Recursive Self-Improving Code Generation (RSICG, Zelikman et al 2023b) which this paper cites, and the paper should be presented as a follow-up and improvement over that work. Both works consider the idea of recursive self-improvement with a fixed FM. \n2. Empirically, it should be compared to that work. (Side note about the name: aren't Godel machines more about provable improvements?) \n3. The paper repeatedly claims its main novelty is RSICG specifically:\n> \"the first self-improving system powered by FMs with open-ended exploration, where progress on its evaluation benchmarks can directly translate into better self-improvement capabilities\"\nWhat does this mean and how does it go beyond Zelikman et al? \n4. The main paper does not contain much detail at all about the algorithm, which is mainly described and defined in the appendix.\n5. The ethical risks of RSI are not discussed. But clearly, the development of RSI poses potential risks that numerous luminaries claim are existential. See [https://superintelligence-statement.org/](https://superintelligence-statement.org/) for example. The discussion around safety focuses on the fact that the this paper's experiments were run in a sandbox, but there wasn't much concern that the system in the paper is superintelligent. The real risk is that it's advancing science towards that goal without clear discussion of why the benefits of this progress outweigh the risks.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "rBDswmPSkK", "reviewer": "Reviewer_VRNN", "summary": "This paper introduces the Darwin Gödel Machine, a system designed for the open-ended evolution of self-improving AI coding agents. The core idea is to merge two powerful concepts: self-referential code modification and population-based, open-ended exploration. Unlike the theoretical Gödel Machine, which requires formal proofs of improvement, DGM uses empirical validation on coding benchmarks to guide its evolution. The system maintains a growing archive of all generated agent variants, allowing it to select parents for modification from a diverse pool of \"stepping stones\". Empirically, DGM demonstrates a significant performance increase on SWE-bench (from 20.0% to 50.0%) and Polyglot (from 14.2% to 30.7%). Ablation studies confirm that both the self-improvement mechanism and the open-ended exploration are essential for this sustained progress.", "questions": "1. What are the anticipated challenges in allowing the DGM to modify its own open-ended exploration process (e.g., the parent selection mechanism in Appendix C.2)? Would this require a separate reward signal, or could it emerge from the existing objective?\n    \n2. Can you discuss potential scenarios where the core assumption of task-capability alignment might break down? For example, could an agent over-specialize in solving small bug fixes (like in SWE-bench) in a way that makes it less capable of performing large-scale architectural refactoring on its own codebase?\n    \n3. The analysis highlights the lineage of the final best agent, which traverses some lower-performing nodes. Does an analysis of \"dead-end\" evolutionary branches offer any insights into common failure modes or deceptive local optima in the agent design space?", "limitations": "", "rating": 4, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 2, "strengths": "1. The performance gains on two distinct and challenging coding benchmarks are substantial and compelling. The ability to automatically discover sophisticated improvements is a demonstration of the system's efficacy.\n    \n2. The paper's primary strength is the successful and novel synthesis of self-referential modification with population-based open-endedness. While these ideas exist in other contexts, their combination here creates a virtuous cycle: better agents become better at creating even more capable offspring, and the evolutionary framework prevents the process from easily getting stuck.", "weaknesses": "1. The paper's claim to novelty in the self-referential aspect needs clearer differentiation from prior work. The paper does cite Yin et al. (2024) for the Gödel Agent and notes that in DGM, the downstream task (coding) directly aligns with the self-improvement task (also coding). However, this distinction is brief. A more detailed discussion is needed to clarify what specific limitations of the Gödel Agent's self-reference framework the DGM overcomes, or how its implementation of the concept is fundamentally different and more advantageous beyond the stated task alignment. Without this, the contribution appears more incremental than foundational in this specific dimension.\n    \n2. The DGM agent is not fully self-referential. The DGM agent can modify its own coding logic, but the open-ended exploration process itself (i.e., archive maintenance, parent selection strategy) remains fixed and human-designed. This limits the system's full autonomy, as it cannot learn to improve how it explores and evolves. The paper acknowledges this as future work, but it is a major limitation of the current system.\n    \n3. The paper is transparent about the high computational cost (an estimated $22,000 for a single SWE-bench run), which is a significant barrier to reproducibility and further research by the academic community. While the results are impressive, the cost may limit the practical applicability and exploration of this method.\n4. What is the signal from the environment to support improvement? Is a validation dataset required for self-improvement?", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}]

Author rebuttal:

Decision: Accept (Poster)