LOOK-M: Look-Once Optimization in KV Cache for Efficient Multimodal Long-Context Inference

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Wan, Zhongwei, Wu, Ziang, Liu, Che, Huang, Jinfa, Zhu, Zhihong, Jin, Peng, Wang, Longyue, Yuan, Li
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866916301721567232
author Wan, Zhongwei
Wu, Ziang
Liu, Che
Huang, Jinfa
Zhu, Zhihong
Jin, Peng
Wang, Longyue
Yuan, Li
author_facet Wan, Zhongwei
Wu, Ziang
Liu, Che
Huang, Jinfa
Zhu, Zhihong
Jin, Peng
Wang, Longyue
Yuan, Li
contents Long-context Multimodal Large Language Models (MLLMs) demand substantial computational resources for inference as the growth of their multimodal Key-Value (KV) cache, in response to increasing input lengths, challenges memory and time efficiency. Unlike single-modality LLMs that manage only textual contexts, the KV cache of long-context MLLMs includes representations from multiple images with temporal and spatial relationships and related textual contexts. The predominance of image tokens means traditional optimizations for LLMs' KV caches are unsuitable for multimodal long-context settings, and no prior works have addressed this challenge. In this work, we introduce LOOK-M, a pioneering, fine-tuning-free approach that efficiently reduces the multimodal KV cache size while maintaining performance comparable to a full cache. We observe that during prompt prefill, the model prioritizes more textual attention over image features, and based on the multimodal interaction observation, a new proposed text-prior method is explored to compress the KV cache. Furthermore, to mitigate the degradation of image contextual information, we propose several compensatory strategies using KV pairs merging. LOOK-M demonstrates that with a significant reduction in KV Cache memory usage, such as reducing it by 80% in some cases, it not only achieves up to 1.5x faster decoding but also maintains or even enhances performance across a variety of long context multimodal tasks.
format Preprint
id arxiv_https___arxiv_org_abs_2406_18139
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle LOOK-M: Look-Once Optimization in KV Cache for Efficient Multimodal Long-Context Inference
Wan, Zhongwei
Wu, Ziang
Liu, Che
Huang, Jinfa
Zhu, Zhihong
Jin, Peng
Wang, Longyue
Yuan, Li
Computation and Language
Computer Vision and Pattern Recognition
Long-context Multimodal Large Language Models (MLLMs) demand substantial computational resources for inference as the growth of their multimodal Key-Value (KV) cache, in response to increasing input lengths, challenges memory and time efficiency. Unlike single-modality LLMs that manage only textual contexts, the KV cache of long-context MLLMs includes representations from multiple images with temporal and spatial relationships and related textual contexts. The predominance of image tokens means traditional optimizations for LLMs' KV caches are unsuitable for multimodal long-context settings, and no prior works have addressed this challenge. In this work, we introduce LOOK-M, a pioneering, fine-tuning-free approach that efficiently reduces the multimodal KV cache size while maintaining performance comparable to a full cache. We observe that during prompt prefill, the model prioritizes more textual attention over image features, and based on the multimodal interaction observation, a new proposed text-prior method is explored to compress the KV cache. Furthermore, to mitigate the degradation of image contextual information, we propose several compensatory strategies using KV pairs merging. LOOK-M demonstrates that with a significant reduction in KV Cache memory usage, such as reducing it by 80% in some cases, it not only achieves up to 1.5x faster decoding but also maintains or even enhances performance across a variety of long context multimodal tasks.
title LOOK-M: Look-Once Optimization in KV Cache for Efficient Multimodal Long-Context Inference
topic Computation and Language
Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2406.18139