paper-with-me

홈 › Papers

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

2024-03-19 · Zhuoshi Pan, Qianhui Wu, Huiqiang Jiang, Menglin Xia, Xufang Luo, Jue Zhang, QIngwei Lin, Victor Rühle, Yuqing Yang, Chin-Yew Lin, H. Vicky Zhao, Lili Qiu, Dongmei Zhang

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.

📄 PDF Abstract BibTeX arXiv:2403.12968

Code (1)

microsoft/LLMLingua 공식 구현 pytorch

Tasks

GSM8KLanguage ModellingText Compressiontoken-classificationToken Classification

Methods 이 논문이 사용한 방법론

Attention 설명 없음
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Absolute Position Encodings Absolute Position Encodings are a type of position embeddings for [Transformer-based models] where positional encodings are…
Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Layer Normalization Unlike batch normalization, Layer Normalization directly estimates the normalization statistics from the summed inputs…
Multi-Head Attention 설명 없음
Dropout Dropout is a regularization technique for neural networks that drops a unit (along with connections) at training time with a specified probability $p$ (a common value is…
Residual Connection 설명 없음

Similar Papers 제목 키워드 기반

LongLLMLingua: Accelerating and Enhancing LLMs in Long Context Scenarios via Prompt Compression

2023-10-10 · Huiqiang Jiang, Qianhui Wu, Xufang Luo, Dongsheng Li 외

In long context scenarios, large language models (LLMs) face three main challenges: higher computational cost, performance reduction, and position bias. Research indicates that LLM performance hinges on the density and p…

Code CompletionFew-Shot LearningPosition

LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Models

2023-10-09 · Huiqiang Jiang, Qianhui Wu, Chin-Yew Lin, Yuqing Yang 외

Large language models (LLMs) have been applied in various applications due to their astonishing capabilities. With advancements in technologies such as chain-of-thought (CoT) prompting and in-context learning (ICL), the …

GSM8KIn-Context Learning

Task-agnostic Distillation of Encoder-Decoder Language Models

2023-05-21 · Chen Zhang, Yang Yang, Jingang Wang, Dawei Song

Finetuning pretrained language models (LMs) have enabled appealing performance on a diverse array of tasks. The intriguing task-agnostic property has driven a shifted focus from task-specific to task-agnostic distillatio…

Abstractive Text SummarizationDecoder

EFPC: Towards Efficient and Flexible Prompt Compression

2025-03-11 · Yun-Hao Cao, Yangsong Wang, Shuzheng Hao, Zhenxing Li 외

The emergence of large language models (LLMs) like GPT-4 has revolutionized natural language processing (NLP), enabling diverse, complex tasks. However, extensive token counts lead to high computational and financial bur…

Telegraph English: Semantic Prompt Compression via Structured Symbolic Rewriting

2026-05-06 · Mikhail L. Arbuzov, Sisong Bei, Ziwei Dong, Dmitri Kalaev 외 arxiv

We introduce Telegraph English (TE), a prompt-compression protocol that rewrites natural language into a symbol-rich, formally-structured dialect. Where token-deletion methods such as LLMLingua-2 train a classifier to de…