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, Hyeji Kim
TL;DR
This work formulates prompt compression for black-box LLMs as a rate-distortion problem, introducing the distortion-rate function $D^*(R)$ as the fundamental limit and deriving a dual linear-program to compute it. It distinguishes query-agnostic and query-aware compression, develops a practical algorithm to solve the dual RD problem, and demonstrates that query-awareness substantially narrows the gap to the theoretical limit. On synthetic data, the proposed Adaptive QuerySelect achieves the best performance and often matches or outperforms the optimal query-aware strategy, highlighting the value of variable-rate compression. Experiments on small natural-language datasets and beam-search-based approximations for larger data validate the framework and show meaningful gains from query-aware prompting, with implications for reducing prompt length while preserving downstream performance.
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.
