高效且准确的提示优化:示例引导反思中记忆的益处
Efficient and Accurate Prompt Optimization: the Benefit of Memory in Exemplar-Guided Reflection
AI总结:
提出带有记忆机制的示例引导反思(ERM),利用历史反馈和两种记忆改进示例检索,实现更高效准确的提示优化,在LIAR上F1提升10.1,在ProTeGi上步骤减半。
摘要:
自动提示工程旨在提升大型语言模型(LLMs)的生成质量。近期工作利用错误案例生成的反馈来引导提示优化。在推理过程中,它们可能进一步检索若干语义相关的示例,并将其拼接至优化后的提示中以提升性能。然而,这些工作仅利用当前步骤的反馈,忽略了历史上未被选择的、可能有益的反馈。此外,示例的选择仅考虑一般语义关系,在任务性能和与优化提示的匹配方面可能并非最优。在本工作中,我们提出一种带有记忆机制的示例引导反思(ERM),以实现更高效且准确的提示优化。具体而言,我们设计了一种示例引导的反思机制,其中反馈生成额外由生成的示例引导。我们进一步构建两种记忆,以充分利用历史反馈信息并支持更有效的示例检索。实证评估表明,我们的方法以更少的优化步骤超越了先前的最先进方法,即在LIAR数据集上将F1分数提高了10.1,并在ProTeGi上将优化步骤减少了一半。
英文摘要:
Automatic prompt engineering aims to enhance the generation quality of large language models (LLMs). Recent works utilize feedbacks generated from erroneous cases to guide the prompt optimization. During inference, they may further retrieve several semantically-related exemplars and concatenate them to the optimized prompts to improve the performance. However, those works only utilize the feedback at the current step, ignoring historical and unseleccted feedbacks which are potentially beneficial. Moreover, the selection of exemplars only considers the general semantic relationship and may not be optimal in terms of task performance and matching with the optimized prompt. In this work, we propose an Exemplar-Guided Reflection with Memory mechanism (ERM) to realize more efficient and accurate prompt optimization. Specifically, we design an exemplar-guided reflection mechanism where the feedback generation is additionally guided by the generated exemplars. We further build two kinds of memory to fully utilize the historical feedback information and support more effective exemplar retrieval. Empirical evaluations show our method surpasses previous state-of-the-arts with less optimization steps, i.e., improving F1 score by 10.1 on LIAR dataset, and reducing half of the optimization steps on ProTeGi.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。