Learning to Compress Prompts with Gist Tokens

By Jesse Mu, Xiang Lisa Li, Noah D. Goodman. 2023

409 citations recorded by the source corpus.

Prompting is the primary way to utilize the multitask capabilities of language models (LMs), but prompts occupy valuable space in the input context window, and repeatedly encoding the same prompt is computationally inefficient. Finetuning and distillation methods allow for specialization of LMs without prompting, but require retraining the model for each task. To avoid this trade-off entirely, we present gisting, which trains an LM to compress prompts into smaller sets of"gist"tokens which can be cached and reused for compute efficiency. Gist models can be trained with no additional cost over standard instruction finetuning by simply modifying Transformer attention masks to encourage prompt compression. On decoder (LLaMA-7B) and encoder-decoder (FLAN-T5-XXL) LMs, gisting enables up to 26x compression of prompts, resulting in up to 40% FLOPs reductions, 4.2% wall time speedups, and storage savings, all with minimal loss in output quality.

Subfields: Artificial Intelligence, Electrical and Electronic Engineering, Prompting & Reasoning, Efficiency & Compression

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Yejin Choi
  2. Mohit Bansal
  3. Martin Jaggi
  4. Percy Liang
  5. Ximing Lu
  6. Chandra Bhagavatula
  7. Luke S. Zettlemoyer
  8. Kai-Wei Chang

In Electrical and Electronic Engineering

  1. Noah D. Goodman
  2. Amirkeivan Mohtashami
  3. Yejin Choi
  4. Christopher R'e
  5. Martin Jaggi
  6. Zhangyang Wang
  7. Yuandong Tian
  8. Beidi Chen

In Prompting & Reasoning

  1. Yejin Choi
  2. Chandra Bhagavatula
  3. Nick Haber
  4. Eric Zelikman
  5. Ximing Lu
  6. Noah D. Goodman
  7. Kai-Wei Chang
  8. Yijia Shao

In Efficiency & Compression

  1. Martin Jaggi
  2. Amirkeivan Mohtashami
  3. Yuandong Tian
  4. Noah D. Goodman
  5. Yejin Choi
  6. Chandra Bhagavatula
  7. Clark W. Barrett
  8. Zhenyu (Allen) Zhang

Citations in the corpus