ShinkaEvolve: Towards Open-Ended and Sample-Efficient Program Evolution 🧬
ShinkaEvolve is a framework that combines Large Language Models (LLMs) with evolutionary algorithms to drive scientific discovery. By leveraging the creative capabilities of LLMs and the optimization power of evolutionary search, ShinkaEvolve enables automated exploration and improvement of scientific code. The system is inspired by the AI Scientist, AlphaEvolve and the Darwin Goedel Machine: It maintains a population of programs that evolve over generations, with an ensemble of LLMs acting as intelligent mutation operators that suggest code improvements.
The framework supports parallel evaluation of candidates locally or on a Slurm cluster. It maintains an archive of successful solutions, enabling knowledge transfer between different evolutionary islands. ShinkaEvolve is particularly well-suited for scientific tasks where there is a verifier available and the goal is to optimize performance metrics while maintaining code correctness and readability.
To use EvolutionRunner, you need two key files: The evaluate.py script defines how to test and score your programs - it runs multiple evaluations, validates results, and aggregates them into metrics that guide the shinka evolution loop. The initial.py file contains your starting solution with the core algorithm that will be iteratively improved by LLMs across generations.
evaluate.py - Evaluation Script
python
1from shinka.core import run_shinka_eval
23defmain(program_path:str,4 results_dir:str):5 metrics, correct, err = run_shinka_eval(6 program_path=program_path,7 results_dir=results_dir,8 experiment_fn_name="run_experiment",9 num_runs=3,# Multi-evals to aggreg.10 get_experiment_kwargs=get_kwargs,11 aggregate_metrics_fn=aggregate_fn,12 validate_fn=validate_fn,# Optional13)1415defget_kwargs(run_idx:int)->dict:16return{"param1":"value","param2":42}1718defaggregate_fn(results:list)->dict:19 score = results[0]20 text = results[1]21return{22"combined_score":float(score),23"public":{...},# shinka-visible24"private":{...},# shinka-invisible25"extra_data":{...},# store as pkl26"text_feedback": text,# str fb27}2829if __name__ =="__main__":30# argparse program path & dir31 main(program_path, results_dir)
initial.py - Starting Solution
python
1# EVOLVE-BLOCK-START2defadvanced_algo():3# This will be evolved4return solution
5# EVOLVE-BLOCK-END67defrun_experiment(**kwargs):8"""Main called by evaluator"""9 result = solve_problem(kwargs)10return result
1112defsolve_problem(params):13 solution = advanced_algo()14return solution
Key Points:
Eval name matches experiment_fn_name
Use EVOLVE-BLOCK-START and EVOLVE-BLOCK-END to mark evolution sections
shinka Launcher utilizes Hydra to configure and launch evolutionary experiments effortlessly. It supports concise configuration via Hydra's powerful override syntax, making it easy to manage and iterate scientific explorations.
bash
1# Run with pre-configured variant2shinka_launch variant=circle_packing_example
34# Run with custom parameters5shinka_launch \6task=circle_packing \7database=island_large \8evolution=small_budget \9cluster=local \10 evo_config.num_generations=20
For comprehensive configuration options and advanced usage, see the Configuration Guide.
Interactive WebUI 🎨
Monitor your evolution experiments in real-time with Shinka's interactive web interface! The WebUI provides live visualization of the evolutionary process, genealogy trees, and performance metrics.
WebUI Screenshot
Quick Start
Launch the WebUI alongside your evolution experiment:
bash
1# Start your evolution experiment2shinka_launch variant=circle_packing_example
34# In another terminal, launch the WebUI5shinka_visualize --port 8888 --open
For detailed WebUI documentation, see the WebUI Guide.
Related Open-Source Projects 🧑🔧
OpenEvolve: An open-source implementation of AlphaEvolve
LLM4AD: A Platform for Algorithm Design with Large Language Model
Citation ✍️
If you use ShinkaEvolve in your research, please cite it as follows:
@article{lange2025shinka,
title={ShinkaEvolve: Towards Open-Ended And Sample-Efficient Program Evolution},
author={Lange, Robert Tjarko and Imajuku, Yuki and Cetin, Edoardo},
journal={arXiv preprint arXiv:2509.19349},
year={2025}
}