OpenEvolve是什么?2026年开源AI进化算法代码库优化指南
OpenEvolve is an open-source implementation of DeepMind's AlphaEvolve system that uses LLM ensembles to evolve and optimize entire codebases through evolutionary algorithms, with demonstrated success in mathematical optimization problems.
原文翻译: OpenEvolve是DeepMind AlphaEvolve系统的开源实现,利用LLM集成通过进化算法演进和优化整个代码库,在数学优化问题上已取得验证成功。
Introduction
I've built an open-source implementation of Google DeepMind's AlphaEvolveDeepMind开发的进化算法系统,使用LLM通过进化过程发现和优化算法,已成功应用于Google数据中心优化和数学算法发现。 system called OpenEvolve. It's an evolutionary coding agent that uses LLMs to discover and optimize algorithms through iterative evolution.
我构建了一个名为 OpenEvolve 的 Google DeepMind AlphaEvolveDeepMind开发的进化算法系统,使用LLM通过进化过程发现和优化算法,已成功应用于Google数据中心优化和数学算法发现。 系统的开源实现。它是一个进化编码代理,利用大语言模型(LLM)通过迭代进化来发现和优化算法。
Try it out: https://github.com/codelion/openevolve
What is OpenEvolve?
OpenEvolve evolves entire codebases (not just single functions) by leveraging an ensemble of LLMs combined with automated evaluation. It follows the evolutionary approach described in the AlphaEvolveDeepMind开发的进化算法系统,使用LLM通过进化过程发现和优化算法,已成功应用于Google数据中心优化和数学算法发现。 paper but is fully open source and configurable.
OpenEvolve 通过利用大语言模型(LLM)集成与自动化评估相结合,进化整个代码库(而不仅仅是单个函数)。它遵循 AlphaEvolveDeepMind开发的进化算法系统,使用LLM通过进化过程发现和优化算法,已成功应用于Google数据中心优化和数学算法发现。 论文中描述的进化方法,但完全开源且可配置。
I built this because I wanted to experiment with evolutionary code generation and see if I could replicate DeepMind's results. The original system successfully improved Google's data centers and found new mathematical algorithms, but no implementation was released.
我构建这个项目是因为我想尝试进化代码生成,并看看是否能复现 DeepMind 的结果。原始系统成功优化了谷歌的数据中心并发现了新的数学算法,但并未发布其实现。
How It Works
The system has four main components that work together in an evolutionary loop:
该系统由四个主要组件组成,它们在一个进化循环OpenEvolve的核心工作流程,包括程序存储、提示采样、LLM生成和评估反馈的迭代过程。中协同工作:
- Program Database: Stores programs and their metrics in a MAP-Elites一种进化算法框架,用于在多个维度上维护和优化解决方案的多样性,OpenEvolve的程序数据库受此启发。 inspired structure
程序数据库:以受 MAP-Elites一种进化算法框架,用于在多个维度上维护和优化解决方案的多样性,OpenEvolve的程序数据库受此启发。 启发的结构存储程序及其评估指标
- Prompt Sampler: Creates context-rich prompts with past solutions
提示采样器:利用过去的解决方案创建富含上下文的提示
- LLM Ensemble: Generates code modifications using multiple models
LLM 集成:使用多个模型生成代码修改
- Evaluator Pool: Tests programs and provides feedback metrics
评估器池:测试程序并提供反馈指标
What You Can Do With It
- Run existing examples to see evolution in action
运行现有示例,观察进化过程
- Define your own problems with custom evaluation functions
使用自定义评估函数定义您自己的问题
- Configure LLM backends (works with any OpenAI-compatible API)
配置 LLM 后端(兼容任何 OpenAI 兼容的 API)
- Use multiple LLMs in ensemble for better results
在集成中使用多个 LLM 以获得更好的结果
- Optimize algorithms with multiple objectives
使用多目标优化算法
Replicated Examples from the AlphaEvolveDeepMind开发的进化算法系统,使用LLM通过进化过程发现和优化算法,已成功应用于Google数据中心优化和数学算法发现。 Paper
Two examples I've replicated from the AlphaEvolveDeepMind开发的进化算法系统,使用LLM通过进化过程发现和优化算法,已成功应用于Google数据中心优化和数学算法发现。 paper:
我从 AlphaEvolveDeepMind开发的进化算法系统,使用LLM通过进化过程发现和优化算法,已成功应用于Google数据中心优化和数学算法发现。 论文中复现的两个示例:
- Circle Packing: Evolved from simple geometric patterns to sophisticated mathematical optimization, reaching 99.97% of DeepMind's reported results (2.634 vs 2.635 sum of radii for n=26).
圆形填充:从简单的几何模式进化为复杂的数学优化,达到了 DeepMind 报告结果的 99.97%(对于 n=26,半径总和为 2.634 对比 2.635)。
- Function Minimization: Transformed a random search into a complete simulated annealing algorithm with cooling schedules and adaptive step sizes.
函数最小化:将随机搜索转变为一个包含冷却计划和自适应步长的完整模拟退火算法。
Technical Insights
- Low latency LLMs are critical for rapid generation cycles
低延迟的 LLM 对于快速生成周期至关重要
- Best results using Gemini-Flash-2.0-lite + Gemini-Flash-2.0 as the ensemble
使用 Gemini-Flash-2.0-lite + Gemini-Flash-2.0 作为集成获得了最佳结果
- For the circle packing problem, Gemini-Flash-2.0 + Claude-Sonnet-3.7 performed best
对于圆形填充问题,Gemini-Flash-2.0 + Claude-Sonnet-3.7 表现最佳
- Cerebras AI's API provided the fastest inference speeds
Cerebras AI 的 API 提供了最快的推理速度
- Two-phase approach (exploration then exploitation) worked best for complex problems
两阶段方法(先探索后利用)对于复杂问题效果最好
Getting Started (Takes < 2 Minutes)
All you need is Python 3.9+ and an API key for an LLM service. Configuration is done through simple YAML files.
您只需要 Python 3.9+ 和一个 LLM 服务的 API 密钥。配置通过简单的 YAML 文件完成。
Clone and Install
git clone https://github.com/codelion/openevolve.git
cd openevolve
pip install -e .
Run the Function Minimization Example
python openevolve-run.py \
examples/function_minimization/initial_program.py \
examples/function_minimization/evaluator.py \
--config examples/function_minimization/config.yaml \
--iterations 50
I'll be around to answer questions and discuss!
我将随时解答问题并进行讨论!
常见问题(FAQ)
OpenEvolve是什么?它和DeepMind的AlphaEvolveDeepMind开发的进化算法系统,使用LLM通过进化过程发现和优化算法,已成功应用于Google数据中心优化和数学算法发现。有什么关系?
OpenEvolve是DeepMind AlphaEvolveDeepMind开发的进化算法系统,使用LLM通过进化过程发现和优化算法,已成功应用于Google数据中心优化和数学算法发现。系统的开源实现,利用LLM集成多个大型语言模型的组合使用,在OpenEvolve中用于生成代码修改,通过不同模型的协同工作提高生成质量。通过进化算法演进和优化整个代码库,在数学优化问题上已取得验证成功。
OpenEvolve是如何工作的?它的核心组件有哪些?
系统包含四个核心组件:程序数据库存储程序及指标,提示采样器创建上下文提示,LLM集成多个大型语言模型的组合使用,在OpenEvolve中用于生成代码修改,通过不同模型的协同工作提高生成质量。生成代码修改,评估器池测试程序并提供反馈,它们协同工作在进化循环OpenEvolve的核心工作流程,包括程序存储、提示采样、LLM生成和评估反馈的迭代过程。中。
使用OpenEvolve需要什么条件?如何快速开始体验?
只需Python 3.9+和LLM服务的API密钥,通过YAML文件配置。克隆仓库后安装依赖即可运行,例如函数最小化示例,整个过程不到2分钟。
版权与免责声明:本文仅用于信息分享与交流,不构成任何形式的法律、投资、医疗或其他专业建议,也不构成对任何结果的承诺或保证。
文中提及的商标、品牌、Logo、产品名称及相关图片/素材,其权利归各自合法权利人所有。本站内容可能基于公开资料整理,亦可能使用 AI 辅助生成或润色;我们尽力确保准确与合规,但不保证完整性、时效性与适用性,请读者自行甄别并以官方信息为准。
若本文内容或素材涉嫌侵权、隐私不当或存在错误,请相关权利人/当事人联系本站,我们将及时核实并采取删除、修正或下架等处理措施。 也请勿在评论或联系信息中提交身份证号、手机号、住址等个人敏感信息。