arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.19062cs.AI
收藏

RLPE:通过强化学习教大型语言模型(LLM)编写提示

RLPE: Teaching LLMs to Prompt with Reinforcement Learning

Rahul Singhal, Karime Maamari, Pradyumna Tambwekar

AI总结:

本研究提出RLPE方法,训练模型分析任务模型轨迹编写针对性提示,该提示可复用且兼容闭源模型,训练出的90亿参数模型在多数基准测试中表现优于前沿模型与优化器,还具备泛化能力。

摘要:

提示(Prompting)是将通用大型语言模型(LLM)适配到特定领域任务的广泛使用方法。有效的提示手动创建起来十分繁琐,因此提示编写越来越多地交由LLM完成,近期研究还训练LLM为其他模型编写提示。这些技术要么在不观察任务模型行为的情况下编写提示,无法感知提示应解决的失败模式;要么必须在推理时与任务LLM并行运行,为每个查询增加开销,均不符合实际提示工程的常见实践。为缩小这一差距,我们提出强化学习提示工程(RLPE),该方法训练一个模型,分析独立任务模型的轨迹并编写针对其观察到的失败的提示。RLPE严格根据提示性能奖励训练模型,使其学习可提升任务模型的提示策略。提示生成一次后可在任务中重复使用,因此推理无需训练后的模型。由于RLPE仅需查询其提示的模型,它也与闭源模型兼容。我们将RLPE应用于Enigmata、BIG-Bench Extra Hard和PlanBench。我们训练了一个90亿参数的模型,在三分之二的基准测试中,其编写的提示优于最先进的前沿模型(gpt-5.6-sol和claude-opus-5)及提示优化器(GEPA和TextGrad)。尽管该模型从未明确接受过提示迭代的训练,但此能力的出现水平与前沿模型相当或更优。学习到的提示能力还具备泛化性,训练后的模型可提升比其训练时所用模型大6倍的任务模型,包括来自完全不同模型家族的模型,并在训练时留出的第四个基准测试上与claude-opus-5表现相当。

英文摘要:

Prompting is a widely used method for adapting general-purpose LLMs to domain-specific tasks. Effective prompts can be tedious to create manually, so prompt writing is increasingly handed to LLMs, with recent work training LLMs to write prompts for other models. These techniques either write prompts without observing how the task model behaves, blind to the failure modes the prompt should address, or must run alongside the task LLM at inference time, adding overhead to every query. Neither reflects how prompt engineering is often practiced. To close this gap, we introduce Reinforcement Learned Prompt Engineering (RLPE), which trains a model to analyze traces of a separate task model and write a prompt targeting the failures it observes. RLPE rewards the trained model strictly on prompt performance, so it learns the prompting strategies that improve the task model. The prompt is generated once and reused across the task, so inference does not require the trained model. Since RLPE needs only query access to the model it prompts, it is also compatible with closed-source models. We apply RLPE to Enigmata, BIG-Bench Extra Hard, and PlanBench. We train a 9B-parameter model that writes better prompts than state-of-the-art frontier models (gpt-5.6-sol and claude-opus-5) and prompt optimizers (GEPA and TextGrad) on 2/3 benchmarks. Although the model is never explicitly trained to iterate on prompts, this capability emerges at a level that matches or beats frontier models. The learned prompting capability also generalizes, with the trained model improving task models 6x larger than the one it trained with, including ones from entirely different model families, and matching claude-opus-5 on a fourth benchmark held out from training.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑