Beyond Text-Visual Attention: Exploiting Visual Cues for Effective Token Pruning in VLMs

Qizhe Zhang, Aosong Cheng, Ming Lü, Zhiyong Zhuo, Minqi Wang, Jiajun Cao, Shaobo Guo, Qi She, Shanghang Zhang · DOI

Abstract

Large vision-language models (LVLMs) generally contain significantly more visual tokens than their textual counterparts, resulting in a considerable computational burden. Recent efforts have been made to tackle this issue by pruning visual tokens early within the language model. Most existing works use attention scores between text and visual tokens to assess the importance of visual tokens. However, in this study, we first analyze the text-visual attention in the language model and find that this score is not an ideal indicator for token pruning. Based on the analysis, We propose VisPruner, a plug-and-play method that utilizes visual cues for more effective token pruning in LVLMs. Specifically, we first use visual attention to select a limited number of significant tokens. Then, we remove duplicate tokens from the remaining ones based on their similarity. By retaining diverse tokens alongside the initially selected important tokens, we maximally preserve the visual information of the input image. Experimental results demonstrate that our VisPruner sustains strong performance across various VLM architectures and reduction ratios, significantly outperforming existing methods based on text-visual attention. Notably, without any training, VisPruner can reduce the FLOPs of LLaVA-1.5-7B by 91% and inference latency by 75%, while maintaining comparable performance.

Introduction

Large Vision-Language Models (LVLMs) like LLaVA are computationally expensive due to "visual token bloat." A single image can generate hundreds or thousands of tokens, creating a massive bottleneck in the language model. Existing solutions often attempt to prune unimportant visual tokens using text-visual attention—the attention the language model pays to image tokens based on the text prompt.

However, this research identifies two fundamental flaws in using text-visual attention for pruning:

  1. Attention Shift: Position embeddings (like RoPE) bias text tokens toward visual tokens appearing later in the sequence (often the bottom of the image), regardless of their actual content.
  2. Attention Dispersion: In deeper layers, attention becomes too spread out (high entropy), making it difficult to distinguish important tokens from noise.

Methodology: The VisPruner Approach

To overcome these biases, VisPruner ignores the language model's attention and instead leverages the visual encoder (e.g., CLIP) to determine token importance. The method follows a two-step process:

  1. Attention-based Importance: It utilizes the visual encoder’s internal attention (specifically the [CLS] token) to identify salient foreground objects.
  2. Similarity-based Diversity: To prevent the loss of background context, VisPruner removes duplicate tokens among the remaining set based on cosine similarity. This ensures a diverse, representative sample of the entire image is maintained.
Comparison of pruning methods: VisPruner maintains visual saliency and context, avoiding hallucinations seen in FastV and Random pruning.

Because VisPruner operates before tokens reach the language model, it is entirely training-free and compatible with standard optimization techniques like FlashAttention.

Experimental Results

VisPruner was evaluated across 13 benchmarks (including VQAv2, GQA, and POPE) and multiple models (LLaVA-1.5, LLaVA-NeXT, Video-LLaVA, etc.).

  • Efficiency Gains: For LLaVA-1.5-7B, VisPruner reduced FLOPs by 91% and inference latency by 75%.
  • Performance Retention: Even when discarding 94.4% of visual tokens, the model maintained 91.5% of its original average performance across 10 tasks.
  • High-Resolution and Video Scaling: On LLaVA-NeXT, it maintained 86.7% performance while pruning over 94% of tokens. In video contexts (Video-LLaVA), it maintained 95.1% performance with an 88.9% reduction ratio, highlighting the high redundancy in video frames.

Key Insights

  • The RoPE Trap: Rotary Position Embeddings (RoPE) inadvertently cause models to favor tokens physically closer in the input sequence, undermining previous pruning methods.
  • Visual Saliency > Cross-Modal Attention: The visual encoder is a more reliable judge of token importance for early-stage pruning than the language model.
  • Diversity as a Safety Net: Explicitly enforcing token diversity prevents hallucinations by retaining critical background context that simple "importance" metrics might discard.

Conclusion

VisPruner provides a robust, training-free solution to the visual token bottleneck in LVLMs. By prioritizing visual saliency and diversity over biased attention scores, it achieves state-of-the-art efficiency without sacrificing the model's ability to understand complex scenes.

Summary updated

BibTeX
@misc{zhang2024beyond,
  author = {Qizhe Zhang and Aosong Cheng and Ming Lü and Zhiyong Zhuo and Minqi Wang and Jiajun Cao and Shaobo Guo and Qi She and Shanghang Zhang},
  title = {{Beyond Text-Visual Attention: Exploiting Visual Cues for Effective Token Pruning in VLMs}},
  year = {2024},
  eprint = {2412.01818},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.01818},
}
Figure