TL;DR
AttentionPack is a novel optimization framework that slashes the massive memory footprint of Key-Value (KV) caches in Large Vision-Language Models (VLMs) by up to 8x. By combining multi-head low-rank matrix compression (SVD) with an attention-aware, token-specific decompression strategy, it enables significantly larger batch sizes and faster inference speeds without sacrificing model accuracy.
What Problem Does This Paper Address?
Large Vision-Language Models (VLMs) excel at multi-modal tasks like video analysis and document understanding. However, their deployment is severely bottlenecked during the autoregressive decoding phase. To avoid redundant computations, VLMs store the Key and Value vectors of all past tokens in a temporary buffer called the KV cache.
When dealing with long-context inputs—such as high-resolution images or multi-frame videos—the visual inputs are converted into thousands of tokens. The resulting KV cache grows linearly with sequence length, batch size, and network dimensions, easily consuming hundreds of gigabytes of GPU memory. This forces systems to spend more time moving data between memory and compute units than actually performing computations, leading to high latency and low throughput.
Existing solutions like token eviction (dropping tokens) or quantization (reducing bit precision) either cause irreversible information loss or struggle with hardware compatibility and outlier values.
Methods
The authors introduce AttentionPack, an end-to-end framework that compresses the KV cache along the hidden dimension axis without evicting tokens. It relies on two primary innovations:
- Multi-Head Attention Compaction: The authors observe that visual tokens possess a low intrinsic rank. Instead of compressing each attention head independently, AttentionPack merges the KV cache across the head axis before applying Singular Value Decomposition (SVD). This allows the framework to exploit shared information across heads, achieving much higher compression ratios. Crucially, visual and textual tokens are processed separately to avoid cross-modality performance degradation.
- Attention-Aware Decompression: Decompressing the entire cache at every decoding step introduces computational overhead. To mitigate this, AttentionPack dynamically tracks token importance using a moving average of attention scores. Tokens with high attention scores are decompressed using their full rank, while less influential tokens (e.g., background image regions) are decompressed using a lower rank, drastically reducing FLOPs.
To further optimize performance, the authors developed a fused kernel implementation that integrates the decompression step directly into FlashAttention, performing the operations on-the-fly in fast SRAM to minimize slow GPU memory transfers.
Datasets
The framework was evaluated across several demanding benchmarks:
- Image QA: A-OKVQA (commonsense knowledge), OCR-VQA (text reading in images), and MMMU (multi-discipline advanced reasoning).
- Video QA: MSVD-QA and MSRVTT-QA (short video clip question-answering).
- Text QA/Summarization: LongBench (used specifically to analyze the framework's behavior on purely textual long-context tasks).
Key Insights and Ideas
- Heads are Better Together: Compressing attention heads collectively rather than individually yields a massive efficiency boost. For instance, combining heads before SVD increases the explained variance ratio, boosting key compression from 4.18x to 9.18x.
- Visual vs. Textual Asymmetry: Visual tokens are highly redundant and tolerate aggressive low-rank compression. Textual tokens, however, carry dense information; compressing them under the same aggressive ratios severely harms performance, meaning a modality-split approach is essential.
- Not All Tokens Are Created Equal: Autoregressive models consistently focus on specific core objects or prompt-relevant regions. By partially decompressing the "unimportant" tokens with lower ranks, the framework cuts decompression FLOPs by up to 67.5% while maintaining output quality.
Key Results
AttentionPack demonstrates superior Pareto-efficiency compared to state-of-the-art cache management techniques like H2O, Scissorhands, and Minicache:
- Cache Reduction: Achieved an 8.11x reduction in cache size for VideoLLaVA-7B and a ~5x reduction for LLaVA1.5 variants, dropping a typical 328 MB per-instance cache down to just 64.5 MB.
- Throughput & Latency: Enabled up to 4x larger batch sizes, translating to 74% faster decoding in batch inference for image tasks and 60% faster decoding for video QA.
- Accuracy Preservation: Across A-OKVQA, OCR-VQA, and MMMU, AttentionPack maintained or slightly improved baseline accuracy, proving that low-rank compression effectively filters out visual noise.
Limitations and Future Work
While highly effective, the authors note a few limitations:
- Key Vector Sensitivity: Key vectors are noticeably more sensitive to rank reduction during partial decompression than Value vectors, as altering them directly impacts attention weight calculations.
- Text Domain Constraints: The low-rank assumption holds strongly for visual tokens but is less effective for dense textual tokens, where value matrices require higher ranks to prevent performance drops.
Future work could explore adaptive rank-selection policies that dynamically adjust compression thresholds per layer based on real-time context complexity.
Summary updated