darwinian_evolver  by imbue-ai

Evolutionary framework for optimizing code and prompts

Created 1 month ago
305 stars

Top 88.0% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This framework applies Darwinian evolution principles to iteratively improve code and prompts, targeting engineers and researchers. It offers a resilient mechanism for automated optimization, even with imperfect evaluators or mutators, driving progress through selection and variation.

How It Works

This project evolves a population of "organisms" (solutions like code or prompts) over iterations. In each cycle, promising parents are selected, mutated, and evaluated. The best organisms survive to reproduce, refining the solution. Inspired by Darwin Goedel Machines, it prioritizes optimization over guaranteed self-improvement. Its key strength lies in its resilience, allowing progress even with noisy evaluators or unreliable mutators, provided successes are identifiable.

Quick Start & Requirements

Run a simple example with: uv run darwinian_evolver parrot --num_iterations 3 --output_dir /tmp/parrot_output. This logs results to /tmp/parrot_output (including results.jsonl, snapshots/) and provides lineage_visualizer.html for history inspection. Adapting the framework requires defining custom Problem, Organism, Evaluator, and Mutator classes.

Highlighted Details

  • Batch Mutations: Allows mutators to process multiple failure cases simultaneously, potentially increasing mutation utility but risking reduced diversity.
  • Weighted Failure Case Sampling: Enables prioritizing specific types of evaluation failures for mutators by assigning custom weights.
  • Post-Mutation Verification: An optional step to filter out mutations that don't immediately address provided failure cases, improving efficiency but potentially reducing diversity and increasing overfitting.
  • Learning Log: Facilitates knowledge sharing between organisms by exposing past mutation attempts and their outcomes to current mutators, supporting strategies like ancestors or neighborhood-N.

Maintenance & Community

No specific details on contributors, sponsorships, or community channels (e.g., Discord, Slack) were found in the provided README content.

Licensing & Compatibility

The license type and any compatibility notes for commercial use or closed-source linking are not specified in the provided README content.

Limitations & Caveats

Batch mutations and post-mutation verification can reduce population diversity, risking local optima or overfitting. Post-mutation verification also requires consistent evaluation results and may hinder progress on sequential mutation problems. Implementing custom Problem components demands significant development effort.

Health Check
Last Commit

2 days ago

Responsiveness

Inactive

Pull Requests (30d)
6
Issues (30d)
1
Star History
305 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.