Can prompts be compressed without losing model performance?
Explores whether strategic removal of redundant tokens from long prompts can substantially reduce inference costs while preserving accuracy on reasoning and knowledge tasks.
LLMLingua is a "coarse-to-fine prompt compression method" built to cut the cost of inference when prompts have grown "increasingly lengthy, even exceeding tens of thousands of tokens" from chain-of-thought and in-context learning. Tested on GSM8K, BBH, ShareGPT, and Arxiv-March23, it "achieves state-of-the-art performance across all datasets, with up to 20x compression with only a 1.5 point performance drop," and the paper reports LLMs "can effectively restore compressed prompts" from the output.
The mechanism has three parts. A budget controller first splits the compression ratio unevenly across a prompt's instruction, demonstrations, and question, on the reasoning that "the instruction and the question in a prompt have a direct influence on the generated results" while "multiple demonstrations... may be redundant" — so demonstrations absorb more compression, instructions and questions less. At the demonstration level this is coarse-grained: a small model such as GPT-2 or LLaMA scores each demonstration's perplexity and lower-information ones are dropped whole, preserving "a certain degree of linguistic integrity" rather than discarding scattered tokens. A second, token-level pass then prunes within what remains, modeling "the interdependence between compressed contents" to improve on Selective-Context's independence assumption, which the paper likens to "the shortcomings of the Mask Language Model." Because the small scoring model and the target black-box LLM see language differently, an instruction-tuning step aligns the small model's distribution to the target's — all "without any gradient flow through the LLMs," so the method works through APIs alone.
This sits alongside other token-economy approaches already in the vault, but compresses a different object. Can minimal reasoning chains match full explanations? shrinks the tokens a model generates during reasoning; LLMLingua shrinks the tokens fed in before generation starts — complementary targets for the same inference-cost problem. Can models think longer by forgetting intermediate reasoning? shares LLMLingua's premise that token informativeness is uneven, but applies it to live generation memory rather than a fixed prompt. And where Can thinking traces be made reliably budget-controllable? reaches for RL reward shaping to keep compression controllable, LLMLingua gets budget control from an explicit allocation rule and perplexity scoring instead, with no reward signal or fine-tuning of the target model at all.
The excerpt gives compression ratios and accuracy-point drops, not dollar costs or latency numbers — the inference-cost savings are an inference from fewer tokens being sent to a metered API, not a measured cost figure. It also names a real ceiling: "a notable performance drop when trying to achieve excessively high compression ratios such as 25x-30x on GSM8K," and flags that mismatched tokenizers between the small and target models "may result in an underestimation of the prompt's token length." So the 20x figure should be read as a validated-but-task-dependent ceiling, not a general compression rate, and its cost benefit is strongest where API pricing scales directly with input tokens.
Inquiring lines that read this note 24
This note is a source for these research framings, grouped by the broader line of inquiry each explores. Scan the bold lines of inquiry; follow any specific question forward.
How can language models effectively manage long-context memory without quality degradation?- Why are long-context workloads most vulnerable to compute shortages?
- Can compressed context distilled into smaller models preserve teacher performance reliably?
- Why do long-context inputs truncated for relevance lose cache reuse benefits?
- What efficiency gains could prevent an inference compute bottleneck?
- Does inference demand for memory-hungry accelerators explain the shift toward memory-dominant bills of materials?
- Are inference speed and context length also within parity on consumer GPU hardware?
- How do architectural changes affect inference efficiency independent of model size?
- How much of token demand growth comes from context length versus user volume?
- Why does context pruning and tool summarization break cached prompt representations?
- Do cache benefits hold with different system prompt sizes and tool counts?
- What makes prompt rephrasing expose brittleness in deployed agents?
- Can compression aggressiveness be set automatically for new environments without benchmark testing?
- Does environment noise level affect how aggressively agents should compress context?
- How much do typical users actually save from declining AI inference costs?
- Can inference demand itself change based on model price and speed?
- Does building inference infrastructure differ economically from building AI applications?
- Could correcting information gaps reduce spending on expensive closed AI models?
Related concepts in this collection 5
This note in its neighbourhood — explore the map, then jump to a related concept in the list below.
Click a node to walk · click center to open · click Open in graph to see this note in the full knowledge graph
-
Can minimal reasoning chains match full explanations?
Does removing all explanatory text from chain-of-thought reasoning preserve accuracy? This tests whether verbose intermediate steps are necessary for solving problems or just artifacts of how language models are trained.
same token-cost goal but compresses generated reasoning tokens rather than the input prompt
-
Can models think longer by forgetting intermediate reasoning?
Does discarding reasoning tokens outside a fixed prefix and recent window let language models extend their thinking horizon without ballooning memory costs? This matters for scaling test-time compute efficiently.
shares the premise that token informativeness is uneven, applied to generation memory instead of a fixed prompt
-
Can text-trained models compress images better than specialized tools?
Do general-purpose language models trained only on text outperform domain-specific compressors like PNG and FLAC on their native data? This tests whether compression ability is universal or requires domain specialization.
shares the natural-language-is-redundant premise, but treats the model as the compressor rather than the prompt as the compressible object
-
Can thinking traces be made reliably budget-controllable?
Raw thinking traces compress well but ignore budget targets and take shortcuts. Can reward optimization make them controllable and useful for deployment?
contrasting mechanism: budget control from an explicit allocation rule and small-model perplexity instead of RL reward shaping
-
Can a reasoning model's thinking trace compress context effectively?
Does the raw reasoning trace produced by a thinking model naturally function as a context compressor without specialized training or modules? And how does this compare to dedicated compression methods?
qualifies A's dedicated compression approach: raw reasoning traces alone outperform most dedicated context-compression methods
Related papers in this collection 8
Papers most semantically related to this note, ranked by cosine similarity in the embedding space.
- LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Models
- Do LLMs Encode Functional Importance of Reasoning Tokens?
- Inference-Aware Prompt Optimization for Aligning Black-Box Large Language Models
- Thinking as Compression: Your Reasoning Model is Secretly a Context Compressor
- Recursive Language Models
- A Human-Inspired Reading Agent with Gist Memory of Very Long Contexts
- ACON: Optimizing Context Compression for Long-horizon LLM Agents
- Automatic Prompt Optimization with "Gradient Descent" and Beam Search
Original note title
allocating more compression budget to instructions and questions than demonstrations lets prompts compress up to 20x with a 1.5-point performance drop