imbue-ai/darwinian_evolver
Framework for evolving code and prompts inspired by Darwinian evolution
What it solves
Darwinian-evolver provides a framework for automatically improving pieces of code or prompt templates through an iterative, evolution-inspired process. It solves the problem of manually tuning prompts or writing complex logic by automating the cycle of variation, testing, and selection, allowing solutions to evolve toward higher performance even when the the tools used to generate changes (mutators) are unreliable.
How it works
The framework maintains a population of solutions (organisms) and evolves them through three core components:
- Initial Organism: The starting point, such as a Python function or a prompt template.
- Evaluator: A system that scores the organism's performance and identifies specific failure cases (inputs where the solution failed).
- Mutator: An LLM-powered agent or prompt that takes an organism and its failure cases to generate an improved version.
In each iteration, the framework selects promising parents based on a weighted sampling method (considering both performance scores and novelty), applies mutations, and evaluates the new offspring. It includes advanced features like Batch Mutations to handle multiple failures at once, Post-Mutation Verification to filter out poor changes before full evaluation, and a Learning Log that allows mutators to reference the success or failure of previous attempts.
Who it’s for
Developers and AI researchers who want to optimize LLM prompts, evolve AI coding agents, or solve complex reasoning tasks (like ARC-AGI) without manual trial-and-error.
Highlights
- Resilient Optimization: Works effectively even if the mutator only produces improvements a small fraction of the time.
- Coded Evolution: Supports evolving actual source code, enabling self-improving mutators where agents improve their own logic.
- Flexible Sampling: Uses sigmoid-scaled performance and novelty bonuses to balance exploitation of top solutions with population diversity.
- Lineage Visualization: Includes a tool to visually inspect the evolutionary history of the population.
Related
- Project
- Project
- Project
- Project