GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning
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 can often provide a much richer
learning medium for LLMs, compared with 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 system-level 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 four
tasks, GEPA outperforms GRPO by 10% 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% across two LLMs, and demonstrates promising results as an
inference-time search strategy for code optimization.
6887e6b5af872d625c10c570
Lakshya A Agrawal
claimed_verified
2025-07-29T07:09:08.935Z
63bf0cbb24e75d1efdfdf8bd
/avatars/3bb13e989db31820734cbe6b13be130a.svg
Lakshya A Agrawal
user
LakshyAAAgrawal
6887e6b5af872d625c10c571
Shangyin Tan
6887e6b5af872d625c10c572
Dilara Soylu
6887e6b5af872d625c10c573
Noah Ziems
6887e6b5af872d625c10c574
Rishi Khare
6887e6b5af872d625c10c575
Krista Opsahl-Ong
6887e6b5af872d625c10c576
Arnav Singhvi
6887e6b5af872d625c10c577
Herumb Shandilya
6887e6b5af872d625c10c578
Michael J Ryan
6887e6b5af872d625c10c579
Meng Jiang
6887e6b5af872d625c10c57a
Christopher Potts
6887e6b5af872d625c10c57b
Koushik Sen
6887e6b5af872d625c10c57c
Alexandros G. Dimakis
6887e6b5af872d625c10c57d
Ion Stoica
6887e6b5af872d625c10c57e
Dan Klein
6887e6b5af872d625c10c57f
Matei Zaharia
6887e6b5af872d625c10c580
Omar Khattab
GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning
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 can often provide a much richer
learning medium for LLMs, compared with 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 system-level 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 four
tasks, GEPA outperforms GRPO by 10% 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% across two LLMs, and demonstrates promising results as an
inference-time search strategy for code optimization.
GEPA, a prompt optimizer using natural language reflection, outperforms RL methods like GRPO and MIPROv2 with fewer rollouts by learning high-level rules from trial and error.
Large language models reinforcement learning Group Relative Policy Optimization GRPO prompt optimizer Genetic-Pareto GEPA natural language reflection system-level trajectories Pareto frontier code optimization