[论文解读] Prompt Engineering a Prompt Engineer
PE2 构建了一个元提示,用以引导 LLM 进行自动提示工程,在提示质量方面优于先前基线,并在数学推理基准上超过零样本 CoT。它在反事实任务和生产提示中显示出强劲表现,且提示编辑具有可解释性。
Prompt engineering is a challenging yet crucial task for optimizing the performance of large language models on customized tasks. It requires complex reasoning to examine the model's errors, hypothesize what is missing or misleading in the current prompt, and communicate the task with clarity. While recent works indicate that large language models can be meta-prompted to perform automatic prompt engineering, we argue that their potential is limited due to insufficient guidance for complex reasoning in the meta-prompt. We fill this gap by infusing into the meta-prompt three key components: detailed descriptions, context specification, and a step-by-step reasoning template. The resulting method, named PE2, exhibits remarkable versatility across diverse language tasks. It finds prompts that outperform "let's think step by step" by 6.3% on MultiArith and 3.1% on GSM8K, and outperforms competitive baselines on counterfactual tasks by 6.9%. Further, we show that PE2 can make targeted and highly specific prompt edits, rectify erroneous prompts, and induce multi-step plans for complex tasks.
研究动机与目标
- 将自动提示工程动员为一个需要结构化指导的复杂推理任务。
- 开发一个元提示(PE2),其组件能引出逐步推理和用于提示工程的上下文。
- 将口头化的优化概念(批量大小、步长、动量)融入元提示,以指导提示提案。
- 在数学推理数据集、反事实任务和生产提示上评估 PE2 以评估其通用性。
- 将 PE2 与基线自动提示工程方法以及人类影响的初始设置进行比较。
提出的方法
- 将提示工程框定为一个优化问题,目标是找到能最大化开发集性能的提示。
- 引入元提示组件:逐步推理模板、上下文规范和两步任务描述。
- 将优化器启发的概念(批量大小、步长、动量)融入元提示并测试变体。
- 使用提示提案模型从失败中生成新提示,并应用带有 top-k 选择的回溯搜索。
- 使用 GPT-4 作为提案模型,text-davinci-003 作为任务模型,在多个数据集和设置上进行评估。
- 进行消融实验,以评估每个元提示组件和初始化策略的影响。
实验结果
研究问题
- RQ1定制用于提示工程的元提示是否能在自动提示生成方面优于现有基线?
- RQ2元提示的哪些组件能最有效提升所提出提示的质量?
- RQ3相较于先前的自动提示工程方法,PE2 在数学推理基准和反事实任务中的表现如何?
- RQ4PE2 在生产提示与现实世界的长提示上是否稳健?
- RQ5在当前 LLM 能力下,PE2 存在哪些局限性和失败模式?
主要发现
- 在以 text-davinci-003 作为任务模型时,PE2 在 MultiArith 上比零-shot 链式推理提示高出 6.3 个百分点,在 GSM8K 上高出 3.1 个百分点。
- PE2 在多种设定和任务中超过 Iterative APE 与 APO 基线。
- 三个元提示组件(两步任务描述、逐步推理模板、上下文规范)显著提升提示工程质量并降低方差。
- PE2 在反事实任务和优化冗长生产提示方面表现强劲。
- PE2 能生成有针对性的提示编辑,修正错误或不完整的提示,有时还能推导出新颖但部分正确的反事实规则。
- 初始化质量对 PE2 的表现影响显著,基于归纳的初始化能达到具有竞争力的结果。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。