LLMLingua-2: 작업에 구애받지 않는 효율적이고 충실한 프롬프트 압축을 위한 데이터 증류
LLMLingua-2: Data Distillation for Efficient and Faithful Task-Agnostic Prompt Compression
March 19, 2024
저자: 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
cs.AI
초록
본 논문은 더 나은 일반화와 효율성을 위한 작업에 구애받지 않는 프롬프트 압축에 초점을 맞춥니다. 자연어의 중복성을 고려할 때, 기존 접근법은 LLaMa-7B와 같은 인과적 언어 모델에서 얻은 정보 엔트로피를 기반으로 토큰이나 어휘 단위를 제거하여 프롬프트를 압축합니다. 그러나 정보 엔트로피는 최적의 압축 지표가 아닐 수 있는 문제가 있습니다: (i) 단방향 컨텍스트만 활용하여 프롬프트 압축에 필요한 모든 필수 정보를 포착하지 못할 수 있으며, (ii) 프롬프트 압축 목표와 일치하지 않습니다.
이러한 문제를 해결하기 위해, 우리는 중요한 정보를 잃지 않고 프롬프트를 압축하기 위해 대형 언어 모델(LLM)로부터 지식을 추출하는 데이터 증류 절차를 제안하고, 동시에 추출적 텍스트 압축 데이터셋을 소개합니다. 프롬프트 압축을 토큰 분류 문제로 공식화하여 압축된 프롬프트가 원본 프롬프트에 충실하도록 보장하며, 양방향 컨텍스트에서 프롬프트 압축에 필요한 모든 필수 정보를 포착하기 위해 Transformer 인코더를 기본 아키텍처로 사용합니다. 우리의 접근 방식은 XLM-RoBERTa-large 및 mBERT와 같은 더 작은 모델로 압축 목표를 명시적으로 학습함으로써 더 낮은 지연 시간을 달성합니다.
우리는 MeetingBank, LongBench, ZeroScrolls, GSM8K, BBH를 포함한 도메인 내 및 도메인 외 데이터셋에서 우리의 방법을 평가합니다. 우리의 모델은 작은 크기에도 불구하고 강력한 베이스라인 대비 상당한 성능 향상을 보이며, 다양한 LLM에 걸쳐 견고한 일반화 능력을 입증합니다. 또한, 우리의 모델은 기존 프롬프트 압축 방법보다 3배에서 6배 빠르며, 2배에서 5배의 압축 비율로 엔드투엔드 지연 시간을 1.6배에서 2.9배 단축합니다.
English
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.Summary
AI-Generated Summary