Paper
- Title: GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning
- arXiv: 2507.19457
- Venue: ICLR 2026 (Oral)
- Authors: Lakshya A Agrawal, Shangyin Tan, Dilara Soylu, Noah Ziems, Rishi Khare, Krista Opsahl-Ong, Arnav Singhvi, Herumb Shandilya, Michael J. Ryan, Meng Jiang, Christopher Potts, Koushik Sen, Alexandros G. Dimakis, Ion Stoica, Dan Klein, Matei Zaharia, Omar Khattab
- Code: https://github.com/gepa-ai/gepa
- Core claim: Training LLMs via natural-language reflection can be more sample-efficient than scalar-reward reinforcement learning. GRPO-style methods typically need thousands of rollouts per new task; GEPA claims strong gains with a few dozen.
- Architecture = Genetic + Pareto + Reflective:
- *Genetic*: Prompts evolve across generations rather than being trained as parameters.
- *Pareto*: A frontier of non-dominated candidates is maintained across multiple objectives (accuracy, token cost, prompt length, robustness), avoiding premature convergence on a local optimum.
- *Reflective*: After each rollout, the LLM writes a paragraph-length diagnostic ("failure was caused by prematurely assuming user intent at step 2"), which directly seeds the next prompt update.
- Why natural-language feedback wins: A scalar reward (0/1 or 0.73) tells the model *whether* it failed; a reflection tells it *why*. The latter encodes structural, transferable knowledge in tens to hundreds of tokens per failure.
- Empirical results:
- vs GRPO: average +6%, peak +20%, with roughly 35x fewer rollouts.
- vs MIPROv2 (prior SOTA prompt optimizer): >10% average gain, +12% on AIME-2025 math reasoning, with shorter prompts.
- Also validated as an inference-time search strategy for code optimization.
- Why this direction matters:
- *White-box*: every iteration leaves a human-readable reflection report that can be audited, debugged, or hand-corrected.
- *Small-model friendly*: language-level rules from a 7B model can be reused by another 7B model without large-scale RL infrastructure.
- *Cross-task transfer*: abstract rules like "verify hypotheses before concluding" move from math to code with light adaptation.
- *Complementary, not replacement*: GEPA can produce a stronger initial prompt that makes downstream GRPO training converge faster.
- Workflow: Sample rollouts → reflect in natural language → propose prompt edits → score candidates on multiple metrics → keep the Pareto frontier → crossover complementary candidates → repeat until convergence.
- Practical takeaways for prompt engineers: ask the LLM to diagnose its own failures before editing; track cost, latency, and robustness alongside accuracy; maintain multiple candidate prompts rather than chasing a single best one; shorter prompts often generalize better.
- Limitations: reflection quality depends on the model's understanding (risk of misdiagnosis); Pareto selection becomes harder beyond 3–4 objectives; natural-language rules are inherently ambiguous; long-horizon agentic tasks still benefit from RL's trial-and-error.
- One-line takeaway: If an LLM can understand *why* it failed from text, there is no reason to downgrade it to an animal that can only learn from numbers. GEPA demonstrates that treating the model as a reader of feedback, not just a recipient of rewards, yields better prompts with far less compute.
---