alpha-evolve
Use when the user wants to evolve an ML model/program through population-based search rather than a single sequential refine loop — a generational evolution where parallel proposers each apply one small SEARCH/REPLACE diff to a parent, scored by a cascade-evaluated training run, and children are kept in a MAP-Elites archive across islands (with migration + checkpointing) so diverse high performers survive. A finite, bounded-parallelism re-creation of AlphaEvolve/OpenEvolve, bent for ML autoresearch. Runs to a fixed compute budget or until interrupted. Not for the sequential single-thread autoresearch loops (one change → measure → keep/revert), and not for verifying a known bug or external claim — this is parallel, diversity-preserving search over a program.
gaasher · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add gaasher/Agent-Loop-Skills --skill alpha-evolve技能说明
name: alpha-evolve description: > Use when the user wants to evolve an ML model/program through population-based search rather than a single sequential refine loop — a generational evolution where parallel proposers each apply one small SEARCH/REPLACE diff to a parent, scored by a cascade-evaluated training run, and children are kept in a MAP-Elites archive across islands (with migration + checkpointing) so diverse high performers survive. A finite, bounded-parallelism re-creation of AlphaEvolve/OpenEvolve, bent for ML autoresearch. Runs to a fixed compute budget or until interrupted. Not for the sequential single-thread autoresearch loops (one change → measure → keep/revert), and not for verifying a known bug or external claim — this is parallel, diversity-preserving search over a program. compatibility: Requires Python 3.9+ metadata: version: "0.1.0"
Alpha-Evolve
Reference (read if you need the algorithm's details): AlphaEvolve — https://arxiv.org/abs/2506.13131 · OpenEvolve (open-source impl) — https://github.com/algorithmicsuperintelligence/openevolve
A population-based evolutionary loop over a program. The artifact is the editable model code; a
child is one analysis-informed SEARCH/REPLACE diff to a parent, and the feedback signal is a
cascade-evaluated training run (<metric>, smoke→full). Children are placed in a MAP-Elites
archive across islands (complexity × diversity axes), so a child survives by being either better or
more novel, not just better. The discipline this enforces: diversity is preserved, not collapsed —
diverse high performers co-exist instead of one local optimum winning. You are the controller: sample
a parent + inspirations, spawn parallel Mutators to propose and evaluate children, place them, migrate
between islands, checkpoint. Loops to a fixed compute budget or until interrupted.
When to use
Use this for parallel, diversity-preserving search over a model/program where many variants explore at once and the archive keeps the illuminated frontier. Default to broad island coverage; if quality stalls, bias selection toward exploiting top elites; if coverage stalls, bias toward empty cells. Not for the sequential autoresearch loops (one change at a time), and not for fixing a known anomaly.
The cast (both in this folder): roles/Mutator.md produces + cascade-evaluates one child (the
generation step); schemas/result.schema.json is the result a Mutator returns.
Setup
Resolve bindings interactively. If loop.run.yaml exists in the working dir, load it, confirm the
values in one line, and skip to the loop. Otherwise: on Claude Code (the AskUserQuestion tool is
available, <host> = claude-code) infer a likely value for each binding and present it as the
recommended option; on other hosts (<host> = other) ask each as a quoted plain-text prompt. Then
write loop.run.yaml (format: examples/run.example.yaml) and confirm the values before creating any
other files. <host> also decides execution: Claude Code spawns real Agent Mutators in parallel
(capped at <concurrency>); other hosts degrade to running a generation's children serially (identical
algorithm).
Probe the box first (mandatory — measure, never assume <concurrency>). Record and report:
- CPU cores →
<cores>:python3 -c "import os; print(os.cpu_count())". - RAM →
<ram_gb>: macOSsysctl -n hw.memsize; Linuxgrep MemTotal /proc/meminfo. - Accelerator →
<accelerator>/<vram>/<gpu_count>:nvidia-smi --query-gpu=name,memory.total,count --format=csv(NVIDIA); else macOS Apple GPU/MPS; else CPU-only.
| binding | meaning | default | how to infer |
|---|---|---|---|
<metric> + <metric_direction> | scalar to optimize; min/maximize | — | ask; scan eval output for the reported metric |
<run_cmd> / <entrypoint> | command for one training run (the evaluator) | — | pyproject.toml/.venv/uv/README |
<editable_files> | the program being evolved (e.g. model.py, config.yaml); never the harness or data | — | ask explicitly — this is the code that gets mutated; do not default it (multi-select on Claude Code) |
<sandbox_root> | where lae/ is created | ./sandbox | — |
<gate> + <budget> | one full run's size: time/epochs + amount; the FIXED eval budget applied to every program | — | identify the duration key now (e.g. train.epochs) so the controller can override it |
<total_budget> | total compute = number of full training runs (or wall-clock minutes); the single cost dial | — | ask |
<concurrency> | parallel evaluations C | derived from the probe | CPU-only → max(1, <cores>//4); single GPU/MPS → 1 (ask if more fit <vram>); multi-GPU → <gpu_count> (pin one child/GPU) |
num_generations is derived: ceil(<total_budget> / <concurrency>). The cascade is derived
from <budget> (not asked): smoke = ~1 epoch / a small subset, full = <budget>, gate = child's
smoke <metric> ≥ parent's smoke. <budget>/<metric>/eval split are FIXED — never mutation targets
(a child may not "train longer" to look better); changing them means re-running the whole loop.
Advanced (opt-in). Ask one yes/no: "Use defaults for the evolutionary settings, or customize?"
Defaults are faithful to AlphaEvolve/OpenEvolve — use them and ask nothing more. Only on "customize"
ask for each (showing the default as recommended): num_islands (4), num_top (3), num_diverse (2),
num_bins (10), migration_interval (5), diversity_reference_size (10), pop_per_island (40),
seed (42). Axes are fixed: complexity × diversity. See examples/run.example.yaml for the shape.
Print the resolved bindings + the probe + derived num_generations, and do not create files or
launch until the user confirms. Then initialise the sandbox (header rows only; programs/ is created
as children are evaluated):
<sandbox_root>/lae/
├── archive.tsv ← current elites = program
阅读完整来源 ↗