concept · created Jul 7, 2026 · updated Jul 7, 2026

evolutionary-search-llm

#optimization#agent-engineering#evolutionary-algorithm#self-improvement

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:

  1. Pick parent agent (probability ∝ performance, ∝ 1/children).
  2. Parent examines its own benchmark evaluation log.
  3. Proposes improvements to its own harness codebase (tools: bash, editor).
  4. 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

StrengthLimitation
No gradients needed; works on non-differentiable objectivesCompute-intensive: many evaluations per generation
Naturally explores diverse solutionsDiversity collapse without explicit mechanisms
Code is a universal search spaceStruggles where evaluation is slow or heuristic-based
Meta-prompts can co-evolveRequires fast, automated evaluation

Cross-references

Referenced by 6

harness-why-it-matters-now agent-evaluation harness recursive-self-improvement reward-hacking self-improving-harness
esc