arXiv:2507.19457cs.CLcs.AI2025-07中稿 · ICLR被引 350

用自然语言反思优化提示,少用强化学习也能提升模型表现

GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning

  • 通过语言反思诊断问题并迭代优化提示,替代传统强化学习
  • 仅用少量推理轮次即实现平均6%、最高20%的性能提升
  • 适合需要高效调优提示的开发者和研究者使用

大型语言模型(LLMs)通常通过强化学习方法(如组相对策略优化,GRPO)适应下游任务,但常需数千次推理轮次。我们提出GEPA(遗传-帕累托)提示优化器,利用自然语言反思机制,从试错中提炼高层规则。GEPA可对任意包含一个或多个提示的AI系统采样推理轨迹(如推理过程、工具调用与输出),以自然语言进行诊断、提出并测试提示更新,并融合自身尝试中帕累托最优解的互补经验。得益于该设计,仅需少数轮次即可带来显著性能提升。在六个任务上,GEPA相较GRPO平均提升6%、最高达20%,且最多减少35倍的推理轮次;同时超越领先提示优化器MIPROv2超过10%(例如在AIME-2025上提升12%准确率),并在代码优化的推理时搜索中表现优异。代码已开源:https://github.com/gepa-ai/gepa。

原文摘要 · Abstract (English)

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 .

提示优化语言反思效率提升LLM应用

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。