arXiv:2503.01163cs.AIcs.CL2025-03ACL被引 10

用强化学习策略选择优化提示词,让大模型生成更有效提示。

Bandit-Based Prompt Design Strategy Selection Improves Prompt Optimizers

  • 引入显式策略选择机制,替代大模型自行判断
  • 在BIG-Bench Hard上提升EvoPrompt性能,Thompson采样最优
  • 适合想提升提示工程效率的研究者和开发者

提示词优化旨在搜索能提升大语言模型(LLMs)性能的有效提示。尽管现有方法已发现有效提示,但通常与人类专家精心设计的复杂提示不同。提示设计策略作为提升提示性能的最佳实践,对优化过程至关重要。近期提出的自主提示工程工具箱(APET)将多种提示设计策略融入优化流程,但依赖大模型隐式选择策略,可能因优化能力有限而次优。本文提出优化提示与策略选择(OPTS),实现提示设计策略的显式选择。我们设计三种机制,包括基于Thompson采样的方法,并集成至知名提示优化器EvoPrompt。在两个大模型Llama-3-8B-Instruct和GPT-4o mini上,使用BIG-Bench Hard进行实验。结果表明,策略选择显著提升EvoPrompt性能,其中Thompson采样机制表现最佳。实验代码已公开于https://github.com/shiralab/OPTS。

原文摘要 · Abstract (English)

Prompt optimization aims to search for effective prompts that enhance the performance of large language models (LLMs). Although existing prompt optimization methods have discovered effective prompts, they often differ from sophisticated prompts carefully designed by human experts. Prompt design strategies, representing best practices for improving prompt performance, can be key to improving prompt optimization. Recently, a method termed the Autonomous Prompt Engineering Toolbox (APET) has incorporated various prompt design strategies into the prompt optimization process. In APET, the LLM is needed to implicitly select and apply the appropriate strategies because prompt design strategies can have negative effects. This implicit selection may be suboptimal due to the limited optimization capabilities of LLMs. This paper introduces Optimizing Prompts with sTrategy Selection (OPTS), which implements explicit selection mechanisms for prompt design. We propose three mechanisms, including a Thompson sampling-based approach, and integrate them into EvoPrompt, a well-known prompt optimizer. Experiments optimizing prompts for two LLMs, Llama-3-8B-Instruct and GPT-4o mini, were conducted using BIG-Bench Hard. Our results show that the selection of prompt design strategies improves the performance of EvoPrompt, and the Thompson sampling-based mechanism achieves the best overall results. Our experimental code is provided at https://github.com/shiralab/OPTS .

提示工程强化学习大模型优化

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