エラスティックキャッシュを用いた視覚指示追従モデルの効率的な推論
Efficient Inference of Vision Instruction-Following Models with Elastic Cache
July 25, 2024
著者: Zuyan Liu, Benlin Liu, Jiahui Wang, Yuhao Dong, Guangyi Chen, Yongming Rao, Ranjay Krishna, Jiwen Lu
cs.AI
要旨
命令追従型大規模視覚言語モデル(LVLM)の分野において、これらのモデルの効率的な展開は、特にキー・バリュー(KV)キャッシュの高いメモリ要求により課題に直面しています。従来のLLM向けキャッシュ管理戦略はキャッシュの削除に焦点を当てていますが、これはマルチモーダルな命令追従モデルの特定のニーズに対応しきれないことが多いです。このギャップを認識し、本論文ではElastic Cacheを紹介します。これは、命令エンコーディングと出力生成の各段階に異なる高速化手法を適用することでメリットを得る新しいアプローチです。私たちは、異なる段階における重要性の指標を調査し、冗長なキャッシュを削減するための重要性駆動型キャッシュ統合戦略を提案します。重要性の低いキャッシュを単に破棄するのではなく、重要なキー/バリューベクトルをアンカーポイントとして特定します。その後、重要性の低いキャッシュをこれらのアンカーに統合することで、KVキャッシュ内の文脈情報の保存を強化しつつ、任意の加速比を実現します。命令エンコーディングに関しては、キャッシュの重要性を評価するために頻度を利用します。出力生成に関しては、オフセットを伴う距離に基づいてトークンを優先し、初期および最新のトークンを保持します。様々なLVLMでの結果は、Elastic Cacheが効率を向上させるだけでなく、様々なタスクにおける言語生成において既存のプルーニング手法を著しく上回ることを示しています。コードはhttps://github.com/liuzuyan/ElasticCacheで公開されています。
English
In the field of instruction-following large vision-language models (LVLMs),
the efficient deployment of these models faces challenges, notably due to the
high memory demands of their key-value (KV) caches. Conventional cache
management strategies for LLMs focus on cache eviction, which often fails to
address the specific needs of multimodal instruction-following models.
Recognizing this gap, in this paper, we introduce Elastic Cache, a novel
approach that benefits from applying distinct acceleration methods for
instruction encoding and output generation stages. We investigate the metrics
of importance in different stages and propose an importance-driven cache
merging strategy to prune redundancy caches. Instead of discarding less
important caches, our strategy identifies important key/value vectors as anchor
points. Surrounding less important caches are then merged with these anchors,
enhancing the preservation of contextual information in the KV caches while
yielding an arbitrary acceleration ratio. For instruction encoding, we utilize
the frequency to evaluate the importance of caches. Regarding output
generation, we prioritize tokens based on their distance with an offset, by
which both the initial and most recent tokens are retained. Results on a range
of LVLMs demonstrate that Elastic Cache not only boosts efficiency but also
notably outperforms existing pruning methods in language generation across
various tasks. Code is available at https://github.com/liuzuyan/ElasticCacheSummary
AI-Generated Summary