Skip to content

GEPA: reflective prompt evolution can outperform RL

Skip →Meta-Harness
Agents stage 2 #1corefrontierpaperrubric 12/122025 · ICLR 2026 (Oral) · ~35 min

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

Read first: MIPROv2: optimizing instructions and demonstrations for multi-stage LM programs

Status

TL;DR. GRPO typically needs thousands of rollouts, and one intuition for why is that each rollout yields only a single scalar (an intuition, not a general lower bound). GEPA instead:

  1. runs the system and records full traces (reasoning, tool calls, tool outputs);
  2. asks a reflection LM to diagnose failures in natural language, using textual feedback from a feedback function;
  3. proposes a rewritten prompt for one module and tests it;
  4. keeps a Pareto set of candidates: the union of per-instance winners on a held-out Pareto validation set (D_pareto, separate from the training minibatches that supply feedback), with dominated candidates pruned and parents sampled in proportion to how many instances they lead. It can also merge complementary candidates.

Why it matters now. It compares “learn in text” against “learn in weights” (GRPO) on the same compound systems, with two qualifications. The GRPO comparison uses the trainable open model (Qwen3 8B, LoRA); the GPT-4.1 Mini results compare GEPA only with other prompt optimizers such as MIPROv2. And the headline is an average across six tasks, not a win on each: Table 1 shows AIME as the exception. Whether RL for search agents could be partly replaced by reflective prompt evolution is an open research question.

Optimizing an LM program: modules with tunable parameters, and an optimizer loop Top: a multi-hop question-answering program made of modules (generate search query, retrieve, generate a second query, retrieve, answer). Each LM module has three tunable parameters: its instruction, its few-shot demonstrations and the model weights. Bottom: an optimizer runs the program on training inputs, scores the final output with a metric, and proposes new parameters. Labels show what each optimizer changes: bootstrapping changes demonstrations, MIPROv2 searches instructions and demonstrations with a Bayesian surrogate, BetterTogether alternates prompt optimization and fine-tuning, and GEPA reflects on traces in natural language and keeps a Pareto set of candidates. An LM program (multi-hop QA), written as modules with signatures question query₁ ←question retrieve query₂ ←question, notes retrieve answer ←question, passages output each LM module (shaded) has three knobs: instruction demos weights The optimizer loop (no module-level labels, no gradients through the pipeline) run program ontraining inputs score final outputwith a metric propose newknob settings repeat within a budget of program runs What each one turns Bootstrap (DSPy) demos from passing traces MIPROv2 instructions + demos, Bayesian surrogate BetterTogether alternate prompts ⇄ weights GEPA reflect on traces in text, keep a Pareto set Assertions add constraints: on failure, retry the module with the error in its prompt. The program is the model; prompts and weights are its parameters.
GEPA turns the instruction knobs using reflection on traces, and keeps a Pareto set rather than one best candidate.

An illustrative pool of four candidates scored on a tiny three-instance D_pareto (scores in 0–1; real Pareto sets have tens to hundreds of instances):

Candidatee1e2e3MeanStatus
P0 (seed)0.40.50.30.40not best anywhere, so not on the front
P10.90.50.20.53leads e1
P20.30.80.70.60leads e2 and e3
P30.30.80.60.57ties on e2 but dominated by P2 (at least as good everywhere, better on e3), so pruned
  1. Front and pruning. Per-instance winners are P1 (e1), P2 and P3 (e2), and P2 (e3). P3 is pruned as dominated, leaving P1 leading 1 instance and P2 leading 2.
  2. Parent choice. Sample a parent with probability proportional to instances led: P1 with 1/3, P2 with 2/3. Greedy best-mean selection would always pick P2 and never refine P1’s strategy, which is the only one that solves e1-type questions.
  3. Reflective edit. Suppose P1 is drawn and its hop-2 query module is chosen. Run P1 on a fresh 3-example training minibatch (3 rollouts); the feedback function reports, say, “gold document D2 not retrieved; the hop-2 query repeated the hop-1 entity”. The reflection LM rewrites that module’s instruction (“name the bridge entity found in hop 1 explicitly”), producing child P4.
  4. Accept or discard. Run P4 on the same minibatch (3 more rollouts). Only if its minibatch average beats P1’s is P4 added to the pool and scored on every D_pareto instance (3 rollouts here, n_pareto in general).

Budget for this one step: 6 feedback rollouts plus 3 validation rollouts. With a realistic D_pareto of 100 instances, each accepted child costs 6 + 100, which is why most of GEPA’s rollout budget goes to validation (see the derive question).

  • The prompt is a small parameter space. For skills that need new knowledge or long-horizon behaviour, weights may still be needed. Are the two complementary, as in BetterTogether?
  • Results depend on a good feedback function. What is the “textual reward” for open-ended deep research?
  • How does this compare with rubric-based RL rewards (RL → Rewards, rubrics & judges)?
  • pip install gepa, or use dspy.GEPA on a DSPy program; the docs include runnable tutorials.

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Derive / compute

    GEPA's GRPO baseline uses groups of 12 rollouts for 4 training instances per step, over 500 steps. (a) How many rollouts is that? (b) On IFBench, GEPA reached 38.61% after 678 rollouts while GRPO reached 35.88%; what is the rollout ratio? (c) Suppose a hypothetical GEPA run uses a 100-instance Pareto validation set, fully evaluates 4 candidates (including the seed), and spends 6 rollouts per proposal (parent and child on a 3-example minibatch). How many proposals fit in 678 rollouts, and what does that say about where the budget goes?

    What a strong answer covers
    • (a) 12 × 4 × 500 = 24,000 rollouts.
    • (b) 24,000 / 678 ≈ 35×, which is the "up to 35× fewer rollouts" headline.
    • (c) 4 × 100 = 400 validation rollouts, leaving (678 − 400) / 6 ≈ 46 proposals. Validation dominates, consistent with the paper's report that most of the budget goes to validation and that train rollouts alone (79–737) were enough to reach the best result.
    • Implication: each proposal is informed by text, so few are needed. Shrinking the validation set is the main remaining lever, but it makes selection noisier.
  2. Mechanism

    GEPA matches or beats GRPO with far fewer rollouts. What information does a reflective feedback string (for HoVer, the gold documents still missing after each hop) carry that GRPO's scalar reward does not, and how does that change the credit-assignment problem?

    What a strong answer covers
    • A scalar says only how good a run was. GRPO estimates a gradient from score differences inside groups of 12 samples, accumulated over many steps.
    • The feedback names what failed (missing documents, a broken constraint, a compiler error) and the trajectory shows which module produced it, so the reflection LM does credit assignment by reading the trace.
    • One trace can justify a large, targeted edit (one new rule in an instruction), whereas a policy-gradient step is a small change spread across all LoRA parameters.
    • The search space is much smaller and more structured: a few hundred tokens of one module's instruction, chosen round-robin, rather than weight space.
    • Limit: the advantage depends on informative feedback and a capable reflection LM. AIME, where the signal is essentially only correctness, was the one benchmark where GEPA did not beat GRPO.
  3. What if…

    GEPA's candidate-selection ablation gives aggregate gains of +12.44% for Pareto-based selection, +6.05% for always picking the best candidate, and +5.11% for beam search with N = 4. Why does selecting from the Pareto front over validation instances help this much, and what failure does it prevent?

    What a strong answer covers
    • Always mutating the best-mean candidate makes every proposal refine one lineage, so the search stalls in a local optimum.
    • GEPA collects the candidates that are best on at least one validation instance and prunes any that are dominated by another candidate. The survivors hold strategies that work on a subset even if their average is lower.
    • Sampling in proportion to the number of instances a candidate leads balances exploration and exploitation without a temperature parameter.
    • Diverse lineages are also what Merge needs, since it combines modules from lineages that solved different instances.
    • Beam search keeps the top N by mean, which still favours similar candidates. Probe: the benefit should grow with task heterogeneity, which you could test by mixing question types.
  4. Critique

    Critique the claim that reflective prompt evolution is more sample-efficient than RL fine-tuning. Consider the GRPO setup, the per-task feedback functions, and what counts as a rollout, and propose an experiment that could overturn the conclusion.

    What a strong answer covers
    • GRPO used LoRA (rank 16) with one fixed schedule of 500 steps and one learning rate; better-tuned or full fine-tuning might converge faster.
    • Rollout counts leave out the reflection LM's calls and the human effort of writing feedback functions (missing gold documents, PII breakdown, compiler-error manual lookups). That is supervision GRPO did not receive.
    • The methods change different things (prompt versus weights) and could be complementary, so this is not a pure algorithm comparison.
    • AIME, where feedback is little more than correctness, was the exception.
    • Experiment: give GRPO the same information (for example a shaped reward from the fraction of gold documents retrieved), and run GEPA with only the scalar score as its feedback text. If the gap closes, the advantage comes from feedback content, not from reflection.
  5. Research idea

    You want to apply GEPA to a deep-research agent evaluated with nugget-based recall, as in TREC RAG or BrowseComp-Plus-style evaluation. Design the feedback function and the evaluation, and state the research hypothesis you would pitch.

    What a strong answer covers
    • Feedback: the gold nuggets missed, nuggets supported by wrong citations, and which search queries did or did not retrieve the supporting documents, mirroring the missing-gold-documents feedback for HotpotQA and HoVer.
    • Attribute feedback per module (query planner, reader, writer) so that the round-robin update edits the module that actually failed.
    • Hypothesis: nugget-level feedback improves faster per rollout than a scalar nugget score, because it tells the optimizer what information is missing.
    • Evaluation: GEPA with nugget feedback against scalar-only feedback and MIPROv2 at matched rollouts, on held-out topics, and checking transfer across retrievers and task LMs.
    • Risks: overfitting to the training nugget sets, leakage if test nuggets reach the feedback, and LLM nugget judges with their own biases.
  6. Connect

    GEPA's Merge operator combines the best module versions from different lineages. Relate it to crossover in genetic algorithms and to weight-space model merging, and explain when Merge should help and when it should hurt in a multi-module program.

    What a strong answer covers
    • Like crossover, Merge recombines parts of two parents; it is system-aware because it swaps whole modules rather than random text spans. Unlike weight merging, nothing is averaged: each module is a discrete choice.
    • It helps when modules are fairly independent: a better query writer from one lineage and a better answerer from another can compose.
    • It hurts when modules have co-adapted: a query module tuned to one answer module's expectations may clash with another.
    • Evidence on GPT-4.1 Mini: Merge raised HoVer from 51.67 to 56.67 but lowered HotpotQA from 69.00 to 65.67. The paper summarizes it as up to 5% better, about 2% in aggregate.
    • A test for co-adaptation: evaluate all cross-lineage module combinations and measure how far scores deviate from an additive model.

Done with this page?

Status