Fundamental Limits of Prompt Compression: A Rate-Distortion Framework for Black-Box Language Models

Alliot Nagle, Adway Girish, Marco Bondaschi, Michael Gastpar, Ashok Vardhan Makkuva +1 more
7/22/2024
cs.LGcs.CLcs.IT

No confident code implementation found for this paper.

Abstract

We formalize the problem of prompt compression for large language models (LLMs) and present a framework to unify token-level prompt compression methods which create hard prompts for black-box models. We derive the distortion-rate function for this setup as a linear program, and provide an efficient algorithm to compute this fundamental limit via the dual of the linear program. Using the distortion-rate function as the baseline, we study the performance of existing compression schemes on a synthetic dataset consisting of prompts generated from a Markov chain, natural language queries, and their respective answers. Our empirical analysis demonstrates the criticality of query-aware prompt compression, where the compressor has knowledge of the downstream task/query for the black-box LLM. We show that there is a large gap between the performance of current prompt compression methods and the optimal strategy, and propose Adaptive QuerySelect, a query-aware, variable-rate adaptation of a prior work to close the gap. We extend our experiments to a small natural language dataset to further confirm our findings on our synthetic dataset.

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. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

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

Similar Papers

Cite this paper

@article{nagle2024fundamental,
  title  = {Fundamental Limits of Prompt Compression: A Rate-Distortion Framework for Black-Box Language Models},
  author = {Alliot Nagle and Adway Girish and Marco Bondaschi and Michael Gastpar and Ashok Vardhan Makkuva and Hyeji Kim},
  year   = {2024},
  eprint = {2407.15504},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2407.15504},
  url    = {http://arxiv.org/abs/2407.15504v2},
  journal = {NEURIPS 2024 2024}
}

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/2407.15504.svg)](https://codeofpaper.com/paper/2407.15504)

Discussion