GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning

Papers with Code Trending Papers

Summary

GEPA is a prompt optimizer that uses natural language reflection to learn from trial and error, outperforming reinforcement learning methods like GRPO and MIPROv2 with up to 35x fewer rollouts across multiple tasks.

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.
Original Article
View Cached Full Text

Cached at: 05/19/26, 12:37 PM

Paper page - GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning

Source: https://huggingface.co/papers/2507.19457 Published on Jul 25, 2025

#3 Paper of the day Authors:

,

,

,

,

,

,

,

,

,

,

,

,

,

,

,

Abstract

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(LLMs) are increasingly adapted to downstream tasks viareinforcement learning(RL) methods likeGroup 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 introduceGEPA(Genetic-Pareto), a prompt optimizer that thoroughly incorporatesnatural language reflectionto learn high-level rules from trial and error. Given any AI system containing one or more LLM prompts,GEPAsamplessystem-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 thePareto frontierof its own attempts. As a result ofGEPA’s design, it can often turn even just a few rollouts into a large quality gain. Across four tasks,GEPAoutperformsGRPOby 10% on average and by up to 20%, while using up to 35x fewer rollouts.GEPAalso outperforms the leadingprompt optimizer, MIPROv2, by over 10% across two LLMs, and demonstrates promising results as an inference-time search strategy forcode optimization.

View arXiv pageView PDFProject pageGitHub4.51kAdd to collection

Get this paper in your agent:

hf papers read 2507\.19457

Don’t have the latest CLI?curl \-LsSf https://hf\.co/cli/install\.sh \| bash

Models citing this paper1

#### pirola/local-ai-coding-stack-research

Datasets citing this paper0

No dataset linking this paper

Cite arxiv.org/abs/2507.19457 in a dataset README.md to link it from this page.

Spaces citing this paper0

No Space linking this paper

Cite arxiv.org/abs/2507.19457 in a Space README.md to link it from this page.

Collections including this paper5

Browse 5 collections that include this paper

Similar Articles

GEPA-Curator: Curated Learning for Self Improving Agents

Hugging Face Daily Papers

GEPA-Curator is a framework that improves agentic prompt optimization by filtering noisy failure signals and retrieving prior successful trajectories, achieving gains of up to 20.7% over GEPA and 21.2% over ACE on benchmarks like GoBrowse, ALFWorld, AppWorld, and τ-bench.

Environment-Grounded Automated Prompt Optimization for LLM Game Agents

arXiv cs.CL

Introduces an automated prompt optimization framework for LLM game agents that decomposes the observation-to-action pipeline into two agents and iteratively refines prompts via an evolutionary loop guided by environment returns. Evaluated on BabyAI tasks, it significantly improves success rates (e.g., from 0% to 72.5% on PutNext) without updating model weights.