# MadEvolve: Evolutionary Optimization of Cosmological Algorithms with Large Language Models

arXiv: https://arxiv.org/abs/2602.15951 · HTML: https://mlsanity.com/paper/2602.15951/

## Key facts

- Cited by 6 papers in the map (data through 14 Oct 2026).
- Builds on 26 of its 91 references that are in the map.
- First posted on arXiv 17 Feb 2026.

## Builds on (most cited first, 26 of 26)

- [SWE-bench: Can Language Models Resolve Real-World GitHub Issues?](https://mlsanity.com/paper/2310.06770/) (2023)
- [SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering](https://mlsanity.com/paper/2405.15793/) (2024)
- [The AI Scientist: Towards Fully Automated Open-Ended Scientific Discovery](https://mlsanity.com/paper/2408.06292/) (2024)
- [AlphaEvolve: A coding agent for scientific and algorithmic discovery](https://mlsanity.com/paper/2506.13131/) (2025)
- [Eureka: Human-Level Reward Design via Coding Large Language Models](https://mlsanity.com/paper/2310.12931/) (2023)
- [AI Feynman: a Physics-Inspired Method for Symbolic Regression](https://mlsanity.com/paper/1905.11481/) (2019)
- [Illuminating search spaces by mapping elites](https://mlsanity.com/paper/1504.04909/) (2015)
- [Agent Laboratory: Using LLM Agents as Research Assistants](https://mlsanity.com/paper/2501.04227/) (2025)
- [The AI Scientist-v2: Workshop-Level Automated Scientific Discovery via Agentic Tree Search](https://mlsanity.com/paper/2504.08066/) (2025)
- [Discovering Symbolic Models from Deep Learning with Inductive Biases](https://mlsanity.com/paper/2006.11287/) (2020)
- [Robots that can adapt like animals](https://mlsanity.com/paper/1407.3501/) (2014)
- [ShinkaEvolve: Towards Open-Ended And Sample-Efficient Program Evolution](https://mlsanity.com/paper/2509.19349/) (2025)
- [AutoML-Zero: Evolving Machine Learning Algorithms From Scratch](https://mlsanity.com/paper/2003.03384/) (2020)
- [LLaMEA: A Large Language Model Evolutionary Algorithm for Automatically Generating Metaheuristics](https://mlsanity.com/paper/2405.20132/) (2024)
- [Large Language Models As Evolution Strategies](https://mlsanity.com/paper/2402.18381/) (2024)
- [Autonomous LLM-driven research from data to human-verifiable research papers](https://mlsanity.com/paper/2404.17605/) (2024)
- [Theoretical Physics Benchmark (TPBench) -- a Dataset and Study of AI Reasoning Capabilities in Theoretical Physics](https://mlsanity.com/paper/2502.15815/) (2025)
- [The Denario project: Deep knowledge AI agents for scientific discovery](https://mlsanity.com/paper/2510.26887/) (2025)
- [Large Language Model Reasoning Failures](https://mlsanity.com/paper/2602.06176/) (2026)
- [Test-time Scaling Techniques in Theoretical Physics -- A Comparison of Methods on the TPBench Dataset](https://mlsanity.com/paper/2506.20729/) (2025)
- [Learning effective physical laws for generating cosmological hydrodynamics with Lagrangian Deep Learning](https://mlsanity.com/paper/2010.02926/) (2020)
- [deep21: a Deep Learning Method for 21cm Foreground Removal](https://mlsanity.com/paper/2010.15843/) (2020)
- [Field-Level Inference with Microcanonical Langevin Monte Carlo](https://mlsanity.com/paper/2307.09504/) (2023)
- [Baryon acoustic oscillations reconstruction using convolutional neural networks](https://mlsanity.com/paper/2002.10218/) (2020)
- [Initial Conditions from Galaxies: Machine-Learning Subgrid Correction to Standard Reconstruction](https://mlsanity.com/paper/2504.01092/) (2025)
- [Hybrid Physical-Neural Simulator for Fast Cosmological Hydrodynamics](https://mlsanity.com/paper/2510.26593/) (2025)

## Built on by (most cited first, 6 of 6)

- [gwBenchmarks: Stress-Testing LLM Agents on High-Precision Gravitational Wave Astronomy](https://mlsanity.com/paper/2605.11269/) (2026)
- [What Do Evolutionary Coding Agents Evolve?](https://mlsanity.com/paper/2605.20086/) (2026)
- [Multi-agent discovery of practical quantum LDPC codes](https://mlsanity.com/paper/2608.08996/) (2026)
- [Competing with AI Scientists: Agent-Driven Approach to Astrophysics Research](https://mlsanity.com/paper/2604.09621/) (2026)
- [MadEvolve: Evolutionary Optimization of Trading Systems with Large Language Models](https://mlsanity.com/paper/2605.23007/) (2026)
- [Towards Certificate-Driven Software Porting: A Self-Improving Agentic Harness for Scientific Program Optimization](https://mlsanity.com/paper/2609.34069/) (2026)

## Abstract (arXiv)

We develop a general framework to discover scientific algorithms and apply it to three problems in computational cosmology. Our code, MadEvolve, is similar to Google's AlphaEvolve, but places a stronger emphasis on free parameters and their optimization. Our code starts with a baseline human algorithm implementation, and then optimizes its performance metrics by making iterative changes to its code. As a further convenient feature, MadEvolve automatically generates a report that compares the input algorithm with the evolved algorithm, describes the algorithmic innovations and lists the free parameters and their function. Our code supports both auto-differentiable, gradient-based parameter optimization and gradient-free optimization methods. We apply MadEvolve to the reconstruction of cosmological initial conditions, 21cm foreground contamination reconstruction and effective baryonic physics in N-body simulations. In all cases, we find substantial improvements over the base algorithm. We make MadEvolve and our three tasks publicly available at madevolve.org.
