CodeEvolve: An open source evolutionary coding agent for algorithm discovery and optimization
Henrique Assumpção, Diego Ferreira, Leandro Campos, Fabricio Murai
TL;DR
CodeEvolve presents an open-source framework that unifies Large Language Models with an island-based genetic algorithm to automate algorithm discovery. It introduces depth exploitation, an inspiration-based crossover, and meta-prompting, all orchestrated through an LLM ensemble and modular population management. Empirically, CodeEvolve matches or surpasses the closed-source AlphaEvolve on five of six AlphaEvolve benchmarks, achieving new state-of-the-art results on multiple geometric and analytic problems. The work demonstrates the value of transparent, reproducible LLM-driven evolution for automated algorithm discovery and lays the groundwork for broader, scalable applications in code synthesis and optimization.
Abstract
In this work, we introduce CodeEvolve, an open-source evolutionary coding agent that unites Large Language Models (LLMs) with genetic algorithms to solve complex computational problems. Our framework adapts powerful evolutionary concepts to the LLM domain, building upon recent methods for generalized scientific discovery. CodeEvolve employs an island-based genetic algorithm to maintain population diversity and increase throughput, introduces a novel inspiration-based crossover mechanism that leverages the LLMs context window to combine features from successful solutions, and implements meta-prompting strategies for dynamic exploration of the solution space. We conduct a rigorous evaluation of CodeEvolve on a subset of the mathematical benchmarks used to evaluate Google DeepMind's closed-source AlphaEvolve. Our findings show that our method surpasses AlphaEvolve's performance on several challenging problems. To foster collaboration and accelerate progress, we release our complete framework as an open-source repository.
