We are used to thinking of astronomical discoveries as the work of humans—with telescopes, spectrographs, and patience. But data volumes are growing so rapidly that traditional algorithms can no longer keep up. Cosmic statistics, modeling the evolution of the universe, reconstructing initial conditions—all of this requires computations that even supercomputers struggle to handle. This is where something new enters the scene: a program called MadEvolve, which improves scientific code on its own, outperforming what generations of scientists have done. The study has been published as a preprint on arXiv.
MadEvolve: a digital apprentice that evolves algorithms
Imagine a system that takes human-written code for a complex cosmological task and continuously improves it. It does not just fix errors—it proposes new ideas, restructures the code, and rewrites its logic. And it does so faster and more efficiently than any human.
MadEvolve combines two powerful approaches:
- large language models (LLMs), which generate possible code modifications like a highly skilled programmer;
- evolutionary programming, a digital analogue of natural selection in which the best solutions “survive” and produce offspring.
The system takes a “parent” algorithm, asks an LLM to suggest mutations, tests new versions against strict physical metrics, and selects the strongest ones. This process repeats iteratively until a significantly improved result is achieved.
A key point is that the LLM does not invent physics from scratch, where such models often make mistakes. Instead, it operates strictly within well-defined tasks with verifiable metrics, and anything that does not improve performance is discarded.
A breakthrough in computational cosmology
MadEvolve has been tested on some of the most demanding problems in modern astrophysics:
- reconstruction of the universe’s initial conditions, where it outperformed the best human-designed algorithm and set a new record;
- signal cleaning from background noise;
- precise calibration of physics in N-body simulations.
In all cases, the improvements were substantial, and in one area, they were record-breaking. These are not minor tweaks but a qualitative leap in how we extract knowledge from cosmic data.
Not just about space
MadEvolve is not a narrowly specialized tool. It is a universal framework that can be applied to any domain where code optimization is needed—from machine learning and neural networks to physics, chemistry, and biology. In essence, it represents a new way to evolve scientific software—faster, more cost-effective, and deeper than manual development.
The authors emphasize that researchers are only beginning to understand what such a synergy between large language models and evolutionary algorithms can achieve.
In brief
MadEvolve is a system that takes human-created algorithms and significantly improves them by combining LLMs with evolutionary programming. In computational cosmology, it has already set a new record in reconstructing the universe’s initial conditions and delivered major gains in other tasks. It is a universal tool that could transform approaches to scientific programming across dozens of disciplines. The work has been published as a preprint on arXiv.






