要約
トランスのコンテキストウィンドウは、アクティブメモリ用の前のトークンを保存するため、少数のショット学習や条件付き生成などのタスクに不可欠です。
ただし、コンテキストの長さが増加するにつれて、計算コストが二次的に増加し、実際の長いシーケンスシナリオでの大規模な言語モデル(LLM)の展開を妨げます。
いくつかの最近のキー価値キャッシュ(KVキャッシュ)メソッドは線形推論の複雑さを提供しますが、保存されたコンテキストを素朴に管理し、トークンを早期に排除し、貴重な情報を失います。
さらに、それらは最適化されたPrefill/Prompt Stage戦略を欠いており、現実的なコンテキストサイズの2次の注意よりも高いレイテンシをもたらします。
これに応じて、カスケードサブキャッシュバッファーを活用して最も関連性の高いトークンを選択的に保持する新しいメカニズムを導入し、モデルがキャッシュサイズを増やすことなくより長いコンテキスト履歴を維持できるようにします。
私たちのアプローチは、ストリーミングの困惑、質問の回答、本の要約、パスキー検索など、主要なベンチマーク全体の線形キャッシュベースラインを上回り、キャッシュサイズの65Kの4倍後の1Mトークンでより良い検索精度を保持します。
さらに、1Mトークンでのフラッシュの注意と比較した場合、私たちの方法は、Prefill段階のレイテンシを6.8倍に減らします。
これらのイノベーションは、LLMの計算効率を高めるだけでなく、リソース制約の環境での効果的な展開への道を開いて、大幅に低下した大規模でリアルタイムのアプリケーションを可能にします。
要約(オリジナル)
The transformer’s context window is vital for tasks such as few-shot learning and conditional generation as it preserves previous tokens for active memory. However, as the context lengths increase, the computational costs grow quadratically, hindering the deployment of large language models (LLMs) in real-world, long sequence scenarios. Although some recent key-value caching (KV Cache) methods offer linear inference complexity, they naively manage the stored context, prematurely evicting tokens and losing valuable information. Moreover, they lack an optimized prefill/prompt stage strategy, resulting in higher latency than even quadratic attention for realistic context sizes. In response, we introduce a novel mechanism that leverages cascading sub-cache buffers to selectively retain the most relevant tokens, enabling the model to maintain longer context histories without increasing the cache size. Our approach outperforms linear caching baselines across key benchmarks, including streaming perplexity, question answering, book summarization, and passkey retrieval, where it retains better retrieval accuracy at 1M tokens after four doublings of the cache size of 65K. Additionally, our method reduces prefill stage latency by a factor of 6.8 when compared to flash attention on 1M tokens. These innovations not only enhance the computational efficiency of LLMs but also pave the way for their effective deployment in resource-constrained environments, enabling large-scale, real-time applications with significantly reduced latency.
arxiv情報
| 著者 | Jeffrey Willette,Heejun Lee,Youngwan Lee,Myeongjae Jeon,Sung Ju Hwang |
| 発行日 | 2025-02-28 13:08:44+00:00 |
| arxivサイト | arxiv_id(pdf) |
提供元, 利用サービス
arxiv.jp, Google