Prompt Sketching for Large Language Models

📄 arXiv: 2311.04954v1 📥 PDF

作者: Luca Beurer-Kellner, Mark Niklas Müller, Marc Fischer, Martin Vechev

分类: cs.CL, cs.AI

发布日期: 2023-11-08


💡 一句话要点

提出提示草图以解决大语言模型生成过程中的连贯性问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大语言模型 提示策略 生成模型 自然语言处理 推理框架 实验评估 智能问答 对话生成

📋 核心要点

  1. 现有的提示策略在生成过程中缺乏连贯性,导致中间结果冗长且不够有效。
  2. 提出的提示草图允许模型在生成过程中预测多个变量的值,从而增强用户对生成过程的控制。
  3. 实验结果显示,提示草图在多个基准任务中表现优于传统的顺序提示方法,提升效果显著。

📝 摘要(中文)

许多近期的大语言模型(LLMs)提示策略通过多次顺序查询模型,首先生成中间结果,然后得出最终答案。然而,这些方法使得解码器和模型无法预见后续提示,导致中间响应不连贯且冗长。本文提出了一种新的提示范式——提示草图,允许LLM不仅通过完成提示来响应,还能预测模板中多个变量的值。这种方式使用户在生成过程中拥有更多控制权,通过中间指令提供推理框架,从而获得更好的整体结果。实验表明,在零-shot设置下,提示草图在8个LLM基准任务中有7个超越了现有的顺序提示方案,如直接提问或思维链。

🔬 方法详解

问题定义:本文旨在解决现有大语言模型提示策略中生成过程的连贯性不足问题。现有方法通常依赖于多次顺序查询,导致中间结果不够紧凑和有效。

核心思路:提示草图的核心思想是让模型在生成文本时,不仅完成当前提示,还能预测多个变量的值。这种设计使得模型能够考虑后续提示,从而优化生成过程。

技术框架:整体架构包括一个适应性解码过程,该过程在文本生成时同时评分后续指令。主要模块包括输入提示、变量预测和最终输出生成。

关键创新:最重要的技术创新在于通过调整解码过程,使得模型能够在生成时优化整体模板的可能性。这与传统的逐步生成方法本质上不同,后者无法考虑后续提示的影响。

关键设计:在实现中,关键参数设置包括解码器的评分机制和损失函数的设计,以确保模型能够有效地整合多个变量的预测。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,提示草图在7个基准任务中超越了现有的顺序提示方案,尤其在状态跟踪、算术推理和一般问答任务中表现突出。这一方法在零-shot设置下的有效性显示出其在实际应用中的巨大潜力。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理、智能问答系统和对话生成等。通过提供更连贯的生成结果,提示草图能够提升用户体验,并在教育、客服等多个行业中发挥重要作用。未来,该方法可能会影响大语言模型的设计和应用,推动更智能的交互系统的发展。

📄 摘要(原文)

Many recent prompting strategies for large language models (LLMs) query the model multiple times sequentially -- first to produce intermediate results and then the final answer. However, using these methods, both decoder and model are unaware of potential follow-up prompts, leading to disconnected and undesirably wordy intermediate responses. In this work, we address this issue by proposing prompt sketching, a new prompting paradigm in which an LLM does not only respond by completing a prompt, but by predicting values for multiple variables in a template. This way, sketching grants users more control over the generation process, e.g., by providing a reasoning framework via intermediate instructions, leading to better overall results. The key idea enabling sketching with existing, autoregressive models is to adapt the decoding procedure to also score follow-up instructions during text generation, thus optimizing overall template likelihood in inference. Our experiments show that in a zero-shot setting, prompt sketching outperforms existing, sequential prompting schemes such as direct asking or chain-of-thought on 7 out of 8 LLM benchmarking tasks, including state tracking, arithmetic reasoning, and general question answering. To facilitate future use, we release a number of generic, yet effective sketches applicable to many tasks, and an open source library called dclib, powering our sketch-aware decoders.