Skip to content

Commit ce4570e

Browse files
authored
Merge pull request #129 from codelion/update-readme
Revamp README with expanded features and examples
2 parents e6565a0 + 35932a4 commit ce4570e

File tree

1 file changed

+149
-40
lines changed

1 file changed

+149
-40
lines changed

README.md

Lines changed: 149 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,94 @@
11
# OpenEvolve
22

3-
An open-source implementation of the AlphaEvolve system described in the Google DeepMind paper "AlphaEvolve: A coding agent for scientific and algorithmic discovery" (2025).
3+
An open-source evolutionary coding agent that began as a faithful implementation of AlphaEvolve and has evolved far beyond it, enabling automated scientific and algorithmic discovery.
44

55
![OpenEvolve Logo](openevolve-logo.png)
66

77
## Overview
88

9-
OpenEvolve is an evolutionary coding agent that uses Large Language Models to optimize code through an iterative process. It orchestrates a pipeline of LLM-based code generation, evaluation, and selection to continuously improve programs for a variety of tasks.
10-
11-
Key features:
12-
- Evolution of entire code files, not just single functions
13-
- Support for multiple programming languages
14-
- Supports OpenAI-compatible APIs for any LLM
15-
- Multi-objective optimization
16-
- Flexible prompt engineering
17-
- Distributed evaluation
9+
OpenEvolve is an evolutionary coding agent that uses Large Language Models to automatically optimize and discover algorithms through iterative improvement. Starting from the AlphaEvolve research, it incorporates advanced features for reproducibility, multi-language support, sophisticated evaluation pipelines, and integration with cutting-edge LLM optimization techniques. It serves as both a research platform for evolutionary AI and a practical tool for automated code optimization.
10+
11+
### Key Features
12+
13+
OpenEvolve implements a comprehensive evolutionary coding system with:
14+
15+
- **Evolutionary Coding Agent**: LLM-guided evolution of entire code files (not just functions)
16+
- **Distributed Controller Loop**: Asynchronous pipeline coordinating LLMs, evaluators, and databases
17+
- **Program Database**: Storage and sampling of evolved programs with evaluation metrics
18+
- **Prompt Sampling**: Context-rich prompts with past programs, scores, and problem descriptions
19+
- **LLM Ensemble**: Multiple language models working together for code generation
20+
- **Multi-objective Optimization**: Simultaneous optimization of multiple evaluation metrics
21+
- **Checkpoint System**: Automatic saving and resuming of evolution state
22+
23+
#### 🔬 **Scientific Reproducibility**
24+
- **Comprehensive Seeding**: Full deterministic reproduction with hash-based component isolation
25+
- **Default Reproducibility**: Seed=42 by default for immediate reproducible results
26+
- **Granular Control**: Per-component seeding for LLMs, database, and evaluation pipeline
27+
28+
#### 🤖 **Advanced LLM Integration**
29+
- **Ensemble Sophistication**: Weighted model combinations with intelligent fallback strategies
30+
- **Test-Time Compute**: Integration with [optillm](https://github.com/codelion/optillm) for Mixture of Agents (MoA) and enhanced reasoning
31+
- **Universal API Support**: Works with any OpenAI-compatible endpoint (Anthropic, Google, local models)
32+
- **Plugin Ecosystem**: Support for optillm plugins (readurls, executecode, z3_solver, etc.)
33+
34+
#### 🧬 **Evolution Algorithm Innovations**
35+
- **MAP-Elites Implementation**: Quality-diversity algorithm for balanced exploration/exploitation
36+
- **Island-Based Evolution**: Multiple populations with periodic migration for diversity maintenance
37+
- **Inspiration vs Performance**: Sophisticated prompt engineering separating top performers from diverse inspirations
38+
- **Multi-Strategy Selection**: Elite, diverse, and exploratory program sampling strategies
39+
40+
#### 📊 **Evaluation & Feedback Systems**
41+
- **Artifacts Side-Channel**: Capture build errors, profiling data, and execution feedback for LLM improvement
42+
- **Cascade Evaluation**: Multi-stage testing with progressive complexity for efficient resource usage
43+
- **LLM-Based Feedback**: Automated code quality assessment and reasoning capture
44+
- **Comprehensive Error Handling**: Graceful recovery from evaluation failures with detailed diagnostics
45+
46+
#### 🌐 **Multi-Language & Platform Support**
47+
- **Language Agnostic**: Python, Rust, R, Metal shaders, and more
48+
- **Platform Optimization**: Apple Silicon GPU kernels, CUDA optimization, CPU-specific tuning
49+
- **Framework Integration**: MLX, PyTorch, scientific computing libraries
50+
51+
#### 🔧 **Developer Experience & Tooling**
52+
- **Real-Time Visualization**: Interactive web-based evolution tree viewer with performance analytics
53+
- **Advanced CLI**: Rich command-line interface with checkpoint management and configuration override
54+
- **Comprehensive Examples**: 12+ diverse examples spanning optimization, ML, systems programming, and scientific computing
55+
- **Error Recovery**: Robust checkpoint loading with automatic fix for common serialization issues
56+
57+
#### 🚀 **Performance & Scalability**
58+
- **Threaded Parallelism**: High-throughput asynchronous evaluation pipeline
59+
- **Resource Management**: Memory limits, timeouts, and resource monitoring
60+
- **Efficient Storage**: Optimized database with artifact management and cleanup policies
1861

1962
## How It Works
2063

21-
OpenEvolve follows an evolutionary approach with the following components:
64+
OpenEvolve orchestrates a sophisticated evolutionary pipeline:
2265

2366
![OpenEvolve Architecture](openevolve-architecture.png)
2467

25-
1. **Prompt Sampler**: Creates context-rich prompts containing past programs, their scores, and problem descriptions
26-
2. **LLM Ensemble**: Generates code modifications via an ensemble of language models
27-
3. **Evaluator Pool**: Tests generated programs and assigns scores
28-
4. **Program Database**: Stores programs and their evaluation metrics, guiding future evolution
68+
### Core Evolution Loop
69+
70+
1. **Enhanced Prompt Sampler**: Creates rich prompts containing:
71+
- Top-performing programs (for optimization guidance)
72+
- Diverse inspiration programs (for creative exploration)
73+
- Execution artifacts and error feedback
74+
- Dynamic documentation fetching (via optillm plugins)
75+
76+
2. **Intelligent LLM Ensemble**:
77+
- Weighted model combinations for quality/speed tradeoffs
78+
- Test-time compute techniques (MoA, chain-of-thought, reflection)
79+
- Deterministic selection with comprehensive seeding
80+
81+
3. **Advanced Evaluator Pool**:
82+
- Multi-stage cascade evaluation
83+
- Artifact collection for detailed feedback
84+
- LLM-based code quality assessment
85+
- Parallel execution with resource limits
2986

30-
The controller orchestrates interactions between these components in an asynchronous pipeline, maximizing throughput to evaluate as many candidate solutions as possible.
87+
4. **Sophisticated Program Database**:
88+
- MAP-Elites algorithm for quality-diversity balance
89+
- Island-based populations with migration
90+
- Feature map clustering and archive management
91+
- Comprehensive metadata and lineage tracking
3192

3293
## Getting Started
3394

@@ -192,22 +253,45 @@ docker run --rm -v $(pwd):/app --network="host" openevolve examples/function_min
192253

193254
## Configuration
194255

195-
OpenEvolve is highly configurable. You can specify configuration options in a YAML file:
256+
OpenEvolve is highly configurable with advanced options:
196257

197258
```yaml
198-
# Example configuration
259+
# Example configuration showcasing advanced features
199260
max_iterations: 1000
261+
random_seed: 42 # Full reproducibility by default
262+
200263
llm:
201-
primary_model: "gemini-2.0-flash-lite"
202-
secondary_model: "gemini-2.0-flash"
264+
# Advanced ensemble configuration
265+
models:
266+
- name: "gemini-2.0-flash-lite"
267+
weight: 0.7
268+
- name: "moa&readurls-gemini-2.0-flash" # optillm test-time compute
269+
weight: 0.3
203270
temperature: 0.7
271+
204272
database:
273+
# MAP-Elites configuration
205274
population_size: 500
206-
num_islands: 5
275+
num_islands: 5 # Island-based evolution
276+
migration_interval: 20
277+
feature_dimensions: ["score", "complexity"] # Quality-diversity features
278+
279+
evaluator:
280+
# Advanced evaluation features
281+
enable_artifacts: true # Capture execution feedback
282+
cascade_evaluation: true # Multi-stage testing
283+
use_llm_feedback: true # AI-based code quality assessment
284+
285+
prompt:
286+
# Sophisticated prompt engineering
287+
num_top_programs: 3 # Performance examples
288+
num_diverse_programs: 2 # Creative inspiration
289+
include_artifacts: true # Execution feedback
207290
```
208291

209292
Sample configuration files are available in the `configs/` directory:
210293
- `default_config.yaml`: Comprehensive configuration with all available options
294+
- `island_config_example.yaml`: Advanced island-based evolution setup
211295

212296
See the [Configuration Guide](configs/default_config.yaml) for a full list of options.
213297

@@ -287,37 +371,60 @@ export ENABLE_ARTIFACTS=false
287371

288372
See the `examples/` directory for complete examples of using OpenEvolve on various problems:
289373

290-
### Symbolic Regression
374+
### Mathematical Optimization
375+
376+
#### [Function Minimization](examples/function_minimization/)
377+
A comprehensive example demonstrating evolution from random search to sophisticated simulated annealing.
291378

292-
A comprehensive example demonstrating OpenEvolve's application to symbolic regression tasks using the LLM-SRBench benchmark. This example shows how OpenEvolve can evolve simple mathematical expressions (like linear models) into complex symbolic formulas that accurately fit scientific datasets.
379+
#### [Circle Packing](examples/circle_packing/)
380+
Our implementation of the circle packing problem. For the n=26 case, we achieve state-of-the-art results matching published benchmarks.
293381

294-
[Explore the Symbolic Regression Example](examples/symbolic_regression/)
382+
Below is the optimal packing found by OpenEvolve after 800 iterations:
295383

296-
Key features:
297-
- Automatic generation of initial programs from benchmark tasks
298-
- Evolution from simple linear models to complex mathematical expressions
299-
- Evaluation on physics, chemistry, biology, and material science datasets
300-
- Competitive results compared to state-of-the-art symbolic regression methods
384+
![circle-packing-result](https://github.com/user-attachments/assets/00100f9e-2ac3-445b-9266-0398b7174193)
301385

302-
### Circle Packing
386+
### Advanced AI & LLM Integration
303387

304-
Our implementation of the circle packing problem from the AlphaEvolve paper. For the n=26 case, where one needs to pack 26 circles in a unit square we also obtain SOTA results.
388+
#### [Web Scraper with optillm](examples/web_scraper_optillm/)
389+
Demonstrates integration with [optillm](https://github.com/codelion/optillm) for test-time compute optimization, including:
390+
- **readurls plugin**: Automatic documentation fetching
391+
- **Mixture of Agents (MoA)**: Multi-response synthesis for improved accuracy
392+
- **Local model optimization**: Enhanced reasoning with smaller models
305393

306-
[Explore the Circle Packing Example](examples/circle_packing/)
394+
#### [LLM Prompt Optimization](examples/llm_prompt_optimazation/)
395+
Evolving prompts themselves for better LLM performance, demonstrating self-improving AI systems.
307396

308-
We have sucessfully replicated the results from the AlphaEvolve paper, below is the packing found by OpenEvolve after 800 iterations
397+
### Systems & Performance Optimization
309398

310-
![alpha-evolve-replication](https://github.com/user-attachments/assets/00100f9e-2ac3-445b-9266-0398b7174193)
399+
#### [MLX Metal Kernel Optimization](examples/mlx_metal_kernel_opt/)
400+
Automated discovery of custom GPU kernels for Apple Silicon, achieving:
401+
- **2-3x speedup** over baseline attention implementations
402+
- **Hardware-aware optimizations** for unified memory architecture
403+
- **Metal shader evolution** with numerical correctness validation
311404

312-
This is exactly the packing reported by AlphaEvolve in their paper (Figure 14):
405+
#### [Rust Adaptive Sort](examples/rust_adaptive_sort/)
406+
Evolution of sorting algorithms that adapt to data patterns, showcasing OpenEvolve's language-agnostic capabilities.
313407

314-
![alpha-evolve-results](https://github.com/user-attachments/assets/0c9affa5-053d-404e-bb2d-11479ab248c9)
408+
### Scientific Computing & Discovery
315409

316-
### Function Minimization
410+
#### [Symbolic Regression](examples/symbolic_regression/)
411+
A comprehensive example demonstrating automated discovery of mathematical expressions from scientific datasets using the LLM-SRBench benchmark.
412+
413+
#### [R Robust Regression](examples/r_robust_regression/)
414+
Developing robust regression methods resistant to outliers using R language support.
415+
416+
#### [Signal Processing](examples/signal_processing/)
417+
Automated design of digital filters with superior performance characteristics.
418+
419+
### Web and Integration Examples
420+
421+
#### [Online Judge Programming](examples/online_judge_programming/)
422+
Automated competitive programming solution generation with external evaluation systems.
423+
424+
#### [LM-Eval Integration](examples/lm_eval/)
425+
Working with standard ML evaluation harnesses for automated benchmark improvement.
317426

318-
An example showing how OpenEvolve can transform a simple random search algorithm into a sophisticated simulated annealing approach.
319427

320-
[Explore the Function Minimization Example](examples/function_minimization/)
321428

322429
## Preparing Your Own Problems
323430

@@ -334,10 +441,12 @@ If you use OpenEvolve in your research, please cite:
334441

335442
```
336443
@software{openevolve,
337-
title = {OpenEvolve: Open-source implementation of AlphaEvolve},
444+
title = {OpenEvolve: an open-source evolutionary coding agent},
338445
author = {Asankhaya Sharma},
339446
year = {2025},
340447
publisher = {GitHub},
341448
url = {https://github.com/codelion/openevolve}
342449
}
343450
```
451+
452+

0 commit comments

Comments
 (0)