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

Zhuoshi Pan, Qianhui Wu, Huiqiang Jiang, Menglin Xia, Xufang Luo, Jue Zhang, Qingwei Lin, Victor Rühle, Yuqing Yang, Chin-Yew Lin, H. V. Zhao, Lili Qiu, Dongmei Zhang, K. Cobbe, Vineet Kosaraju, Mo Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano

arXiv:2403.12968 · 2026-07-27 공개 · arXiv · PDF

llm gsm8k longbench transformer-encoder prompt-compression token-classification data-distillation meetingbank

Abstract

This paper focuses on task-agnostic prompt compression for better generalizability and efficiency. Considering the redundancy in natural language, existing approaches compress prompts by removing tokens or lexical units according to their information entropy obtained from a causal language model such as LLaMa-7B. The challenge is that information entropy may be a suboptimal compression metric: (i) it only leverages unidirectional context and may fail to capture all essential information needed for prompt compression; (ii) it is not aligned with the prompt compression objective. To address these issues, we propose a data distillation procedure to derive knowledge from an LLM to compress prompts without losing crucial information, and meantime, introduce an extractive text compression dataset. We formulate prompt compression as a token classification problem to guarantee the faithfulness of the compressed prompt to the original one, and use a Transformer encoder as the base architecture to capture all essential information for prompt compression from the full bidirectional context. Our approach leads to lower latency by explicitly learning the compression objective with smaller models such as XLM-RoBERTa-large and mBERT. We evaluate our method on both in-domain and out-of-domain datasets, including MeetingBank, LongBench, ZeroScrolls, GSM8K, and BBH. Despite its small size, our model shows significant performance gains over strong baselines and demonstrates robust generalization ability across different LLMs. Additionally, our model is 3x-6x faster than existing prompt compression methods, while accelerating the end-to-end latency by 1.6x-2.9x with compression ratios of 2x-5x. Our code is available at https://aka.ms/LLMLingua-2.

한국어 요약

한 줄 요약

LLMLingua-2는 Transformer 기반의 데이터 디스틸레이션을 통해 2~5배 압축된 프롬프트를 생성하며, 기존 방법 대비 1.6~2.9배 빠른 처리 속도를 보인다.

핵심 기여도

핵심 아이디어

기존 프롬프트 압축 방법은 정보 엔트로피를 기반으로 토큰을 제거하지만, 이는 단방향 문맥만 고려하고 압축 목적과 정렬되지 않아 한계가 있다. LLMLingua-2는 이 문제를 해결하기 위해 **LLM에서 압축 지식을 추출하는 데이터 디스틸레이션 절차**를 도입했다. 프롬프트 압축을 **토큰 분류 문제**로 정의하여 원본 프롬프트의 신뢰성을 보장하고, **Transformer encoder**를 사용해 양방향 문맥 정보를 포착한다. 이는 기존의 단방향 모델(예: LLaMa-7B)보다 더 정확한 정보를 유지하면서도 처리 속도를 향상시킨다.

기술적 접근법

주요 결과

의의 및 한계

LLMLingua-2는 **소형 모델**로도 높은 압축 성능과 처리 속도를 달성하며, 다양한 LLM에 대한 **강력한 일반화 능력**을 보인다. 또한, **정보 손실 없는 압축 데이터셋**을 공개하여 연구 및 실용화에 기여한다. 그러나 **task-aware 압축 방법**(예: LongLLMlingua)에 비해 일부 벤치마크에서 성능이 낮은 것으로 나타나, 질문 정보를 활용하지 못하는 점이 한계로 지적된다.

실용적 활용

LLMLingua-2는 **RAG(Retrieval Augmented Generation)**, **대규모 문서 요약**, **멀티턴 대화 시스템** 등에서 유용하게 활용될 수 있다. 특히, **동일 문서를 여러 번 압축해야 하는 상황**에서는 효율성을 크게 높일 수 있다.