Reflective Optimizers: Learning in Language
What if the optimizer's update step were not a numeric gradient but a paragraph of natural-language reflection? That is the bet behind reflective optimizers — and one of them rivals reinforcement learning while using a fraction of the rollouts.
The foundations series used reflection to help a single agent learn from a mistake. The frontier turns reflection into a full optimization operator: instead of a numeric gradient nudging weights, the update is a natural-language diagnosis of what went wrong and how to fix it, applied at the level of the whole system’s prompts. This fifth post in the Self-Evolving Agents: The Frontier series covers reflective optimizers — GEPA in particular — and why “learning in language” can beat learning by reward.
Reflection as a gradient
Recall the seed idea from Reflexion (Shinn et al., 2023): convert an outcome into a verbal lesson and feed it back. Reflective optimizers generalize this into a search operator. The optimization loop becomes: run the system, reflect in natural language on the full trajectory to diagnose what failed and why, propose a concrete change, test it, and keep what helps. The “gradient” is a sentence — “the agent kept missing the edge case where the input is empty; add an explicit check” — rather than a vector. It is a semantic update, and it carries information a scalar reward cannot: not just that something scored low, but why, in terms a model can act on.
GEPA: reflective prompt evolution
The clearest instance is GEPA (Agrawal et al., 2025) — Genetic-Pareto — which combines reflection with the evolutionary and Pareto ideas from the previous posts. Given any system built from one or more LLM prompts, GEPA:
- Samples system-level trajectories — the reasoning, tool calls, and tool outputs of the whole system, not just a final score.
- Reflects on them in natural language to diagnose problems and propose prompt updates — the reflective operator.
- Tests the updates and combines complementary lessons from the Pareto frontier of its own attempts — keeping candidates that win on different aspects and merging their strengths, rather than collapsing to one scalar winner.
The headline result is striking: across tasks, GEPA reported outperforming GRPO — a reinforcement-learning method — by around 10% on average and up to 20%, while using up to 35× fewer rollouts, and also beating the leading prompt optimizer MIPROv2 by over 10% across two models. A reflective, language-based optimizer rivalling and exceeding RL, at a fraction of the sample cost.
Why reflection can beat reward
The efficiency is not an accident, and understanding why is the point of this post. Reinforcement learning learns from a scalar reward: each rollout tells the system a single number — better or worse — and it takes many rollouts to infer what to change from a stream of such numbers. Reflection extracts far more signal per rollout: a natural-language diagnosis of a trajectory identifies the specific failure and a specific fix in one shot. Where RL needs thousands of trials to feel its way down a gradient, a reflective optimizer can read one failed trajectory and articulate the correction directly.
That is the deep idea: a language model’s ability to reason about its own behavior is a richer learning signal than a reward number, and reflective optimizers exploit it. The model already understands language and tasks; asking it to diagnose and propose is a more natural, higher-bandwidth update than back-propagating a reward it has to reverse-engineer. Combine that per-rollout richness with a Pareto frontier that preserves diverse partial lessons, and you get an optimizer that is both sample-efficient and good at multi-faceted tasks.
The dependency, restated
Reflective optimizers do not escape the frontier’s binding constraint — they sharpen it. The reflection is only as good as the signal it reflects on: GEPA reflects on real system trajectories with real outcomes (tool results, execution, task success), which is exactly why the reflection is trustworthy. Point a reflective optimizer at a task with no genuine outcome to reflect on, and it will confidently reflect its way toward nonsense, because the diagnosis has nothing real to anchor to. The power of “learning in language” comes precisely from reflecting on grounded trajectories; strip the grounding and reflection becomes eloquent drift — the same limit the foundations series proved about ungrounded self-correction.
Where reflective optimizers fit
Reflective optimizers are among the most practical frontier techniques because their sample-efficiency makes them affordable where RL is not: you can improve a multi-step LLM system with tens of grounded trajectories and reflective updates instead of thousands of reward rollouts. They fit naturally on top of the DSPy-style “program, not prompt” stance — the system is declared, and a reflective optimizer compiles its prompts by diagnosing and fixing, at the system level. Reach for them when you have a measurable multi-step system to improve and rollouts are expensive; anchor the reflection in real trajectories and outcomes; and remember that the elegance of a language-based gradient does not exempt you from needing a real signal underneath it.
Key takeaways
- Reflective optimizers turn reflection into an optimization operator: the update is a natural-language diagnosis of a trajectory (“here’s what failed and the fix”) rather than a numeric gradient.
- GEPA combines reflection with evolutionary/Pareto search — sampling system trajectories, reflecting to propose prompt updates, and merging complementary lessons from a Pareto frontier of attempts.
- Reported results: GEPA beat an RL method (GRPO) by ~10-20% while using up to 35× fewer rollouts, and beat MIPROv2 by over 10% — a language-based optimizer rivalling reinforcement learning.
- Reflection can beat reward because a natural-language diagnosis extracts far more signal per rollout than a scalar reward, which needs many trials to infer what to change.
- The power depends on reflecting over grounded trajectories (real tool/execution/task outcomes); without a real signal, reflective optimization becomes eloquent drift — the same limit as ungrounded self-correction.
Further reading
- GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning — Agrawal et al., 2025
- Reflexion: Language Agents with Verbal Reinforcement Learning — Shinn et al., 2023
- DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines — Khattab et al., 2023