Long-Context Inference with Retrieval-Augmented Speculative Decoding

要約

ロングコンテキストの大規模な言語モデル(LLMS)の出現は、広範なドキュメントを処理するための従来の検索高等世代(RAG)の有望な代替手段を提供します。
ただし、特にキー価値(kV)キャッシュの管理における長いコンテキスト推論の計算オーバーヘッドは、重要な効率の課題を示しています。
投機的デコード(SD)は従来、より小さなドラフトモデルを使用して推論を加速しますが、その有効性は、メモリに縛られたKVキャッシュ操作により、長いコンテキストシナリオで大幅に減少します。
検索された選択的解体(Rapid)を提示します。これは、長いコンテキスト推論における生成品質の加速と向上の両方にRAGを活用します。
Rapidは、長いコンテキストターゲットLLMの生成を推測するために、短縮された検索コンテキストで動作するドラフトLLMのRAG Drafter-Aドラフトを導入します。
私たちのアプローチにより、計算効率を維持しながら、同じスケールまたはさらに大きなLLMがラグドラフトとして機能する新しいパラダイムが可能になります。
潜在的に優れた能力を強力なragドラフトから完全に活用するために、ターゲット分布をRAGで濃縮する推論時間知識転送ダイナミックを開発します。
Llama-3.1およびQwen2.5バックボーンでの広範な実験は、2倍以上のスピードアップで、Llama-3.1-8bのInfinitebenchで39.33から42.83までの大幅なパフォーマンスの改善を達成し、両方のアプローチの強さを迅速に統合することを示しています。
私たちの分析では、迅速なものが32Kコンテキストの長さを超える堅牢な加速を達成し、現実世界のアプリケーションで優れた生成品質を実証することが明らかになりました。

要約(オリジナル)

The emergence of long-context large language models (LLMs) offers a promising alternative to traditional retrieval-augmented generation (RAG) for processing extensive documents. However, the computational overhead of long-context inference, particularly in managing key-value (KV) caches, presents significant efficiency challenges. While Speculative Decoding (SD) traditionally accelerates inference using smaller draft models, its effectiveness diminishes substantially in long-context scenarios due to memory-bound KV cache operations. We present Retrieval-Augmented Speculative Decoding (RAPID), which leverages RAG for both accelerating and enhancing generation quality in long-context inference. RAPID introduces the RAG drafter-a draft LLM operating on shortened retrieval contexts-to speculate on the generation of long-context target LLMs. Our approach enables a new paradigm where same-scale or even larger LLMs can serve as RAG drafters while maintaining computational efficiency. To fully leverage the potentially superior capabilities from stronger RAG drafters, we develop an inference-time knowledge transfer dynamic that enriches the target distribution by RAG. Extensive experiments on the LLaMA-3.1 and Qwen2.5 backbones demonstrate that RAPID effectively integrates the strengths of both approaches, achieving significant performance improvements (e.g., from 39.33 to 42.83 on InfiniteBench for LLaMA-3.1-8B) with more than 2x speedups. Our analyses reveal that RAPID achieves robust acceleration beyond 32K context length and demonstrates superior generation quality in real-world applications.

arxiv情報

著者 Guanzheng Chen,Qilong Feng,Jinjie Ni,Xin Li,Michael Qizhe Shieh
発行日 2025-02-27 17:59:36+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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