GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Agrawal, Lakshya A, Tan, Shangyin, Soylu, Dilara, Ziems, Noah, Khare, Rishi, Opsahl-Ong, Krista, Singhvi, Arnav, Shandilya, Herumb, Ryan, Michael J, Jiang, Meng, Potts, Christopher, Sen, Koushik, Dimakis, Alexandros G., Stoica, Ion, Klein, Dan, Zaharia, Matei, Khattab, Omar
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912904013414400
author Agrawal, Lakshya A
Tan, Shangyin
Soylu, Dilara
Ziems, Noah
Khare, Rishi
Opsahl-Ong, Krista
Singhvi, Arnav
Shandilya, Herumb
Ryan, Michael J
Jiang, Meng
Potts, Christopher
Sen, Koushik
Dimakis, Alexandros G.
Stoica, Ion
Klein, Dan
Zaharia, Matei
Khattab, Omar
author_facet Agrawal, Lakshya A
Tan, Shangyin
Soylu, Dilara
Ziems, Noah
Khare, Rishi
Opsahl-Ong, Krista
Singhvi, Arnav
Shandilya, Herumb
Ryan, Michael J
Jiang, Meng
Potts, Christopher
Sen, Koushik
Dimakis, Alexandros G.
Stoica, Ion
Klein, Dan
Zaharia, Matei
Khattab, Omar
contents 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% (e.g., +12% accuracy on AIME-2025), and demonstrates promising results as an inference-time search strategy for code optimization. We release our code at https://github.com/gepa-ai/gepa .
format Preprint
id arxiv_https___arxiv_org_abs_2507_19457
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning
Agrawal, Lakshya A
Tan, Shangyin
Soylu, Dilara
Ziems, Noah
Khare, Rishi
Opsahl-Ong, Krista
Singhvi, Arnav
Shandilya, Herumb
Ryan, Michael J
Jiang, Meng
Potts, Christopher
Sen, Koushik
Dimakis, Alexandros G.
Stoica, Ion
Klein, Dan
Zaharia, Matei
Khattab, Omar
Computation and Language
Artificial Intelligence
Machine Learning
Software Engineering
I.2.7; I.2.6; I.2.4; I.2.8
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% (e.g., +12% accuracy on AIME-2025), and demonstrates promising results as an inference-time search strategy for code optimization. We release our code at https://github.com/gepa-ai/gepa .
title GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning
topic Computation and Language
Artificial Intelligence
Machine Learning
Software Engineering
I.2.7; I.2.6; I.2.4; I.2.8
url https://arxiv.org/abs/2507.19457