Darwin Godel Machine: Open-Ended Evolution of Self-Improving Agents — part 4/6
Cleaned-text code points [46835, 62835). Bibliography omitted here; source.md includes it.
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 of 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-ended exploration and self-improvement components in the DGM, where open-ended exploration enables the search to escape local optima, while self-improvement enhances the ability to generate better agents.
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.
## Appendix B Additional Related Work
Open-Endedness (part 2). Early approaches to open-endedness explored different mechanisms to balance learnability and interestingness. Quality-diversity algorithms sought to illuminate vast solution spaces with diverse, high-performing behaviors ( Pugh et al., 2016 ; Chatzilygeroudis et al., 2021 ; Mouret and Clune, 2015 ; Nguyen et al., 2015 ) . Other methods emphasized goal-directed exploration ( Ecoffet et al., 2019 ; Ecoffet et al., 2021 ; Schaul et al., 2015 ; Andrychowicz et al., 2017 ; Eysenbach et al., 2018 ) , intrinsic motivation ( Lehman and Stanley, 2011 ; Oudeyer et al., 2007 ; Li et al., 2014 ; Pathak et al., 2017 ) , or learning progress frameworks ( Kanitscheider et al., 2021 ; Gaven et al., 2025 ; Baranes and Oudeyer, 2013 ; Colas et al., 2019 ; Colas et al., 2022b ; Jiang et al., 2021 ; Dennis et al., 2020 ; Schmidhuber, 2008 ; Schmidhuber, 2013 ; Kompella et al., 2017 ) . More recently, large-scale foundation models (FMs) ( Brown et 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 to propose novel solutions in code ( Romera-Paredes et al., 2024 ; Novikov et al., 2025 ; Lehman et al., 2023 ; Faldor et al., 2025 ; Hu et al., 2025 ) . FMs can guide autotelic agents ( Colas et al., 2022b ; Colas et al., 2023 ; Colas et al., 2022a ) , model human preferences for quality and diversity ( Bradley et al., 2024 ; Ding et al., 2024 ; Wang et al., 2023b ; Klissarov et al., 2023 ; Klissarov et al., 2024 ; Samvelyan et al., 2024 ; Lim et al., 2024 ; Havrilla et al., 2024a ) , design reward functions ( Wiering and Schmidhuber, 1997 ; Wang et al., 2023a ; Ma et al., 2023 ; Faldor et al., 2025 ) , create simulated environments ( Sudhakaran et al., 2023 ; Nasir and Togelius, 2023 ; Aki et al., 2024 ; Nasir et al., 2024 ; Bruce et al., 2024 ; Parker-Holder et al., 2024 ; Schmidhuber, 2013 ) , drive ever-evolving multi-agent dynamics ( Dharna et al., 2024 ; Zhou et al., 2025 ) , search diverse ambulating robot morphologies ( Lehman et al., 2023 ) , 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 ; Romera-Paredes et al., 2024 ; Fernando et al., 2024 ; Lu et al., 2024a ; Khan et al., 2024 ; Lu et al., 2025 ; Liu et al., 2024 ; Novikov et al., 2025 ) .
Program Synthesis. Program synthesis ( Alur et al., 2018 ; Polozov and Gulwani, 2015 ; Buchi and Landweber, 1990 ; Gulwani, 2011 ; Ellis et al., 2021 ) seeks to generate code meeting external specifications such as input-output examples or logical formulas. Hybrid approaches combine symbolic methods with neural or 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 et al. (2023) uses neural policies to build higher-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 self-modification, 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 on 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, 1932 ) preserves genetic diversity ( Mayr, 1982 ) , leverages variation ( Kimura, 1979 ) , and uses natural selection to retain beneficial mutations ( Dobzhansky, 1970 ) .
## Appendix C Algorithmic Details
### C.1 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: ⬇
Information of the given Edit tool: ⬇
Task prompt: ⬇
### C.2 Parent Selection
At each DGM iteration, we select a subset of agents from the archive as parents to self-modify and produce new child agents ( Section 3 ). The details of the parent selection process, inspired by Ecoffet et 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 t t of the DGM run, let 𝒜 t = { a 1 t , a 2 t , … , a N t } \mathcal{A}^{t}=\{a_{1}^{t},a_{2}^{t},\dots,a_{N}^{t}\} be the archive of candidate agents. We first define the eligible set ℰ t = { a i t ∈ 𝒜 t : α i < 1 } , \mathcal{E}^{t}=\bigl\{\,a_{i}^{t}\in\mathcal{A}^{t}:\alpha_{i}<1\bigr\}, i.e. only those agents whose performance score is not yet perfect. We then sample k k parents (with replacement) from ℰ t \mathcal{E}^{t} in proportion to a combined measure of performance and number of children with codebase-editing functionality. Concretely, for each agent a i t ∈ ℰ t a_{i}^{t}\in\mathcal{E}^{t} :
(performance) α i = performance ( a i t ) , \displaystyle\alpha_{i}\;=\;\mathrm{performance}(a_{i}^{t}), (1) (children count) n i = functioning _ children _ count ( a i t ) , \displaystyle n_{i}\;=\;\mathrm{functioning\_children\_count}(a_{i}^{t}), (2) (sigmoid-scaled performance) s i = 1 1 + exp ( − λ ( α i − α 0 ) ) , \displaystyle s_{i}\;=\;\frac{1}{1+\exp\!\bigl(-\lambda\,(\alpha_{i}-\alpha_{0})\bigr)}, (3) (novelty bonus) h i = 1 1 + n i , \displaystyle h_{i}\;=\;\frac{1}{1+n_{i}}, (4) (unnormalized weight) w i = s i h i , \displaystyle w_{i}\;=\;s_{i}\,h_{i}, (5) (selection probability) p i = w i ∑ j = 1 N w j , \displaystyle p_{i}\;=\;\frac{w_{i}}{\sum_{j=1}^{N}w_{j}}, (6) (sampling) { parents } ∼ Categorical ( { p i } a i t ∈ ℰ t ) (draw k samples). \displaystyle\{\,\text{parents}\,\}\;\sim\;\mathrm{Categorical}\bigl(\{p_{i}\}_{a_{i}^{t}\in\mathcal{E}^{t}}\bigr)\quad\text{(draw $k$ samples).} (7)
Here, λ > 0 \lambda>0 controls the sharpness of the sigmoid, and α 0 \alpha_{0} is the midpoint accuracy. We set λ = 10 \lambda=10 and α 0 = 0.5 \alpha_{0}=0.5 . k k determines how many self-improvements are done in parallel during each iteration of the DGM run. We set k = 2 k=2 in SWE-bench experiments, and k = 4 k=4 in Polyglot experiments.
### C.3 Self-Improve 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 on 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 hypotheses, and implementing subsequent modifications. We chose to use OpenAI’s o1 model ( Team et al., 2024 ) 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 implementation_suggestion and problem_description are extracted and passed to the coding agent as its self-modification task.
Self-improve diagnosis prompt for SWE-bench experiments:
While the private test patch is included in the diagnosis prompt, one could imagine that an 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:
### C.4 Pseudocode
This is the pseudocode of the DGM algorithm, described in Section 3 :
This is the pseudocode of the baseline DGM without self-improving agents, described in Section 4.3 :
This is the pseudocode of the baseline DGM without open-ended exploration, described in Section 4.3 :
## Appendix 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 is a more challenging coding benchmark, we use a stronger coding model, Claude 3.5 Sonnet (New) (based on our preliminary testing). To enable faster iterations and avoid the same rate limits as Claude, we use o3-mini for Polyglot experiments. The temperature for all FMs in every setting is set to 1.0.
## Appendix E Benchmark Details
### E.1 Cost Estimate
The estimated cost of completing a single run of the DGM on SWE-bench, as presented in Section 4 , is about USD 22,000. In comparison, the estimated cost of completing a single run of either baseline (DGM w/o self-improve or DGM w/o open-ended exploration) on SWE-bench is about USD 10,000. Although the DGM is considerably more costly than the baselines, a method that can continuously improve, even at a higher cost, is preferable to one that fails to improve or stagnates at a level of performance that may never match that of the DGM. A more granular break down is:
We acknowledge that the current experiments on 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-intensive coding benchmarks. Moreover, several impactful methods (e.g., LLM training at its inception) were characterized substantial computational demands initially. Similar to these pioneering works, we hope to open the door to future research on improving the efficiency and scalability of our approach. In addition, many leading coding agents on the SWE-bench leaderboard are backed by industrial companies employing expert full-time researchers and engineers, which incurs substantial human labor costs. In contrast, our approach achieves SoTA-level performance through fully autonomous self-improvement without human intervention, potentially offering greater efficiency when considering the comparative costs of specialized AI development talent versus API usage. Finally, as FMs continue to improve and compute costs continue to decline, methods like the DGM will become increasingly efficient and accessible.
Also, higher-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 a coding agent:
• django__django-10973
• django__django-11066
• django__django-12754
• django__django-15930
• django__django-13279
• django__django-16661
• django__django-13346
• django__django-10880
• django__django-10999
• django__django-11087
Additional 50 tasks for estimating general effectiveness of a coding agent:
• django__django-9296
• django__django-11790
• django__django-11815
• django__django-11848
• django__django-11880
• django__django-11885
• django__django-11951
• django__django-11964
• django__django-11999
• django__django-12039
• django__django-12050
• django__django-12143
• django__django-12155
• django__django-12193
• django__django-12209
• django__django-12262
• django__django-12273
• django__django-12276
• django__django-12304
• django__django-12308
• django__django-12325
• django__django-12406
• django__django-12708
• django__django-12713
• django__django-12774
• sphinx-doc__sphinx-7454
• sphinx-doc__sphinx-7590
• sphinx-doc__sphinx-7748
• sphinx-doc__sphinx-7757
• sphinx-doc__sphinx-7985
• sphinx-doc__sphinx-8035
• sphinx-doc__sphinx-8056
• sphinx-doc__sphinx-8265
• sphinx-doc__sphinx-8269
• sphinx-doc__sphinx-8475
• sphinx-doc__sphinx-8548
• sphinx-doc__sphinx-8551
• sphinx-doc__sphinx-8638
• sphinx-doc__sphinx-8721
• sphinx-doc__sphinx-9229
• sphinx-doc__sphinx-9230
• sphinx-doc__sphinx-9281
• sphinx-doc__sphinx-9320
• sphinx-doc__sphinx-9367
• sphinx-doc__sphinx-9461
• sphinx-doc__sphinx-9698
• sphinx-doc__sphinx-10449
• sphinx-doc__sphinx-10466
• sphinx-doc__sphinx-10673
• sphinx-doc__sphinx-11510
Additional 140 tasks for more accurate assessment of a coding agent’s performance:
• astropy__astropy-12907
• astropy__astropy-13033
• astropy__astropy-13236
• astropy__astropy-13398
• astropy__astropy-13453
• astropy__astropy-13579
• astropy__astropy-13977
• astropy__astropy-14096
• astropy__astropy-14182
• astropy__astropy-14309
• astropy__astropy-14365
• astropy__astropy-14369
• astropy__astropy-14508
• astropy__astropy-14539
• astropy__astropy-14598
• astropy__astropy-14995
• astropy__astropy-7166
• astropy__astropy-7336
• astropy__astropy-7606
• astropy__astropy-7671
• astropy__astropy-8707
• astropy__astropy-8872
• django__django-10097
• django__django-10554
• django__django-10914
• django__django-11095
• django__django-11099
• django__django-11119
• django__django-11133
• django__django-11138
• django__django-11141
• django__django-11149
• django__django-11163
• django__django-11179
• django__django-11206
• django__django-11211
• django__django-11239
• django__django-11265
• django__django-11276
• django__django-11292
• django__django-11299
• django__django-11333
• django__django-11400
• django__django-11433
• django__django-11451
• django__django-11477
• django__django-11490
• django__django-11532
• django__django-11551
• django__django-11555
• django__django-11603
• django__django-11728
• django__django-11734
• django__django-11740
• django__django-11749
• django__django-11820
• django__django-12125