Authors: Lakshya A Agrawal, Shangyin Tan, Dilara Soylu, et al. · arXiv: 2507.19457 · Source: https://arxiv.org/abs/2507.19457
Fetched: 2026-09-05
Note: This ingest preserves the abstract and key algorithmic excerpts. Full PDF: https://arxiv.org/pdf/2507.19457. Do not treat this file as a translation. Code: https://github.com/gepa-ai/gepa
Abstract
Large language models (LLMs) are increasingly adapted to downstream tasks via reinforcement learning (RL) methods like Group Relative Policy Optimization (GRPO), which often require thousands of rollouts to learn new tasks. We argue that the interpretable nature of language often provides a much richer learning medium for LLMs, compared to policy gradients derived from sparse, scalar rewards. To test this, we introduce GEPA (Genetic-Pareto), a prompt optimizer that thoroughly incorporates natural language reflection to learn high-level rules from trial and error. Given any AI system containing one or more LLM prompts, GEPA samples trajectories (e.g., 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. As a result of GEPA's design, it can often turn even just a few rollouts into a large quality gain. Across six tasks, GEPA outperforms GRPO by 6% on average and by up to 20%, while using up to 35x fewer rollouts. GEPA also outperforms the leading prompt optimizer, MIPROv2, by over 10% ... We release our code at https://github.com/gepa-ai/gepa.
Figure 1 note from abstract page: Test-set star markers demonstrate the performance gap in a held-out set of questions.
Algorithmic isolation (paper §3)
GEPA evolves only the set of prompts Π_Φ; underlying LLM weights Θ_Φ remain fixed.
Inputs: system Φ with simple prompts; train dataset D_train; eval metric μ; feedback function μ_f; rollout budget B.
Split D_train into D_feedback and D_pareto. Loop: SelectCandidate (Pareto-based), SelectModule, minibatch from D_feedback, gather feedback/traces via μ_f, UpdatePrompt via reflection LM, accept if minibatch score improved, then evaluate on full D_pareto. Return Φ* maximizing average score on D_pareto.
Authors also state a standard train/validation/test split: optimizers have full access to train; may monitor validation for selection/early stopping but direct access to validation instance content is restricted; final numbers on held-out test.
Isolation note (for KB indexing)
Candidate = module prompts of the compound AI system. Optimizer = GEPA reflective mutation + Pareto candidate selection (+ optional system-aware merge). Eval & control = μ / μ_f with D_feedback for learning signals and D_pareto for selection; held-out test for reporting. Weights frozen; evaluator feedback channel is not the candidate being rewritten.