XC-Cache: Cross-Attending to Cached Context for Efficient LLM Inference

要約

インコンテキスト学習 (ICL) アプローチは通常、プロンプトを活用して、参照情報に基づいてデコーダ専用言語モデルの生成を条件付けします。
コンテキストのジャストインタイム処理は、セルフアテンション操作の二次コストにより非効率であるため、キャッシュが望ましいです。
ただし、トランスフォーマーの状態をキャッシュするには、モデル パラメーターとほぼ同じ量のスペースが必要になる場合があります。
適切なコンテキストが事前にわからない場合、ICL をキャッシュするのは困難になる可能性があります。
この研究では、エンコーダ/デコーダ アーキテクチャにインスピレーションを得て、プロンプトなしで参照テキストの条件生成にクロスアテンションを使用するモデルを導入することで、これらの制限に対処しています。
より正確には、事前トレーニングされたデコーダー専用モデルを活用し、少数の追加レイヤーのみをトレーニングします。
私たちは質問応答 (QA) をテストベッドとして使用して、条件付き生成を実行するモデルの能力を評価し、ICL よりも優れたパフォーマンスを示し、微調整されたプロンプト LLM に匹敵し、標準の KV キャッシュと比較してスペース フットプリントを大幅に削減することを観察しました。
二桁の大きさ。

要約(オリジナル)

In-context learning (ICL) approaches typically leverage prompting to condition decoder-only language model generation on reference information. Just-in-time processing of a context is inefficient due to the quadratic cost of self-attention operations, and caching is desirable. However, caching transformer states can easily require almost as much space as the model parameters. When the right context isn’t known in advance, caching ICL can be challenging. This work addresses these limitations by introducing models that, inspired by the encoder-decoder architecture, use cross-attention to condition generation on reference text without the prompt. More precisely, we leverage pre-trained decoder-only models and only train a small number of added layers. We use Question-Answering (QA) as a testbed to evaluate the ability of our models to perform conditional generation and observe that they outperform ICL, are comparable to fine-tuned prompted LLMs, and drastically reduce the space footprint relative to standard KV caching by two orders of magnitude.

arxiv情報

著者 João Monteiro,Étienne Marcotte,Pierre-André Noël,Valentina Zantedeschi,David Vázquez,Nicolas Chapados,Christopher Pal,Perouz Taslakian
発行日 2024-04-23 18:10:42+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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