MadEvolve

LLM-Driven Evolutionary Discovery of Algorithms for Science

An open-source framework that uses Large Language Models and evolutionary search to automatically discover and optimize scientific algorithms.

3
Applications
16-58%
Performance Gains
Open Source
Freely Available

What is MadEvolve?

MadEvolve is a lightweight, open-source framework that combines Large Language Models (LLMs) with evolutionary search to automatically discover and optimize scientific algorithms.

Traditional algorithm development relies on human expertise and manual tuning. MadEvolve automates this process by treating algorithms as code that can be iteratively improved through LLM-guided mutations and physics-based fitness evaluation.

Key Features

  • Nested Optimization: Separates structural search from parameter tuning, supporting both gradient-based and derivative-free optimization
  • Automated Analysis: Generates human-readable scientific reports explaining discovered innovations and comparing performance
  • Few Parameters: Discovers interpretable algorithms with minimal tunable parameters that generalize well
  • Verified Results: All improvements are quantitatively measured on held-out test data, circumventing LLM reliability concerns
1

Start with Baseline

Human-designed algorithm

2

LLM Proposes Changes

Code mutations & innovations

3

Optimize Parameters

Autodiff or grid search

4

Evaluate Performance

Physics-based metrics

5

Evolve Population

Keep best solutions

Applications

We demonstrate MadEvolve on three important tasks in physics, achieving substantial improvements over human-designed baselines.

Initial Condition and BAO Reconstruction

+22.8% Improvement

Reconstructing initial cosmological density fields from observed galaxy distributions by removing non-linear gravitational evolution effects.

Baseline r̄ = 0.753
Evolved r̄ = 0.924

Key Innovations Discovered:

  • Anisotropic smoothing kernels with separate scales
  • Deformation tensor invariant corrections (2LPT-inspired)
  • Band-wise spectral de-warping using EFT basis
  • Wiener fusion with coherence gating

21cm Foreground Contamination Reconstruction

+31% Improvement

Recovering large-scale modes lost to foreground contamination in 21cm intensity mapping by exploiting tidal field correlations.

Baseline r̄₂D = 0.743
Evolved r̄₂D = 0.973

Key Innovations Discovered:

  • Wedge-targeted anisotropic filtering
  • Anisotropic spectral potential with learned weights
  • Component-wise adaptive saturation
  • Split-weight tensor projection (9 parameters only!)

Effective Baryonic Physics from N-body simulations

58% Loss Reduction

Predicting thermal Sunyaev-Zeldovich signals from dark matter simulations using learned particle displacements.

Baseline Test Loss 0.613
Evolved Test Loss 0.257

Key Innovations Discovered:

  • Physics-informed multiplicative decomposition
  • Virial temperature from screened potential
  • Shock modifier with tidal shear contribution
  • Better generalization across cosmic realizations

Download Reports

Detailed analysis reports generated by MadEvolve for each application, including algorithm comparisons, performance metrics, and discovered innovations.

📊

Initial Condition and BAO Reconstruction

Complete analysis of evolved BAO reconstruction algorithms with performance comparisons and physical interpretations.

Download PDF
🌌

21cm Foreground Contamination Reconstruction

Detailed breakdown of tidal reconstruction innovations and wedge-contamination recovery strategies.

Download PDF
🔥

Effective Baryonic Physics from N-body simulations

Analysis of Lagrangian Deep Learning improvements for thermal Sunyaev-Zeldovich effect prediction.

Download PDF
🔄

Iterative Reconstruction Report

Analysis of iterative reconstruction algorithms evolved by MadEvolve with performance benchmarks.

Download PDF
📄

Full Paper (arXiv)

Complete research paper: "LLM-Driven Evolutionary Discovery of Algorithms for Computational Cosmology"

View on arXiv

Evolved Codes

View the evolved algorithm codes discovered by MadEvolve for cosmology applications.

View Evolved Codes on GitHub

News & Updates

February 2026

MadEvolve v1.0 Released

We're excited to announce the public release of MadEvolve! The framework is now available on GitHub with complete documentation, three cosmology applications, and automated report generation.

February 2026

Paper Submitted to arXiv

Our paper "LLM-Driven Evolutionary Discovery of Algorithms for Computational Cosmology" has been submitted. Check out the full results on all three cosmological applications!

January 2026

31% Improvement on 21cm Reconstruction

MadEvolve discovered a novel split-weight tensor projection algorithm that achieves r̄₂D = 0.973 on wedge-contaminated 21cm data, substantially outperforming human-designed methods.