DGM - a self-improving AI Agent system that iteratively modifies its own code to improve performance.
DGM (Darwin Gödel Machine) is a self-improving artificial intelligence system that enhances performance by iteratively modifying its own code. DGM selects an agent from its maintained archive of coded agents, generates new versions based on a base model,...
What is DGM?
DGM (Darwin Gödel Machine) is a self-improving artificial intelligence system that enhances performance by iteratively modifying its own code. DGM selects an agent from its maintained archive of coded agents, generates a new version based on a base model, and then verifies the new agent's performance in coded benchmark tests. If performance improves, the new agent is added to the archive. DGM's design is inspired by Darwin's theory of evolution, employing an open-ended exploration strategy to explore multiple evolutionary paths from different starting points, avoiding getting trapped in local optima. In experiments, DGM demonstrated significant performance improvements across multiple benchmarks, such as increasing performance from 20.0% to 50.0% in the SWE-bench benchmark and from 14.2% to 30.7% in the Polyglot benchmark. DGM's self-improvement process is conducted in an isolated sandbox environment to ensure safety.
Main functions of DGM
- Self-improvementDGM can iteratively modify its own code to optimize performance and functionality. It reads its own source code through a self-modification module and generates modification suggestions based on a base model.
- Empirical verificationEach code change is validated using coding benchmarks (such as SWE-bench and Polyglot) to ensure the effectiveness of the improvements. The evaluation engine isolates and evaluates the performance of new code versions using Docker containers.
- Open explorationInspired by Darwin's theory of evolution, DGM employs an open-ended exploration strategy, exploring multiple evolutionary paths from different starting points to avoid getting trapped in local optima. It maintains an archive of coded agents, continuously accumulating all generated variants, and supports branching new evolutionary paths from any agent within the archive.
- Security considerationsThe execution and self-modification process of DGM are carried out in an isolated sandbox environment, limiting its impact on the host system.
How DGM works
- Self-modification phaseDGM selects an agent from its maintained archive of coding agents and generates a new version of that agent based on the foundation model.
- Verification phaseThe newly generated agent is evaluated in coding benchmark tests to determine whether its performance is improved.
- Archive update: Validated improved agents are added to the archive, which continuously accumulates all generated variants.
DGM's project address
- Github repository:https://github.com/jennyzzt/dgm
- arXiv technical paper:https://arxiv.org/pdf/2505.22954
Application scenarios of DGM
- Automatic programmingDGM can automatically generate and optimize code, reducing the burden on developers and improving programming efficiency. It can generate more efficient code through self-improvement, thereby enhancing the overall performance of the software.
- Code optimizationDGM can automatically detect and optimize code, improving readability and execution efficiency. Through continuous iteration and improvement, DGM can generate better code versions, reducing development time and costs.
- Automatic repairDGM can automatically fix discovered problems through self-evolution, reducing software maintenance costs. It can identify potential problems in the code, generate fixes, and reduce manual intervention.
- Research PlatformDGM provides a practical platform for researching self-improving systems, contributing to academic research in this field. Researchers can use DGM to explore new algorithms and models, advancing the development of artificial intelligence technology.