GO TO A SECTION

↑ ↓ to navigate · Enter to openExplore all sections →
FDEInterviews logo
Findings of ACL 2024

LLMLingua-2: Data Distillation for Efficient and Faithful Task-Agnostic Prompt Compression

Compress prompts 2-5x with a small encoder that decides, word by word, what to keep, trained on GPT-4's deletions. Fast and faithful in domain; behind question-aware compression out of it.

Breakdown by FDE Interviews · 11 min read · Updated

About the original · 2024
AUTHORS
Pan, Wu, Jiang, Xia, et al.
FROM
Tsinghua University, Microsoft
PUBLISHED
Mar 2024 · Findings of ACL 2024
CITED BY
451Semantic Scholar · Oct 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 22% of this breakdown.

01

The paper in one minute

Prompts keep getting longer: retrieved documents, meeting transcripts, many examples. Prompt compression removes words a model does not need, saving cost and latency. Earlier methods such as LLMLingua and Selective-Context ranked tokens by information entropy, computed by a small causal model like LLaMA-2-7B: surprising tokens stay, predictable ones go. Zhuoshi Pan, Qianhui Wu, Huiqiang Jiang and colleagues at Tsinghua and Microsoft argue this is the wrong signal. Entropy is not the same as importance for an LLM, and a causal model sees only the words before each token.

LLMLingua-2 learns compression instead. First, data distillation: GPT-4 compresses MeetingBank transcripts under strict rules, remove unimportant words only; do not reorder, change, abbreviate or add words. Long transcripts are cut into chunks of up to 512 tokens first. Second, annotation: an algorithm aligns the compressed text with the original, with fuzzy matching and a bidirectional search to cope with GPT-4's slips, and labels every original word preserve or discard. Third, quality control: examples where GPT-4 introduced new words (high variation rate) or where the labels poorly reproduce GPT-4's compression (alignment gap) are filtered out.

The compressor is a token classifier on a bidirectional encoder, XLM-RoBERTa-large, or multilingual BERT for a smaller version. At run time it scores every word's probability of being kept, in one pass, and keeps the top fraction for the target ratio, in original order. It never generates text, so it cannot hallucinate, and it does not see the question, so one compressed version serves any downstream task.

With GPT-3.5-Turbo as the target model, LLMLingua-2 nearly matched the full prompt on MeetingBank questions at about 3x compression, beat entropy-based compressors on out-of-domain benchmarks (LongBench, ZeroSCROLLS, GSM8K, BBH), and transferred to Mistral-7B. It ran 3 to 6 times faster than earlier compressors, cut end-to-end latency 1.6 to 2.9 times, and used 2.1 GB of GPU memory against 16.6 GB for LLMLingua.

THE IDEA, VISUALLY
DISTILL, LABEL, TRAIN, CLASSIFY GPT-4 compresses delete words only: no adding, reordering or rephrasing Label each word keep or discard, by aligning with fuzzy matching Filter drop high variation-rate and alignment-gap examples Train encoder XLM-RoBERTa-large (or mBERT), token classification AT RUN TIME Score every word's keep probability in one bidirectional pass, keep the top τN words in original order. No LLM involved, so it is fast and cannot add words that were not there. It does not see the question: task-agnostic. Example from MeetingBank: “It was emotion, motion, a second and public comment. CNN. Please cast your vote.” → “Emotion, motion, second, public comment. Cast vote.” MEETINGBANK QA, IN DOMAIN (TABLE 1) Original, 3,003 tokens 87.75 LLMLingua-2, 3.1x 86.92 LLMLingua, 2.5x 67.52 Selective-Context, 2.5x 66.28 LONGBENCH AVERAGE, ≈5x (TABLE 2) LongLLMLingua (sees question) 48.0 Original, 10,295 tokens 44.0 LLMLingua-2 39.1 LLMLingua 34.6 Selective-Context 24.8 synthetic tasks: LLMLingua-2 21.3 vs original 37.8 COMPRESSOR TIME, MEETINGBANK, V100 (TABLE 5) LLMLingua-2 0.4-0.5 s LLMLingua (LLaMA-2-7B) 1.5-2.9 s Selective-Context 15.5-15.9 s End to end with GPT-3.5: 14.9 s uncompressed → 5.2 s at 5x. Peak GPU memory 2.1 GB against 16.6 GB for LLMLingua.
LLMLingua-2 learns from GPT-4's word deletions to classify each word as keep or drop, then keeps the most likely words up to a budget. It nearly matched the full prompt on meeting transcripts it was trained on, and ran several times faster than earlier compressors, but question-aware compression did better on long documents.
Research notes: the problem, approach and results
86.92 vs 87.75

MeetingBank QA exact match with GPT-3.5, LLMLingua-2 at 3.1x compression against the full 3,003-token prompt

0.4-0.5 s

compressor time on MeetingBank on a V100, against 1.5-2.9 s for LLMLingua and about 15.5 s for Selective-Context

39.1 vs 48.0

LongBench average at about 5x: LLMLingua-2 against the question-aware LongLLMLingua; the uncompressed prompt scored 44.0

THE PROBLEM

Long prompts are slow and expensive, and earlier compressors dropped tokens by information entropy from a small causal model, which reads only leftward context and does not target what an LLM actually needs. Task-aware methods must recompress for every question.

THE IDEA

Distill compression from GPT-4: have it shorten meeting transcripts by deleting words only, label each original word keep or discard, filter bad examples, and train a bidirectional encoder (XLM-RoBERTa-large) as a token classifier. Compress by keeping the highest-probability words.

THE RESULT

On MeetingBank QA it kept 86.92 exact match against 87.75 for the full prompt at about 3x compression. Out of domain it beat entropy-based compressors but trailed question-aware LongLLMLingua. It compressed 3-6x faster and cut end-to-end latency 1.6-2.9x.

02

Why it matters to an FDE

Prompt compression is one of the few levers that cuts both cost and latency without changing the model, and customers with long-context workloads (meeting notes, call transcripts, long retrieved passages) ask for it.

Extractive compression is safe in one way. The output contains only words from the input, in order. There is no paraphrase to hallucinate, which matters for regulated content and for traceability.

It is fast enough for the hot path. Half a second on a V100 for a meeting transcript, with a model that fits in about 2 GB, is cheap compared with the LLM call it shortens.

Task-agnostic has a price. Without the question, the compressor keeps what is generally important. On LongBench, question-aware LongLLMLingua scored 48.0 against 39.1, and the uncompressed prompt 44.0. If you know the question at compression time, use it.

Test on the customer's content. The compressor was trained on meeting transcripts only. It generalized reasonably, but tasks needing exact strings, codes or counts suffered: on LongBench's synthetic tasks it scored 21.3 against 37.8 uncompressed.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 99 more papers.

Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.

6 months · One payment · No auto-renewal

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦2 results tables
  • ?5 interview questions with answers
  1. 03Key takeaways

    The distillation pipeline, the classifier, the results by benchmark, and misreadings to avoid

    Free account
  2. 04How it works

    Distillation, annotation, quality filtering, the classifier and the compression procedure

    Premium
  3. 05The numbers that matter

    In-domain and out-of-domain results, speed, memory, and what the comparisons can carry

    Premium
  4. 06Try it yourself

    Train a tiny keep-or-drop classifier from teacher labels and compare it with entropy-based dropping

    Premium
  5. 07Where it breaks

    Limits of task-agnostic, extractive compression

    Premium
  6. 08Using it on a deployment

    Adding prompt compression to a customer pipeline and measuring its effect

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →