GEPA Beats GRPO by 20% Using 35x Fewer AI Training Rollouts
GEPA optimizes prompts, code, and agent architectures using LLM reflection on execution traces, beating RL methods with 35x fewer rollouts.
Takeaways
- GEPA optimizes prompts by having an LLM reflect on full execution traces instead of scalar rewards
- Beats GRPO by up to 20% while using 35x fewer rollouts, per the ICLR 2026 Oral paper
- Databricks reports open-source models plus GEPA beating Claude Opus 4.1 at 90x lower cost
optimize_anythingAPI extends the loop to code, agent architectures, scheduling policies, and SVGs- Integrated with DSPy, MLflow, Pydantic AI, LangChain, Google ADK, and Comet ML Opik
- MIT licensed,
pip install gepa, works with API-only models and as few as 3 examples
A new optimizer called GEPA is quietly reshaping how teams tune LLM systems. Instead of nudging weights with scalar rewards, it reads full execution traces (error messages, reasoning logs, tool outputs) and rewrites the prompt itself. The repo has crossed 6,000 stars, the paper was accepted as an ICLR 2026 Oral, and Shopify's CEO publicly called it under-hyped. So it's worth unpacking what it actually does.
GEPA stands for Genetic-Pareto. It targets a specific pain point: reinforcement learning methods like GRPO often require thousands of rollouts to learn new tasks, and the authors argue that the interpretable nature of language provides a much richer learning medium for LLMs than policy gradients derived from sparse scalar rewards. The core bet is that natural language feedback carries more signal per rollout than a single reward number ever could.
Reading traces instead of counting rewards
The optimization loop looks less like gradient descent and more like a code review cycle. Given any AI system containing one or more LLM prompts, GEPA samples system-level trajectories such as reasoning, tool calls, and tool outputs, and reflects on them in natural language to diagnose problems, propose and test prompt updates, and combine complementary lessons from the Pareto frontier of its own attempts.
Concretely, each iteration does five things:
- Select a candidate prompt from the Pareto frontier of prior attempts (candidates that excel on different task subsets)
- Execute it on a minibatch, capturing full traces
- Reflect: a reflection LLM reads the traces and diagnoses failures
- Mutate: generate an improved candidate informed by accumulated lessons