演示笔记本:从交互中寻找最合适的上下文学习示例
Demonstration Notebook: Finding the Most Suited In-Context Learning Example from Interactions
AI总结:
本文提出“demonstration notebook”提示工程工作流,利用 LLM 历史交互为每个问题自动选择定制上下文演示,在推理、摘要和提示压缩任务上取得先进性能。
摘要:
大型语言模型(LLM)从提示工程中获益良多,而上下文学习正是其中一项关键技术。尽管以往方法已经提供了多种构建上下文学习所用演示的方式,但它们往往忽视数据集内部固有的异质性,对所有推理问题都应用相同的演示。我们观察到,演示的有效性会随具体问题而变化。这促使我们探索利用提示工程来选择合适的演示。为应对自动创建并选择针对每个问题定制的演示这一挑战,我们提出了一种新颖的提示工程工作流,其核心是一个名为“demonstration notebook(演示笔记本)”的新对象。该笔记本通过收集并复用 LLM 过往交互中的信息,帮助识别针对某个问题最合适的上下文学习示例。实验表明,据我们所知,该方法优于所有现有的自动演示构建与选择方法,并在多个推理基准上取得最先进结果。该方法在文本摘要和提示压缩任务上的成功进一步证明了其通用性。此外,我们还贡献了一种严谨的分析方法,用于揭示演示的“demonstrative regime(演示机制)”,为理解数据集中演示与不同问题类型之间的关系提供了宝贵洞见。
英文摘要:
Large language models (LLMs) benefit greatly from prompt engineering, with in-context learning standing as a pivital technique. While former approaches have provided various ways to construct the demonstrations used for in-context learning, they often ignore the inherent heterogeneity within datasets, applying the same demonstrations to all reasoning questions. We observed that the effectiveness of demonstrations varies depending on the specific question. This motivates our exploration of using prompt engineering to select appropriate demonstrations. To address the challenge of automatically creating and choosing demonstrations tailored to each question, we propose a novel prompt engineering workflow built around a novel object called the "demonstration notebook." This notebook helps identify the most suitable in-context learning example for a question by gathering and reusing information from the LLM's past interactions. Our experiments show that this approach outperforms all existing methods for automatic demonstration construction and selection (as far as we know), achieving state-of-the-art results on serveral reasoning benchmarks. The method's versatility is further demonstrated by its success in text summarization and prompt compression tasks. Additionally, we contribute a rigorous analysis method to reveal the "demonstrative regime" of a demonstration, providing valuable insights into how demonstrations relate to different question types within a dataset.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。