arXiv:2507.10326cs.CL2025-07中稿 · Publication at ECA…被引 2

用语法引导的进化搜索优化离散提示,提升小模型在复杂任务中的表现。

Grammar-Guided Evolutionary Search for Discrete Prompt Optimisation

  • 通过语法引导的遗传编程生成提示构造程序,自动组合多种编辑函数。
  • 在4个领域任务中超越3种主流方法,在小模型上性能更稳定。
  • 适合需要精细提示设计的小型语言模型应用场景。

提示工程是利用预训练大语言模型解决现实任务的关键步骤。尽管已有大量自动化提示工程的方法,但多数工作仅在需极少模板的任务和大型高能力模型上评估。而复杂任务需在提示中包含更多细节,且小型模型对提示设计更敏感。为此,本文提出一种两阶段的进化搜索方法:第一阶段采用语法引导的遗传编程,从语法、词典和LLM-based提示编辑函数的组合空间中搜索提示生成程序;第二阶段对最优程序进行局部搜索以进一步优化。实验显示,该方法在三个较小通用模型上,于四个领域特定挑战任务中优于PromptWizard、OPRO和RL-Prompt。基准方法在部分场景下性能显著下降,而本方法几乎在所有任务-模型组合中均有提升,仅极少数情况有轻微退化。

原文摘要 · Abstract (English)

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.

提示优化进化算法小模型

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