GEPA
GEPA (Genetic-Pareto) is a reflective evolutionary optimization method that generates and evaluates candidate prompts using task information and feedback.
Building LLM Applications with DSPy
GEPA is a DSPy optimizer that reflectively generates prompt candidates using task information, prior prompts, and evaluation feedback.
- How it is used
- Optimizes DSPy prompt instructions by generating and evaluating reflective candidates.
- How deep it goes
- Explains Pareto-front selection, reflective mutation, crossover, and configuration with a worked classifier.
- Examples
- Uses an airline intent classifier and a five-example score table to illustrate optimization and candidate selection.
- What you can do after
- Apply it via DSPy with a feedback-capable metric, data splits, a reflection model, and an optimization budget.
Read how Building LLM Applications with DSPy explains GEPA →
Self-Improving Agents
GEPA is a genetic-Pareto search method that breeds candidate variants reflectively from a population.
- How it is used
- Optimizes LLM-agent instructions when a single-candidate prompt search stalls without identifying the missed rule.
- How deep it goes
- Explains reflection, crossover, scoring and population retention through a search loop and recorded lineage, without detailing a full implementation.
- Examples
- Uses a revenue-leaderboard agent with six hidden rules and a lineage where two surviving prompts repeatedly produce the same failure.
- What you can do after
- Evaluate/understand it by tracing how prompts are proposed and retained, and diagnosing convergence from discarded branches and repeated checker feedback.
What to know first
- hill climbingHill climbing is an iterative local-search optimization method that repeatedly moves from a candidate solution to a better neighboring solution.
- mutation operatorA mutation operator modifies one or more components of a candidate solution to introduce variation during an optimization or evolutionary search.
Related concepts
- Pareto frontieruses · A Pareto frontier is the set of feasible solutions that are not dominated by any other solution across multiple objectives.
- genetic algorithmuses · A genetic algorithm is an evolutionary optimization method that improves a population of candidate solutions through fitness-based selection and variation, often including recombination and mutation.
- groundingused by · Grounding is the practice of anchoring or constraining an AI system’s outputs with relevant information, context, or evidence.
- optimizerkind of · An optimizer is an algorithm or procedure that adjusts model parameters or decisions to improve an objective.
Questions about GEPA
What is GEPA?
GEPA (Genetic-Pareto) is a reflective evolutionary optimization method that generates and evaluates candidate prompts using task information and feedback.
Which Manning books explain GEPA?
Building LLM Applications with DSPy and Self-Improving Agents.
What should I know before learning GEPA?
Manning books that teach GEPA usually introduce hill climbing and mutation operator first.
What is GEPA a kind of?
GEPA is a kind of optimizer. An optimizer is an algorithm or procedure that adjusts model parameters or decisions to improve an objective.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

