GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning

Lakshya A Agrawal (PhD student · UC Berkeley), Shangyin Tan, Dilara Soylu, Noah Ziems, Rishi Khare, Krista Opsahl-Ong, Arnav Singhvi, Herumb Shandilya, Michael J Ryan, Meng Jiang, Christopher Potts, Koushik Sen, Alex Dimakis, Ion Stoica, Dan Klein, Matei Zaharia, Omar Khattab

International Conference on Learning Representations 2026 · Oral

Overview

This talk introduces GEPA (Genetic Evolutionary Prompt Algorithm), a novel sample-efficient learning and optimization technique designed for agents and large language model (LLM)-based systems. Presented by Lakshya A Agrawal, a PhD student at UC Berkeley SkyLab, GEPA challenges the conventional paradigm of reinforcement learning (RL) by demonstrating that reflective optimization in text space can achieve superior performance with significantly fewer data samples. The core innovation lies in using an LLM to reflect on full rollout traces, diagnose failures, and propose prompt updates, rather than relying solely on binary reward signals and gradient-based weight updates.

Watch on SlidesLive

Visual summary for GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning by 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, Alex Dimakis, Ion Stoica, Dan Klein, Matei Zaharia, Omar Khattab
Visual summary for GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning by 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, Alex Dimakis, Ion Stoica, Dan Klein, Matei Zaharia, Omar Khattab

Key moments

  1. 0:00 Introduction: Sample efficiency bottleneck in AI training
  2. 2:00 JEPA's core idea: Reflective optimization in text space
  3. 4:00 JEPA's superior performance and capabilities demonstrated
  4. 6:00 How JEPA works: Pareto-based candidate selection strategy
  5. 8:00 JEPA's universal 'optimize anything' API and applications
  6. 10:40 Real-world adoption and production use of JEPA
  7. 14:30 Addressing seed prompt sensitivity and mutation rate (Q&A)

GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning

Speakers: Lakshya A Agrawal (PhD student, UC Berkeley); Shangyin Tan; Dilara Soylu; Noah Ziems; Rishi Khare; Krista Opsahl-Ong; Arnav Singhvi; Herumb Shandilya; Michael J Ryan; Meng Jiang; Christopher Potts; Koushik Sen; Alex Dimakis; Ion Stoica; Dan Klein; Matei Zaharia; Omar Khattab

Conference: ICLR 2026

YouTube: https://slideslive.com/39062118

Overview

This talk introduces GEPA (Genetic Evolutionary Prompt Algorithm), a novel sample-efficient learning and optimization technique designed for agents and large language model (LLM)-based systems. Presented by Lakshya A Agrawal, a PhD student at UC Berkeley SkyLab, GEPA challenges the conventional paradigm of reinforcement learning (RL) by demonstrating that reflective optimization in text space can achieve superior performance with significantly fewer data samples. The core innovation lies in using an LLM to reflect on full rollout traces, diagnose failures, and propose prompt updates, rather than relying solely on binary reward signals and gradient-based weight updates.

The talk highlights a critical bottleneck in modern AI development: sample efficiency. While computational power continues to grow, the availability of high-quality, domain-specific data and the cost/time associated with collecting rollouts are increasingly limiting the progress of AI systems, particularly in real-world agent applications. GEPA offers a compelling solution by enabling models to learn from as few as one rollout, driving substantial performance improvements across a diverse range of tasks, from code generation to agent architecture search, and even optimizing proprietary black-box models. This approach not only accelerates development but also makes advanced AI capabilities more accessible for problems with limited data.

GEPA's significance extends beyond mere efficiency gains; it represents a paradigm shift in how AI systems can learn and evolve. By treating natural language prompts as a "gene pool" and employing a genetic algorithm with multi-objective selection, GEPA moves beyond incremental weight adjustments to enable large, meaningful behavioral shifts through concise textual modifications. This method allows LLMs to discover complete system specifications and refine their own operational instructions, pushing the boundaries of self-improving AI and offering a universal API for optimizing anything representable in text.

Background

▶ Watch: Introduction: Sample efficiency bottleneck in AI training (0:00)

The journey of teaching AI to perform new tasks has traditionally relied on gradient-based weight updates, whether through pre-training, supervised fine-tuning (SFT), or reinforcement learning (RL). While incredibly effective, these methods demand vast quantities of data: trillions of tokens for pre-training, tens of thousands of labeled examples for SFT, and hundreds of thousands of rollouts for RL in complex domains like math or coding. This data hunger poses a significant challenge, especially as AI tackles increasingly intricate real-world problems.

The primary bottleneck is sample efficiency. Two key issues contribute to this: First, many real-world applications lack the extensive domain-specific knowledge resources required to train models offline using data-intensive methods like SFT. Second, collecting rollouts for online learning can be prohibitively slow or expensive. If an LLM workflow involves long-running tool integrations, complex verification processes, or interactions with physical environments, the environment itself becomes the bottleneck, regardless of model speed. This issue is particularly exacerbated by the growing use of AI agents in real-world applications, where integrated tools often entail lengthy execution times.

The dominant paradigm to address this, particularly for complex tasks, has been reinforcement learning with verified rewards. In this setup, a model performs multiple rollouts, receives a reward signal at the end, and then an algorithm like GRPO (Generalized Policy Optimization) converts these rewards into gradients for back-propagation to update the model's weights. However, this approach is inherently inefficient. Each rollout generates a wealth of information: the model's internal chain of thought, tool calls, environment responses (including diagnostic error messages), and more. Yet, traditional RL typically distills all this rich context into a single, scalar, binary reward score, discarding most of the actionable feedback. This "binary score" limitation prevents the model from fully leveraging diagnostic value, leading to slow learning and high sample requirements. The problem, therefore, is not just about the volume of data, but about the quality and granularity of feedback utilized for learning.

Key Findings

▶ Watch: JEPA's superior performance and capabilities demonstrated (4:00)

GEPA introduces a paradigm shift by demonstrating that reflective optimization in text space can significantly outperform traditional reinforcement learning (RL) methods in terms of sample efficiency and overall performance. The core innovation is to move beyond binary reward signals and gradient-based weight updates, instead leveraging an LLM's ability to reflect on full rollout traces and iteratively refine natural language prompts.

The key findings include:

  • Superior Sample Efficiency: GEPA achieves twice the performance improvement of GRPO, a leading RL method with verified rewards, using just one round of reflection and as few as three data points. This gap further doubles with a few more iterations, drastically reducing the data and computational resources required for learning.
  • Reflective Optimization from Rich Feedback: Instead of relying on a single binary reward, GEPA enables an LLM to analyze the complete trace of rollouts, including intermediate outputs, tool calls, environment responses, and error messages. This "global LLM reflection" allows for a deeper diagnosis of failures and more informed proposals for improvement.
  • Prompt Evolution for Large Behavioral Shifts: Rather than making small, incremental weight updates, GEPA updates a prompt. A single natural language change in a prompt can induce a substantial behavioral shift in an LLM, a change that would typically require thousands of gradient updates. GEPA treats prompts as genes in a genetic algorithm, evolving them to optimize agent behavior.
  • Discovery of Complete System Specifications: GEPA moves beyond simply optimizing for model idiosyncrasies. It generates comprehensive system specifications within the prompt itself, including problem definitions, latent requirements, solution strategies, and output formats. This allows increasingly powerful, instruction-following models to perform optimally.
  • Black-Box Model Optimization: GEPA can effectively optimize proprietary, black-box models. For instance, it optimized GPT-4o mini to outperform even the full GPT-4o on LiveBench Math after only a few rounds of reflection.
  • Universal API for Text Optimization: The GEPA framework is generalized into a "universal API" that can optimize anything representable in text, given an evaluator function and actionable side information. This extends its applicability beyond prompts to agent architectures, CUDA kernels, numerical parameters, and algorithms.
  • Significant Performance Gains Across Diverse Tasks: GEPA demonstrated substantial improvements across various benchmarks, including a 7x performance increase for code generation for novel hardware accelerators (from 425 to 3052 with GPT-4o), an almost 3x boost in agent architecture performance (from 32 to 89 for Gemini 1.5 Flash), and a nearly 35% reduction in OCR error rates across different VLM scales.
  • Scalability Across Model Sizes: GEPA works effectively across a wide range of model scales, from 350-million parameter models up to the latest frontier models like GPT-o1-120B, where it enabled the model to outperform Claude Opus while being 90x cheaper.

Technical Deep Dive

▶ Watch: How JEPA works: Pareto-based candidate selection strategy (6:00)

At its core, GEPA (Genetic Evolutionary Prompt Algorithm) is a novel optimization technique that leverages the reflective capabilities of large language models (LLMs) to iteratively improve prompts and, by extension, agent behaviors. It fundamentally reimagines optimization as a process of "reinforcement learning in text space," moving beyond traditional gradient-based methods.

The algorithm operates as a genetic algorithm, treating natural language prompts as its "gene pool." Each iteration involves mutating prompts from this pool and selecting the best candidates based on performance. A key ingredient is its multi-objective selection strategy, which employs a Pareto frontier to balance exploration and exploitation, preventing the optimizer from getting trapped in local optima.

Here's a breakdown of the GEPA algorithm:

  1. Initialization:
  • GEPA receives a training set (split into dev and validation sets), an agent parameterized by prompts, and an evaluation metric.
  • It initializes a score matrix to track the performance of each candidate prompt on each validation item.
  • The Pareto frontier is established, representing the set of non-dominated prompts (i.e., prompts for which no other prompt is superior across all validation items).
  1. Iterative Optimization Loop:
  • Prompt Selection: In each iteration, GEPA selects a prompt from the current Pareto frontier. This selection strategy is crucial; unlike simple iterative reflection that might get stuck optimizing a single improvement, the Pareto-based approach ensures a diverse set of high-performing candidates is considered for mutation.
  • Execution and Feedback Collection: The selected prompt is run on a mini-batch of development examples. During these rollouts, GEPA captures not just a final score but also rich intermediate feedback, such as internal chains of thought, tool calls, environment responses, and crucially, diagnostic error messages (e.g., compiler errors in code generation).
  • LLM Reflection and Proposal: An LLM (which can be the same model being optimized or a stronger external model) is called to reflect on the collected traces, scores, and diagnostic feedback. Based on this comprehensive analysis, the LLM proposes alternative or improved prompts. This "global LLM reflection" is a key differentiator, as it synthesizes all available diagnostic information at every step, unlike local back-propagation methods.
  • Pool Update and Pareto Frontier Re-evaluation: The newly proposed candidate prompts are then evaluated on the validation set. Their performance scores are added to the score matrix, and the Pareto frontier is updated if necessary. This ensures that the pool of prompts continuously evolves, preserving and propagating rare, unique insights (per-instance Pareto pool).

Distinguishing Features of GEPA:

  • Per-Instance Pareto Pool: GEPA maintains a Pareto frontier that tracks the best-performing candidates per instance. This mechanism is critical for preserving unique insights that might be valuable for specific problem variations, preventing them from being discarded prematurely.
  • Global LLM Reflection: Unlike methods that perform local gradient-like updates, GEPA's LLM reflection operates globally, considering all available diagnostic feedback from full rollouts. This allows for more holistic and impactful changes to the prompt.
  • Evolutionary Tree + System-Aware Merge: Beyond simple prompt mutations, GEPA incorporates an evolutionary tree structure and a system-aware merge mechanism. This allows for "crossing" prompts across different modules or components, leading to improvements across generations rather than just single-generation passes. This is a significant advancement over prior prompt optimizers like MiPro.

Beyond Prompts: Universal API for Optimization:

The principles of GEPA extend far beyond just optimizing LLM prompts. The talk introduces a universal API that casts a broad class of problems as "text optimization" problems. If a problem can be defined with:

  1. An evaluator function that provides a score.
  2. Actionable side information (e.g., compiler traces, profiler output, SLA violations, error messages).
  3. A representation that can be expressed in text.

Then GEPA can optimize it. The API is simple: provide the evaluator function and the set of problems, and GEPA handles the rest. Examples of this generalization include:

  • Agent Architecture Search: Starting from a simple one-step chain-of-thought agent, GEPA can discover complex multi-step agent architectures. For instance, it evolved a six-step agent architecture for Gemini 1.5 Flash, boosting performance from 32 to 89.
  • CUDA Kernel Optimization: When optimizing non-differentiable functions like CUDA kernels, compiler and profiler outputs serve as actionable side information, enabling GEPA's smart proposer to reason about changes that would improve performance.
  • Multi-modal VLM Improvement: GEPA can optimize the performance of multi-modal vision-language models (VLMs), such as reducing OCR error rates.

This generalization underscores GEPA's potential as a powerful, flexible tool for a wide array of ML and systems optimization challenges, moving towards a future where AI can intelligently optimize its own operational instructions and even its underlying architecture.

Experimental Setup & Results

▶ Watch: Real-world adoption and production use of JEPA (10:40)

GEPA's effectiveness is demonstrated through a series of rigorous experiments across various benchmarks, models, and tasks, consistently highlighting its sample efficiency and performance gains over traditional methods.

1. Comparison with Reinforcement Learning (GRPO):

  • Baseline: GRPO (Generalized Policy Optimization), a leading RL method for verified rewards.
  • Model: Qwen-3-8B.
  • Result: GEPA achieved twice the performance improvement that GRPO obtained after 25,000 rollouts in just one round of reflection using as few as three data points. Continuing GEPA for a few more iterations doubled this performance gap. This stark comparison underscores GEPA's superior sample efficiency. Notably, this optimization was self-contained, with Qwen-3-8B optimizing itself without an external teacher.

2. Prompt Generation for Multi-hop Question Answering:

  • Model: GPT-4o mini.
  • Result: GEPA generated a comprehensive system specification for a multi-hop question-answering system. The generated prompt included a full problem specification, latent requirements, a solution strategy, and output format details, showcasing GEPA's ability to discover precise task specifications crucial for instruction-following models.

3. Optimization of Black-Box Models (GPT-4o mini vs. GPT-4o):

  • Model: GEPA optimized GPT-4o mini.
  • Benchmark: LiveBench Math.
  • Result: After just a few rounds of reflection, the GEPA-optimized GPT-4o mini outperformed the full GPT-4o on the LiveBench Math dataset, demonstrating GEPA's capability to significantly enhance even proprietary, black-box models.

4. Code Generation for Novel Hardware Accelerators:

  • Model: GPT-4o.
  • Task: Writing code for novel hardware accelerators, a domain with extremely limited pre-training data.
  • Result: Starting from a baseline performance of 425, GEPA achieved a 7x higher performance at 3052, highlighting its ability to optimize LLMs for tasks with almost no prior domain-specific data.

5. Pareto-based Candidate Selection Strategy Validation:

  • Comparison: GEPA's Pareto approach against TextGrad's select strategy and Microsoft TraceOptoPrime's beam search.
  • Result: Across four distinct benchmarks, GEPA's Pareto-based candidate selection consistently outperformed both baselines, even when evaluated using the same harness and with the same amount of information available. This validated the importance of GEPA's multi-objective approach for balancing exploration and exploitation.

6. Agent Architecture Search:

  • Models: Gemini 1.5 Flash and GPT-4o mini.
  • Task: Discovering optimal agent architectures.
  • Result: Starting from a simple one-step chain-of-thought agent, GEPA discovered a six-step agent architecture that boosted Gemini 1.5 Flash's performance from 32 to 89, an almost 3x jump. Similarly, it boosted GPT-4o mini's performance by over 20% on the math dataset.

7. Multi-modal VLM Performance Improvement:

  • Task: Reducing OCR error rates for multi-modal vision-language models.
  • Result: GEPA achieved a reduction in OCR error rates by almost 35% across different model scales, demonstrating its applicability to multi-modal domains.

8. Scalability Across Model Scales:

  • Models: Ranging from 1 billion parameter models up to frontier models like GPT-o1-120B.
  • Result: GEPA successfully improved models across this entire spectrum. Notably, it enabled GPT-o1-120B to outperform Claude Opus while being 90x cheaper. A key observation was that the improvement from GEPA was larger on stronger models, suggesting that as model capabilities improve, they benefit more significantly from the precise task specification that GEPA discovers, which humans often find difficult to articulate.

These results collectively underscore GEPA's robust performance, efficiency, and versatility across a wide array of tasks and model architectures, positioning it as a powerful tool for advancing AI development.

Practical Implications

▶ Watch: Addressing seed prompt sensitivity and mutation rate (Q&A) (14:30)

GEPA offers profound practical implications for a wide range of AI practitioners, infrastructure teams, model builders, and deployers, fundamentally altering how AI systems can be developed and optimized.

For Practitioners and Model Builders:

  • Overcoming Sample Inefficiency: The most immediate benefit is the ability to train and optimize LLM-based agents with significantly less data. For domains with low availability of labeled data or costly/slow rollouts (e.g., real-world physical interactions, complex simulations, niche enterprise applications), GEPA provides a viable path to deploy performant AI. This democratizes advanced AI capabilities by lowering the data barrier.
  • Optimizing Black-Box Models: The ability to optimize proprietary, black-box LLMs (like GPT-4o mini outperforming full GPT-4o) is a game-changer. Practitioners can now enhance the performance of commercial APIs without needing access to model weights or internal architectures, unlocking new levels of customization and efficiency for off-the-shelf models.
  • Discovering Optimal Task Specifications: GEPA automatically generates comprehensive and precise task specifications within prompts. This is invaluable, as human-generated prompts often struggle to capture all latent requirements and optimal strategies. As models become more instruction-following, GEPA ensures they operate at their peak potential, reducing the "prompt engineering" burden on human developers.
  • Universal Optimization API: The optimize anything API means developers can apply GEPA's principles beyond just prompts. This includes optimizing agent architectures, fine-tuning CUDA kernels, or refining numerical parameters, providing a unified framework for a diverse set of optimization challenges that can be expressed in text and provide actionable side information.

For Infrastructure Teams and Deployers:

  • Cost Efficiency: By drastically reducing the number of rollouts required (e.g., 3 data points vs. 25,000 rollouts for comparable gains), GEPA significantly lowers the computational and operational costs associated with training and fine-tuning. This translates to reduced GPU hours, faster iteration cycles, and more efficient resource utilization.
  • Faster Iteration and Deployment: The accelerated learning process enables quicker experimentation and deployment of AI agents. This agility is crucial in fast-evolving environments and for rapid prototyping of new AI-powered features.
  • Robustness to Diverse Environments: GEPA's ability to leverage diagnostic feedback (like error messages) makes agents more robust and adaptable. They can learn from failures in a nuanced way, leading to more resilient systems in production.

Tradeoffs and Limitations:

  • Reliance on Instruction-Following Capabilities: As acknowledged by the speaker, GEPA depends on the underlying LLM's existing instruction-following capabilities. While it has shown success with models as small as 350 million parameters, models with very poor instruction understanding might not benefit as much.
  • Sensitivity to Seed Prompt (Addressed): Early versions of GEPA were sensitive to the initial "seed prompt," with very naive prompts sometimes yielding better final results than more complex, but sub-optimal, starting points. This limitation has been addressed in the open-source offering by implementing a mechanism to rewrite the seed prompt after a few iterations, effectively allowing it to "start from scratch" and explore more diverse strategies. Additionally, clear guidance now suggests starting with a simple seed prompt and providing detailed information via objective and background fields in the API.
  • Mutation Rate Stability (Addressed): The "learning rate" or mutation rate between prompts could be unstable across different LLMs (e.g., Claude Sonnet exhibiting high variability compared to GPT or Qwen). This has also been addressed in the open-source project by integrating a precise mutation_rate parameter in the API, allowing users to control how much of the prompt is rewritten at each step.

Real-World Adoption: GEPA is already being used in production by various organizations, including startups and enterprises like Dropbox and Shopify, with OpenAI also highlighting its use in building self-evolving agents. This practical adoption underscores its real-world impact and utility beyond academic research.

In summary, GEPA provides a powerful, sample-efficient, and versatile method for optimizing LLM-based systems, enabling more sophisticated, cost-effective, and robust AI deployments across a wide spectrum of applications.

Key Takeaways

  • Sample Efficiency Breakthrough: GEPA significantly outperforms traditional reinforcement learning (RL) methods like GRPO in sample efficiency, achieving superior performance with orders of magnitude fewer data samples and rollouts.
  • Reflective Optimization in Text Space: Instead of binary rewards and gradient updates, GEPA leverages LLMs to reflect on full rollout traces, diagnose failures, and propose natural language prompt updates, enabling large behavioral shifts.
  • Genetic Algorithm with Pareto Selection: GEPA employs a genetic algorithm treating prompts as genes, using a multi-objective Pareto frontier selection to balance exploration and exploitation, leading to more robust and higher-quality solutions.
  • Universal Optimization for Text-Representable Problems: The GEPA framework is generalized into an API that can optimize any problem representable in text, given an evaluator and actionable side information, extending its utility beyond prompts to agent architectures, kernels, and more.
  • Significant Performance Across Diverse Applications: GEPA has demonstrated substantial improvements in code generation (7x), agent architecture search (3x), OCR error reduction (35%), and enabled black-box models (GPT-4o mini) to outperform larger counterparts (full GPT-4o).
  • Scalable and Adopted in Production: GEPA works across models from 350M to frontier LLMs, with larger models benefiting more from its precise task specification. It is already being used by major companies like Dropbox, Shopify, and OpenAI.

About the Speaker(s)

The primary speaker for this talk was Lakshya A Agrawal, a PhD student at UC Berkeley SkyLab. He is advised by Professor Matei Zaharia and Professor Dan Klein, both prominent figures in the fields of distributed systems and natural language processing, respectively. Agrawal's research focuses on sample-efficient learning and optimization techniques for AI agents and LLM-based systems, as exemplified by the GEPA project. The work presented is a collaborative effort involving a large team of researchers from UC Berkeley and other institutions, including Shangyin Tan, Dilara Soylu, Noah Ziems, Rishi Khare, Krista Opsahl-Ong, Arnav Singhvi, Herumb Shandilya, Michael J Ryan, Meng Jiang, Christopher Potts, Koushik Sen, Alex Dimakis, Ion Stoica, Dan Klein, Matei Zaharia, and Omar Khattab.

Reviews

→ Top-rated talks at International Conference on Learning Representations 2026

All talks from International Conference on Learning Representations 2026