Introduction
Large Vision-Language Models (VLMs), such as LLaVA, have demonstrated remarkable capabilities in multimodal understanding. However, their deployment is often hindered by the substantial memory requirements of the Key-Value (KV) cache, particularly in long-context scenarios like video analysis or multi-image document processing. As the context grows, the KV cache can exceed GPU memory limits, leading to significant latency or out-of-memory errors.
Existing KV cache pruning techniques, primarily developed for Large Language Models (LLMs), often fail when applied to VLMs. These methods typically delete tokens based on a unified attention score threshold. However, visual and textual tokens exhibit fundamentally different attention distributions. Treating them identically leads to "modality bias," where visual tokens are disproportionately pruned, causing the model to lose critical visual information while retaining textual instructions.
The Motivation: Modality Distribution Gap
A core finding of this work is the significant disparity between intra-modality (self) and inter-modality (cross) attention scores. In VLMs, the attention weights that textual tokens assign to other textual tokens (self-attention) often occupy a different range than the weights assigned to visual tokens (cross-attention).
As shown in the Kernel Density Estimation (KDE) plot above, these distributions are nearly non-overlapping. Using a single global threshold for pruning is ineffective because it fails to account for these distinct "rubrics" of importance.
Methodology: Cross-Self Pruning (CSP)
To address the limitations of traditional pruning, the authors introduce Cross-Self Pruning (CSP). This training-free approach optimizes the KV cache by treating visual and textual attention independently and stabilizing the resulting distribution.
1. Cross-Self Decomposition
Instead of evaluating a single attention matrix, CSP decomposes attention into two categories:
- Self-Attention (Intra-modality): Relationships between tokens of the same type (e.g., text-to-text).
- Cross-Attention (Inter-modality): Relationships across different types (e.g., text-to-image).
By selecting the top-k tokens from each distribution independently, CSP ensures that essential visual cues are preserved even when their raw attention scores are lower than those of dominant textual tokens.
2. n-Softmax Smoothing
Pruning tokens alters the denominator of the softmax function, which typically causes the remaining attention scores to become "sharper" or more extreme. This "sharpness shift" can degrade model performance. CSP introduces n-softmax, which incorporates a constant factor back into the calculation to restore the original smoothness of the attention distribution, ensuring the model remains well-calibrated after pruning.
Experimental Results
The researchers evaluated CSP using MileBench, a benchmark for long-context multimodal tasks, across models including LLaVA-v1.5 (7B/13B), InternVL-v1.5-7B, and MobileVLM-V2-3B.
- Performance Gains: On the ALFRED conversational embodied dialogue task, CSP achieved a 41% performance improvement over previous state-of-the-art pruning methods.
- Efficiency: The method reduced the KV cache budget by 13.6% while maintaining accuracy. On an RTX-4090, CSP increased decoding speed by 37% (reducing latency from 26ms to 16ms per token) at a 10% cache budget.
- Memory Footprint: GPU memory usage for the cache was slashed from 1.5GB to 0.2GB in high-compression scenarios.
Conclusion
Cross-Self Pruning offers a robust, training-free solution for the KV cache bottleneck in Vision-Language Models. By recognizing the inherent differences in how models attend to text versus images and stabilizing the attention mechanism via n-softmax, CSP enables efficient, long-context multimodal inference without the modality bias inherent in previous approaches. Future work will explore dynamic cross-self ratios to further optimize performance across diverse tasks.
Summary updated