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