SepLLM: 1つのセグメントを1つのセパレータに圧縮することで大規模言語モデルを高速化
SepLLM: Accelerate Large Language Models by Compressing One Segment into One Separator
December 16, 2024
著者: Guoxuan Chen, Han Shi, Jiawei Li, Yihang Gao, Xiaozhe Ren, Yimeng Chen, Xin Jiang, Zhenguo Li, Weiyang Liu, Chao Huang
cs.AI
要旨
大規模言語モデル(LLM)は、自然言語処理タスクの幅広いスペクトルで卓越した性能を示しています。ただし、その膨大なサイズは、二次的な複雑さによる計算要求と推論速度の面で特に大きな課題を提起しています。本研究では、特定の意味のない特別なトークン(すなわち、セパレータ)が、意味のあるトークンと比較して注意スコアに過剰な寄与をしているという重要なパターンを特定しました。この観察から、これらのセパレータトークン間のセグメントの情報を、情報の大幅な損失なしに効果的にセパレータトークン自体に縮約できる可能性が示唆されます。この洞察に基づいて、セパレータトークンを圧縮し冗長なトークンを排除することで推論を加速するプラグアンドプレイフレームワークであるSepLLMを導入します。さらに、トレーニング加速のための効率的なカーネルを実装しています。トレーニングフリー、スクラッチからのトレーニング、ポストトレーニングの設定を横断する実験結果は、SepLLMの効果を示しています。特に、Llama-3-8Bバックボーンを使用した場合、GSM8K-CoTベンチマークでKVキャッシュの50%以上の削減を実現しつつ、同等のパフォーマンスを維持しています。さらに、ストリーミング設定では、SepLLMは、一貫した言語モデリング能力を維持しつつ、400万トークン以上のシーケンスを効果的に処理します。
English
Large Language Models (LLMs) have exhibited exceptional performance across a
spectrum of natural language processing tasks. However, their substantial sizes
pose considerable challenges, particularly in computational demands and
inference speed, due to their quadratic complexity. In this work, we have
identified a key pattern: certain seemingly meaningless special tokens (i.e.,
separators) contribute disproportionately to attention scores compared to
semantically meaningful tokens. This observation suggests that information of
the segments between these separator tokens can be effectively condensed into
the separator tokens themselves without significant information loss. Guided by
this insight, we introduce SepLLM, a plug-and-play framework that accelerates
inference by compressing these segments and eliminating redundant tokens.
Additionally, we implement efficient kernels for training acceleration.
Experimental results across training-free, training-from-scratch, and
post-training settings demonstrate SepLLM's effectiveness. Notably, using the
Llama-3-8B backbone, SepLLM achieves over 50% reduction in KV cache on the
GSM8K-CoT benchmark while maintaining comparable performance. Furthermore, in
streaming settings, SepLLM effectively processes sequences of up to 4 million
tokens or more while maintaining consistent language modeling capabilities.Summary
AI-Generated Summary