Search NASA⌕ Search

DOE OSTI · 3025768

GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning

Abstract

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 often provides a much richer learning medium for LLMs, compared to 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 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 six tasks, GEPA outperforms GRPO by 6% 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% (e.g., +12% accuracy on AIME-2025), and demonstrates promising results as an inference-time search strategy for code optimization. We release our code at https://github.com/gepa-ai/gepa.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Agrawal, Lakshya A. [University of California, Berkeley, CA (United States)], Tan, Shangyin [University of California, Berkeley, CA (United States)], Soylu, Dilara [Stanford Univ., CA (United States)], Ziems, Noah [University of Notre Dame, IN (United States)], Khare, Rishi [University of California, Berkeley, CA (United States)], Opsahl-Ong, Krista [Databricks, San Francisco, CA (United States)], Singhvi, Arnav [Stanford Univ., CA (United States); Databricks, San Francisco, CA (United States)], Shandilya, Herumb [Stanford Univ., CA (United States)], Ryan, Michael J. [Stanford Univ., CA (United States)], Jiang, Meng [University of Notre Dame, IN (United States)], Potts, Christopher [Stanford Univ., CA (United States)], Sen, Koushik [University of California, Berkeley, CA (United States)], Dimakis, Alexandros G. [University of California, Berkeley, CA (United States); Bespoke Labs, Santa Clara, CA (United States)], Stoica, Ion [University of California, Berkeley, CA (United States)], Klein, Dan [University of California, Berkeley, CA (United States)], Zaharia, Matei [Databricks, San Francisco, CA (United States)], Khattab, Omar [Massachusetts Inst. of Technology (MIT), Cambridge, MA (United States)]. 2025-01-01. GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning. https://doi.org/10.48550/arxiv.2507.19457

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related reports

TANTE: Time-adaptive operator learning via neural Taylor expansion

Operator learning for time-dependent partial differential equations (PDEs) has seen rapid progress in recent years, enabling efficient approximation of complex spatiotemporal dynamics. However, most existing methods rely on fixed time step sizes during rollout, which limits their ability to adapt to varying temporal complexity and often leads to error accumulation. In this work, we propose the Time-Adaptive Transformer with Neural Taylor Expansion (TANTE), a novel operator-learning framework that produces continuous-time predictions with adaptive step sizes. TANTE predicts future states by performing a Taylor expansion at the current state, where neural networks learn both the higher-order temporal derivatives and the local radius of convergence. This allows the model to dynamically adjust its rollout based on the local behavior of the solution, thereby reducing cumulative error and improving computational efficiency. We demonstrate the effectiveness of TANTE across a wide range of PDE benchmarks, achieving superior accuracy and adaptability compared to fixed-step baselines, delivering accuracy gains of 60-80 % and speed-ups of 30-40 % at inference time.

97 MATHEMATICS AND COMPUTING↗

Structured illumination for surface-resolved grazing-incidence X-ray scattering

Grazing-incidence (GI) scattering techniques are widely used to characterize thin films, offering high surface sensitivity and insight into morphology and structure. However, these approaches typically provide statistical averaged information due to elongated footprint or limited spatial resolution due to beam size. Here we introduce a method that combines structured illumination with GI X-ray scattering and leverages our computational imaging approach to resolve local structural details. We demonstrate that our method captures local features of an organic semiconductor thin film without the need for sample rotation as in tomography. The method expands GI techniques from statistical averaging to high-resolution imaging, thereby providing the capability for detailed analysis of local material properties, such as domain shape, orientation and polymorphism, which are critical for advancing material design towards more efficient and tailored materials.

97 MATHEMATICS AND COMPUTING↗