GEPA
Improves prompts by reading why a run failed, rather than by scoring how badly it did
What is GEPA?
Reinforcement learning compresses an entire execution into one number, which throws away the part that says what went wrong. GEPA keeps it: error messages, profiling output and reasoning logs go back to a model that diagnoses the failure and proposes a specific edit, and it maintains a frontier of candidate prompts each strong on different examples rather than collapsing to one winner. The project reports reaching results in 100 to 500 evaluations where reinforcement learning needs upwards of 10,000. Both the running and the reflecting are model calls, so the efficiency is relative to RL, not to zero.
What can you do with GEPA?
- Feed back the reason, not just the score — Error messages, profiling data and reasoning logs are collected from each run and handed to a model that diagnoses why the failure happened and proposes a targeted change to the prompt.
- Keep candidates that are good at different things — A Pareto frontier holds several prompts, each strongest on a different slice of the examples, so an improvement on one case cannot silently destroy performance on another.
- Use it from DSPy without an integration — It is built into DSPy as an optimiser, so an existing DSPy program can be optimised by selecting it rather than by writing the plumbing to connect the two.
- Optimise systems that are not prompt chains — An adapter exposing an evaluate method that returns both scores and trajectories lets it drive anything you can run and instrument, not only conventional LLM pipelines.
- Work with models you cannot retrain — No weight access or training infrastructure is needed — it changes what you send rather than what the model is, which is what makes API-only models a valid target.
Before you choose GEPA
- Each round spends model calls twice — once running the candidates, once reflecting on their traces — so the sample-efficiency figures the project reports are relative to reinforcement learning, not to no cost at all.
- Outside DSPy the adapter is yours to write: a component that runs your system and returns both a score and the trajectory worth reflecting on, which means instrumenting the system first.
Star history
21 Aug to 30 Oct · +1k
Frequently asked questions
Is GEPA free for commercial use?
GEPA is released under the MIT licence — OSI-approved open source, which permits commercial use.
How can GEPA be deployed?
GEPA is available as Runs locally / Self-hosted.