LLaVA-PruMerge: Adaptive Token Reduction for Efficient Large Multimodal Models

Yuzhang Shang, Mu Cai, Bingxin Xu, Yong Jae Lee, Yan Yan · Submission to ICLR 2025 · Withdrawn

TL;DR

LLaVA-PruMerge introduces an adaptive, plug-and-play visual token reduction method that slashes the number of visual tokens fed into Large Multimodal Models (LMMs) by up to $18\times$ (down to 5.5%–25% of the original budget). By adaptively selecting salient tokens using attention sparsity and merging the rest via key-clustering, it cuts LLM prefill computation and latency by nearly an order of magnitude with negligible—and sometimes positive—impact on visual reasoning benchmarks.

What Problem Does This Paper Address?

In standard Large Multimodal Models (like LLaVA), high-resolution images or videos are chopped into visual patches and converted into long sequences of tokens (e.g., 576 tokens for a single image in LLaVA-1.5, or 2,048 tokens across video frames in Video-LLaVA). These visual tokens are prepended directly to text prompts before entering the Large Language Model (LLM).

Because self-attention within the LLM scales quadratically with sequence length, processing these hundreds or thousands of visual tokens during the initial "prefill" stage dominates computation and GPU memory. Prior token-reduction techniques primarily targeted standard Vision Transformers (ViTs) to speed up image-only classification, which fails in multimodal setups where the vision backbone is cheap, but the downstream LLM is massive and requires rich contextual details.

Methods

PruMerge operates as a lightweight bridge between the vision encoder and the LLM backbone, consisting of two main steps, plus an enhanced variant:

[Vision Encoder] 
       │
       ▼
1. Adaptive Important Token Selection (AITS)
   └─ Uses [CLS]-token attention scores from penultimate ViT layer
   └─ Outlier detection (IQR upper fence) adaptively picks salient tokens
       │
       ▼
2. Token Supplement (TS) via Similar Key Clustering
   └─ Computes key-key similarity: Sim(yi, yj) = ki · kj^T
   └─ Assigns pruned tokens to unpruned anchors via k-NN (O(n) complexity)
   └─ Merges pruned representations into anchors via attention-weighted averaging
       │
       ▼
[Projector & LLM Backbone]
  • Adaptive Important Token Selection (AITS): The authors observe that attention scores between the [CLS] token and spatial patch tokens in CLIP-ViT are highly sparse. Using the Interquartile Range (IQR) statistical outlier detection method, PruMerge dynamically identifies and retains visual tokens whose attention scores exceed the upper fence ($Q3 + 1.5 \times \text{IQR}$). Simple images retain very few tokens, while visually dense or text-rich scenes retain more.
  • Token Supplement (TS) via Similar Key Clustering: Rather than discarding non-salient tokens (which may contain useful context like background or large object parts), PruMerge groups the pruned tokens to their $k$-nearest unpruned "anchor" tokens using ViT key-vector dot-product similarities ($O(n)$ complexity). The unpruned tokens are then updated via attention-weighted averaging.
  • PruMerge+: To avoid performance drops in visually demanding tasks, PruMerge+ supplements the IQR-selected tokens with a spatially uniform grid sample of tokens, reducing the original sequence to roughly 25% while maintaining spatial coverage.

Datasets

  • Image LMM Evaluation: Evaluated on standard multimodal benchmarks: VQAv2, ScienceQA (SQA), TextVQA, POPE (hallucination), MME, and MMBench.
  • Video LMM Evaluation: Evaluated training-free on MSVD-QA, MSRVTT-QA, and ActivityNet-QA.
  • Training Data: Fine-tuned on the standard LLaVA-1.5 instruction fine-tuning dataset (665K samples) using LoRA for 1 epoch. No new datasets or benchmarks were created.

Key Insights and Ideas

  • Visual Information Density is Inherently Dynamic: Fixed token budgets are wasteful. A picture of a clear sky contains far less visual information than an image packed with text. Adaptive outlier detection naturally scales token allocation to visual complexity.
  • Pruned Tokens Still Matter: Pure token dropping loses scene-level context. Aggregating non-salient tokens into salient clusters preserves background information without swelling the LLM's sequence length.
  • Video-LLMs Suffer from Extreme Redundancy: Feeding 2,048 raw visual tokens into a video LLM introduces severe temporal and spatial noise. Selectively pruning visual tokens prior to the LLM actually improves video question answering accuracy over the dense baseline.

Key Results

  • Theoretical & Practical Speedups: For LLaVA-1.5 (Vicuna-7B, FP16), prefill FLOPs dropped from 9.3 TB to 0.91 TB (over $10\times$ reduction), slashing theoretical prefill latency from 88.6 ms down to 15.3 ms. Storing activations dropped from 4.60 GB to 0.28 GB.
  • Image Benchmark Parity:
  • PruMerge retains just 5.5% of visual tokens (~32 tokens average vs. 576 original) while staying competitive (e.g., ScienceQA rose from 66.8 to 68.5; POPE scored 76.3 vs. 85.9).
  • PruMerge+ retains 25% of tokens (144 tokens), nearly matching or beating dense LLaVA-1.5 across the board (e.g., MMBench 64.9 vs. 64.3; ScienceQA 68.3 vs. 66.8; POPE 84.0 vs. 85.9).
  • Zero-Shot Boost on Video-LLaVA: Applied purely at inference time with no fine-tuning, reducing visual tokens from 2,048 down to 256 (12.5%):
  • ActivityNet-QA: Jumped from 45.3% to 48.3% accuracy.
  • MSVD-QA: Increased from 70.7% to 71.1% accuracy.
  • Outperforming Prior Methods: PruMerge+ significantly outperformed unimodal pruning techniques adapted to LMMs (ToMe, ATS, EViT) and beat the concurrent multimodal method CrossGet (77.6% vs. 77.3% on VQAv2 at 50% token retention).

Limitations and Future Work

  • Perception-Heavy Drops at Ultra-Low Token Budgets: At aggressive compression (~5.5% tokens), tasks requiring fine-grained spatial and text recognition (e.g., VQAv2 dropping from 78.5 to 72.0) experience noticeable degradation, necessitating the PruMerge+ variant.
  • Orthogonal Integration: The paper demonstrates theoretical synergy with quantization (INT4) and pruning, but extensive hardware-level profiling when combined with FlashAttention, KV-cache optimizations, and tensor parallelism remains an area for future deployment studies.
  • Deeper Video Exploration: While Video-LLaVA performance improved training-free, future work could explore jointly modeling temporal and spatial cross-frame redundancy rather than frame-independent token selection.

Summary updated

BibTeX
@misc{shang2024llava,
  author = {Yuzhang Shang and Mu Cai and Bingxin Xu and Yong Jae Lee and Yan Yan},
  title = {{LLaVA-PruMerge: Adaptive Token Reduction for Efficient Large Multimodal Models}},
  year = {2024},
  eprint = {2403.15388},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.15388},
}
Figure