Agentic Algorithm Design: LLMs that Propose, Formalise, and Prove Runtime Bounds for Evolutionary Algorithms in Lean
Organizations: School of Computer Science, University of Birmingham, UK
Abstract
LLMs now prove hard theorems in Lean. Can they also design algorithms and prove their correctness and efficiency? LLM-guided design of optimisation heuristics (such as AlphaEvolve) is purely empirical. Automated theorem provers with LLMs prove given statements. So far, there has been little evidence that LLMs can do both: design an algorithm and guarantee its efficiency by a mathematical proof. We present a staged pipeline modelled after research methodology in design and analysis of evolutionary algorithms. The agent proposes black-box optimisation algorithms, and Lean guards filter out flawed designs. The agent then defines a potential function and proves drift bounds that guarantee an expected runtime improvement over the baseline algorithm. At no point in the pipeline are the algorithms compared empirically. The agent generates a black-box optimisation algorithm with expected runtime on a CycleUncover problem, where the classical (1+1) EA needs runtime . The pipeline also designs and analyses a black-box optimisation algorithm for integer-valued submodular minimisation with expected runtime , and it matches the optimal order on LeadingOnes. Across 8 problem classes, 12 of 15 runs with frontier models complete the pipeline with a machine-checked expected-runtime bound. An ablation study shows that removing the staging and asking the agent to zero-shot an algorithmic design with a runtime guarantee leads to a copy of the seeded baseline algorithm (random search) or to incomplete proofs. Our study suggests that machine-checked specifications in Lean can replace empirical evaluation in open-ended algorithm discovery. To the best of our knowledge, this is the first example of an automated pipeline that designs efficient black-box optimisation algorithms with machine-checked runtime bounds in Lean.
Figures & tables
| Work | Algorithmic artefact | Process | Designed by | Analysed by | Machine-checked property |
| Li et al. (2024) | first-order convex methods | deterministic | human | human | convergence rate |
| Vajjha et al. (2021) | value / policy iteration | stochastic (MDP) | human | human | convergence |
| Schäffeler & Abdulaziz (2025) | approximate policy iteration | stochastic (MDP) | human | human | convergence |
| Ospanov et al. (2025) ; Varambally et al. (2025) ; Li et al. (2026) | (proof / code search) | n/a | n/a | LLM | given theorem or code specification |
| Romera-Paredes et al. (2024) ; Novikov et al. (2025) ; Lange et al. (2025) | heuristics, constructions | — | LLM | — | none (empirical validation) |
| van Stein & Bäck (2025) | black-box optimisation algorithms (metaheuristics) | stochastic | LLM | — | none (empirical benchmarking) |
| # | Problem | Model | Pipeline | #gen | Algorithm | Complete | Order | Tokens | Lean | App. |
| 1 | OneMax | Opus 5 | staged | 1 | EA, rate | yes | n/r | 2,036 | F.2 | |
| 2 | LeadingOnes | Opus 5.5 | staged | 1 | fitness-dependent rate | yes | 160k | 1,262 | F.3 | |
| 3 | LeadingOnes , lemma | Opus 5.5 § | staged | 1 | fitness-dependent rate | yes | 191k | 1,553 | F.4 | |
| 4 | Jump k | Opus 5.5 | staged | 1 | EA, rate | yes | 144k | 1,086 | F.5 | |
| 5 | Jump k , lemma | Opus 5.5 | staged | 3 | rate cycling with a learned phase bit | yes | 396k | 1,335 | F.6 | |
| 6 | CycleUncover | Fable 5.1 | staged | 1 | cycle walk (learn-then-solve) | yes | 538k | 2,373 | F.7 |
Appendix figures & tables24 assets
Supplementary material from the paper’s appendix.
Appendix
| Stage | Name | Formalisation |
|---|---|---|
| Algorithm construction (Stages 0–8) | ||
| 0 | DesignLock [I] | Commit to and a qualitative account of which component of tracks ; no numeric constants yet. |
| 1 | Construct- AlgorithmCom- ponents [F*] | Define , , , . |
| 1c | StepMeasur- ability [F-] | is measurable. |
| 2 | Completeness1 [F-] | . |
| 3 | NonAbsorbing [F-] | . |
| Run | Cluster | Started | Pipeline version | Hours | Last passed |
|---|---|---|---|---|---|
| generous-dragon-779 | Sulis | 2026-09-21 | optimisation | 23.8 | 3 |
| driven-blaze-773 | Sulis | 2026-09-18 | optimisation | 23.8 | 1 |
| denim-paper-771 | Sulis | 2026-09-17 | split_v9 | 21.6 | 3 |
| super-moon-761 | Sulis | 2026-09-15 | split_v9 | 23.3 | 3 |
| bumbling-plant-742 | Sulis | 2026-09-13 | split_v9 | 23.2 | 3 |
| avid-waterfall-734 | Isambard-AI | 2026-09-12 | split_v9 | 23.6 | 3 |
Automated Algorithm Discovery
Automated algorithm discovery develops methods that generate and test executable algorithms for optimization, science, software, and machine learning.
See all 169 papers