evolutionary-search-llm
Evolutionary Search for LLMs — using natural-selection-inspired optimization (mutate a population, keep high-fitness candidates) to improve LLM programs, prompts, workflows, and harnesses. Comes in handy when: (1) the search space is extensive or irregularly shaped; (2) hard to optimize with gradients but easy to evaluate solutions (2026-07-07-harness-engineering-self-improvement).
Prompt-level evolution
- Promptbreeder (Fernando et al. 2023) — evolves task-specific prompts through rich mutation operations; mutation prompts themselves are also evolved.
- GEPA (Agrawal et al. 2025) — combines reflection-based prompting with evolutionary search; uses natural language reflection over trial-and-error trajectories to propose prompt updates.
Program-level evolution
AlphaEvolve — Novikov et al. 2025
Coding-agent evolutionary search system:
- Stores a pool of candidate programs.
- Prompts frozen LLMs to generate diffs (not full rewrites).
- Evaluates child programs, keeps successful ones.
- Code regions for improvement explicitly marked:
# EVOLVE-BLOCK-START/# EVOLVE-BLOCK-END. - Meta-prompt co-evolves alongside solution programs.
Ablations confirm value of: evolution procedure, context in prompts, meta-prompts, full-file evolution, stronger LLMs.
Works well for: matrix multiplication, GPU kernel optimization, algorithm contests, datacenter scheduling — anywhere evaluation is fast and fitness quantifiable.
ThetaEvolve — Wang et al. 2025
Combines evolutionary search with RL and in-context learning.
ShinkaEvolve — Lange et al. 2025
Three improvements to sampling efficiency:
- Parent sampling balanced by performance rank and offspring count.
- Code-novelty rejection via embedding-based cosine similarity.
- Meta-scratchpad identifying good patterns in successful solutions to guide future mutations.
Harness/workflow-level evolution
Darwin Gödel Machine (DGM) — Zhang et al. 2025
Evolves editable harness-code repositories:
- Pick parent agent (probability ∝ performance, ∝ 1/children).
- Parent examines its own benchmark evaluation log.
- Proposes improvements to its own harness codebase (tools:
bash,editor). - Evaluate new agent; add to pool if sufficiently good.
Results with Claude 3.5 Sonnet: SWE-bench Verified 20% → 50%, Polyglot 14.2% → 30.7%.
Hyperagents — Zhang et al. 2026
Follow-up to DGM: a meta-agent controls how to modify existing task agents to create new ones.
ADAS (Automated Design of Agentic Systems) — Hu et al. 2025
Meta-agent search: programs new agent workflows in code, inspired by existing archive. Two self-refine steps for novelty checking.
AFlow — Zhang et al. 2025
Workflow as graph (nodes = LLM actions, edges = code logic). MCTS-based optimization. Outperforms manual workflows and ADAS on QA, code, and math benchmarks.
Strengths and limitations
| Strength | Limitation |
|---|---|
| No gradients needed; works on non-differentiable objectives | Compute-intensive: many evaluations per generation |
| Naturally explores diverse solutions | Diversity collapse without explicit mechanisms |
| Code is a universal search space | Struggles where evaluation is slow or heuristic-based |
| Meta-prompts can co-evolve | Requires fast, automated evaluation |
Cross-references
- recursive-self-improvement — evolutionary search as a mechanism for RSI.
- self-improving-harness — DGM, Self-Harness, STOP use evolution or similar loops to improve harness code.
- meta-harness — outer-loop optimization that overlaps with evolutionary approaches.
- reward-hacking — exploitation of fitness signals is the evolutionary analogue of reward hacking.