FlashBack:Efficient Retrieval-Augmented Language Modeling for Long Context Inference

要約

大規模言語モデル (LLM) と外部コーパスの関連文書を統合する検索拡張言語モデリング (RALM) は、LLM が事前トレーニング コーパスの範囲を超えた情報を生成できるようにする実証済みの方法です。
取得したコンテンツを入力の先頭に追加するだけで利用する以前の作業では、実行時間が長くなる問題が発生し、キー値 (KV) キャッシュを効率的に使用できないため、LLM の推論効率が低下します。
この論文では、低ランク適応による微調整後に適切なパフォーマンスを維持しながら、コンテキスト パターンを追加することで RALM の推論効率を向上させるように設計されたモジュール式 RALM である FlashBack を提案します。
FlashBack は、取得したドキュメントを先頭に追加するのではなく、KV キャッシュを効率的に利用するためにコンテキストの最後に追加します。
また、微調整中に追加するコンテキストの境界をマークするための 2 つの特別なプロンプト トークンとして、マーキング トークンを導入します。
生成品質をテストするための私たちの実験は、FlashBack が複雑な状況でもまともな生成品質を維持できることを示しています。
また、FlashBack の推論速度は、実行時テストで 7B LLM (Llama 2) の先頭に追加するものよりも最大 $4\倍$ 高速です。
不必要な再計算をバイパスすることで、大幅に高速な推論速度を達成することで進歩を示し、この効率の向上により推論コストが大幅に削減されます。

要約(オリジナル)

Retrieval-Augmented Language Modeling (RALM) by integrating large language models (LLM) with relevant documents from an external corpus is a proven method for enabling the LLM to generate information beyond the scope of its pre-training corpus. Previous work utilizing retrieved content by simply prepending it to the input poses a high runtime issue, which degrades the inference efficiency of the LLMs because they fail to use the Key-Value (KV) cache efficiently. In this paper, we propose FlashBack, a modular RALM designed to improve the inference efficiency of RALM with appending context pattern while maintaining decent performance after fine-tuning by Low-Rank Adaption. FlashBack appends retrieved documents at the end of the context for efficiently utilizing the KV cache instead of prepending them. And we introduce Marking Token as two special prompt tokens for marking the boundary of the appending context during fine-tuning. Our experiments on testing generation quality show that FlashBack can remain decent generation quality in perplexity. And the inference speed of FlashBack is up to $4\times$ faster than the prepending counterpart on a 7B LLM (Llama 2) in the runtime test. Via bypassing unnecessary re-computation, it demonstrates an advancement by achieving significantly faster inference speed, and this heightened efficiency will substantially reduce inferential cost.

arxiv情報

著者 Runheng Liu,Xingchen Xiao,Heyan Huang,Zewen Chi,Zhijing Wu
発行日 2024-05-16 12:04:30+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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