Prompt Sketching for Large Language Models

Luca Beurer-Kellner, Mark Niklas Müller, Marc Fischer, Martin Vechev
11/8/2023
cs.CLcs.AI

No confident code implementation found for this paper. 4 possible matches can be shown below.

Abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 4 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Cite this paper

@article{beurerkellner2023prompt,
  title  = {Prompt Sketching for Large Language Models},
  author = {Luca Beurer-Kellner and Mark Niklas Müller and Marc Fischer and Martin Vechev},
  year   = {2023},
  eprint = {2311.04954},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2311.04954v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2311.04954.svg)](https://codeofpaper.com/paper/2311.04954)

Discussion