用于离散提示优化的语法引导进化搜索
Grammar-Guided Evolutionary Search for Discrete Prompt Optimisation
AI总结:
针对复杂任务和较小模型对提示设计敏感的挑战,提出一种两阶段语法引导进化搜索方法进行离散提示优化,在多个领域任务和较小模型上优于现有方法。
摘要:
提示工程已被证明是利用预训练大型语言模型(LLMs)解决各种现实任务的关键步骤。已有许多解决方案被提出,旨在通过使用模型本身来编辑提示,从而实现提示工程的自动化。然而,大多数最先进的方法都是在需要极少提示模板的任务上,以及在非常大且能力强的LLMs上进行评估的。相比之下,解决需要在提示中包含详细信息的复杂任务,会增加需要优化的文本量。此外,较小的模型已被证明对提示设计更为敏感。为了应对这些挑战,我们提出了一种用于自动离散提示优化的进化搜索方法,包含两个阶段。在第一阶段,调用语法引导的遗传编程,通过搜索由基于语法、基于字典和基于LLM的提示编辑函数的函数组合构成的程序空间,来合成创建提示的程序。在第二阶段,应用局部搜索来探索表现最佳程序的邻域,试图进一步微调其性能。我们的方法在四个特定领域的挑战性任务中,在三个相对较小的通用LLMs上,优于三种最先进的提示优化方法:PromptWizard、OPRO和RL-Prompt。我们还展示了几个例子,其中这些基准方法遭受了相对严重的性能下降,而我们的方法在几乎所有任务-模型组合中都提高了性能,仅在少数未提升的情况下产生极小的性能下降。
英文摘要:
Prompt engineering has proven to be a crucial step in leveraging pretrained large language models (LLMs) in solving various real-world tasks. Numerous solutions have been proposed that seek to automate prompt engineering by using the model itself to edit prompts. However, the majority of state-of-the-art approaches are evaluated on tasks that require minimal prompt templates and on very large and highly capable LLMs. In contrast, solving complex tasks that require detailed information to be included in the prompt increases the amount of text that needs to be optimised. Furthermore, smaller models have been shown to be more sensitive to prompt design. To address these challenges, we propose an evolutionary search approach to automated discrete prompt optimisation consisting of two phases. In the first phase, grammar-guided genetic programming is invoked to synthesise prompt-creating programmes by searching the space of programmes populated by function compositions of syntactic, dictionary-based and LLM-based prompt-editing functions. In the second phase, local search is applied to explore the neighbourhoods of best-performing programmes in an attempt to further fine-tune their performance. Our approach outperforms three state-of-the-art prompt optimisation approaches, PromptWizard, OPRO, and RL-Prompt, on three relatively small general-purpose LLMs in four domain-specific challenging tasks. We also illustrate several examples where these benchmark methods suffer relatively severe performance degradation, while our approach improves performance in almost all task-model combinations, only incurring minimal degradation when it does not.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。