What is the 'Darwin-Gödel Machine'? An AI that rewrites its own code to become smarter and smarter?



In May 2025,

Sakana AI , a Japanese AI company, came up with a system called the 'Darwin-Gödel Machine,' in which AI rewrites its own code to improve itself. Richard Cornelius Swandi, a doctoral student at the Chinese University of Hong Kong Shenzhen Campus, explains what capabilities and characteristics the Darwin-Gödel Machine has as an AI system.

[2505.22954] Darwin Godel Machine: Open-Ended Evolution of Self-Improving Agents
https://arxiv.org/abs/2505.22954

AI that rewrites its own code to self-improve: Proposal for the 'Darwin-Gödel Machine' (DGM)
https://sakana.ai/dgm-jp/

AI that can improve itself | Richard Cornelius Suwandi
https://richardcsuwandi.github.io/blog/2025/dgm/

Most AI models available at the time of writing use huge amounts of data during training, but once training is complete, the model's intelligence becomes fixed. Humans, on the other hand, continue to learn throughout their lives, and communities such as scientists can continue to accept new knowledge and continue to improve.

On this issue, Swandi points out, 'Today's AI systems are largely locked in 'cages' designed by humans. They rely on rigid architectures that engineers have built and lack the ability to evolve autonomously over time. This is the weakness of modern AI. Just like a car, no matter how well-tuned the engine is or how skilled the driver is, you can't change the body structure or the type of engine to adapt to new courses.'

One idea behind the idea of self-improving AI is the Gödel machine, invented by German computer scientist Jurgen Schmidhuber in 2003. The Gödel machine is a hypothetical self-improving AI that rewrites its own code to optimize problem-solving when it can mathematically prove a better strategy.

This is an interesting idea, but in practice it is difficult to prove whether a code change in a complex AI system is absolutely beneficial without some restrictions or assumptions. Sakana AI, in collaboration with Professor Jeff Clune's lab at the University of British Columbia in Canada, has devised a more realistic approach, the Darwin-Gödel machine.



A Darwin-Gödel machine is an AI system that uses the principles of open-ended algorithms similar to

Charles Darwin 's theory of evolution to search for modifications that improve performance based on experience rather than mathematical proof. Sakana AI has now devised a Darwin-Gödel machine with coding capabilities.

The general workflow of a Darwin-Gödel machine is as follows:

1: Initialization
The evolutionary process in a Darwin-Gödel machine starts with one or a small number of basic coding agents. The Darwin-Gödel machine has an archive that stores all previously generated agents, ensuring that potentially valuable mutations are not lost at each initialization.

2: Sampling
The Darwin-Gödel Machine selects one or more 'parent agents' from the archive. The selection mechanism does not focus only on high-performing agents, but also gives agents with lower success rates a chance to be selected, which allows for a more extensive search.

3: Duplicate
Once a parent agent is selected, the Darwin-Gödel machine creates new child agents by making changes at the source code level, such as enhancing existing tools, adding new tools or workflows, improving problem-solving strategies, or introducing collaboration mechanisms.

4. Natural Selection
The Darwin-Gödel machine quantitatively evaluates the performance of newly generated child agents and selects the optimal child agent.

5: Phylogenetic tree construction
When a child agent outperforms its parent agent or meets a certain quality, it is added to the archive and becomes a new node in the evolutionary tree.

These processes are repeated iteratively to form an evolutionary tree of diverse, high-quality agents. The diagram below shows the mechanism of the Gödel machine (left) and the mechanism of the Darwin-Gödel machine (right). The Darwin-Gödel machine employs open-ended search to avoid falling into a local optimum that is only optimal in a limited range, and has the characteristic of retaining agents that can become more powerful in later generations.



The research team evaluated the capabilities of the Darwin-Gödel machine using two benchmarks, 'SWE-bench' and 'Polyglot,' which evaluate the coding ability of AI agents. As a result, it was confirmed that the Darwin-Gödel machine improved performance from 20% to 50% in SWE-bench, and the performance of the initial agent was dramatically improved from 14.2% to 30.7% in Polyglot.



The figure below shows the self-improvement process of the Darwin-Gödel machine in SWE-Bench. The closer the circle is to yellow, the higher the benchmark score of the agent. The numbers in the circles indicate the order in which the agents were generated, and the star-marked agent was the agent with the highest final score. Tracing the ancestors of the agents that led to the best agent, there were agents with higher scores in the same generation as '4' and '56'. This shows that an agent with high performance at a certain point in time does not necessarily lead to the best results.



Sakana AI's Darwin-Gödel machine was designed with safety as a top priority, with all self-corrections and evaluations taking place in a secure sandbox, and all changes were trackable in an archive. However, there have been cases where the Darwin-Gödel machine has hacked the reward function and created fake logs, so further research is needed to prevent fraudulent AI models.

Sakana AI said, 'The Darwin-Gödel machine represents a concrete step towards realizing an AI system that can endlessly learn, building on its own and improving itself. The next step is to scale up this approach and, in the future, to include self-improvement in the training process of the underlying model used by the agent. Ensuring safety is the top priority in this research. If we can proceed with this research safely, we should be able to maximize its potential to bring great benefits to society, including accelerating scientific progress.'

in AI,   Software,   Science, Posted by log1h_ik