1.3 KiB
1.3 KiB
Genetic Algorithms
Definition
A class of ML algorithms inspired by biological evolution that uses selection, crossover, and mutation to iteratively improve solutions. The Knock-out multi-agent pattern is a lean implementation of genetic algorithms applied to LLM agents.
Core Components
- Genetic Representation — A model and its context represent a solution candidate
- Fitness Function — Evaluates how well each candidate solves the problem
- Selection — Winners are chosen based on fitness scores
- Crossover — Combining traits from successful candidates (optional in basic knock-out)
- Mutation — Random variation in candidate traits (optional)
Application to Multi-Agent Knock-out
- N agents work on the same task
- Validator (fitness function) evaluates each
- Worst performers are eliminated (selection pressure)
- [Optional] New agents created by combining prompts of survivors (crossover)
- Process repeats until satisfactory solution emerges
Key Insight
- Since we can't punish or threaten LLM agents, we simply delete underperformers
- This mirrors "survival of the fittest" in biological evolution
- No attachment to individual agents — treat them as cattle, not pets