SelfCP: Compressing Long Prompt to 1/12 Using the Frozen Large Language Model Itself

要約

大規模言語モデル (LLM) を使用する場合、プロンプトが長いとハードウェアのコストが膨大になります。
残念ながら、要約などの多くのタスクでは必然的に長いタスク入力が発生し、コンテキスト内学習の幅広い適用により、プロンプトの長さは簡単に爆発的に長くなります。
この論文は、LLM の言語理解能力に触発されて、LLM \textbf{itself} を使用して、長い \textbf{P}rompt を \textbf{C}ompress してコンパクトな仮想トークンに変換する SelfCP を提案します。
SelfCP は、一般的なフリーズ LLM を 2 回適用します。最初はプロンプトを圧縮するエンコーダーとして、次に応答を生成するデコーダーとして適用します。
具体的には、長いプロンプトが与えられた場合、圧縮のために長いセグメント内に特別なトークンを配置し、$k$ 仮想トークンを生成するように LLM に信号を送ります。
その後、仮想トークンは圧縮されていないプロンプトと連結され、同じ LLM に供給されて応答が生成されます。
一般に、SelfCP はプロンプトの無条件および条件付き圧縮を容易にし、標準タスクと特定の目的を持つタスクの両方に適合します。
エンコーダとデコーダがフリーズされているため、SelfCP には 17M のトレーニング可能なパラメータのみが含まれており、さまざまなバックボーンにわたって便利に適応できます。
2 つの LLM バックボーンを使用して SelfCP を実装し、ドメイン内とドメイン外の両方のタスクで評価します。
結果は、圧縮された仮想トークンが $12 \times$ 大きい元のプロンプトを効果的に置き換えることができることを示しています

要約(オリジナル)

Long prompt leads to huge hardware costs when using Large Language Models (LLMs). Unfortunately, many tasks, such as summarization, inevitably introduce long task-inputs, and the wide application of in-context learning easily makes the prompt length explode. Inspired by the language understanding ability of LLMs, this paper proposes SelfCP, which uses the LLM \textbf{itself} to \textbf{C}ompress long \textbf{P}rompt into compact virtual tokens. SelfCP applies a general frozen LLM twice, first as an encoder to compress the prompt and then as a decoder to generate responses. Specifically, given a long prompt, we place special tokens within the lengthy segment for compression and signal the LLM to generate $k$ virtual tokens. Afterward, the virtual tokens concatenate with the uncompressed prompt and are fed into the same LLM to generate the response. In general, SelfCP facilitates the unconditional and conditional compression of prompts, fitting both standard tasks and those with specific objectives. Since the encoder and decoder are frozen, SelfCP only contains 17M trainable parameters and allows for convenient adaptation across various backbones. We implement SelfCP with two LLM backbones and evaluate it in both in- and out-domain tasks. Results show that the compressed virtual tokens can substitute $12 \times$ larger original prompts effectively

arxiv情報

著者 Jun Gao
発行日 2024-05-27 11:14:55+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.CL パーマリンク