IVTP: Instruction-Guided Visual Token Pruning for Large Vision-Language Models

Kai Huang, Hao Zou, Ye Xi, Bochen Wang, Zhen Xie, Liang YuECCV 2024

Abstract

Large Vision-Language Models (LVLMs) face significant computational challenges due to the high volume of visual tokens processed by the Large Language Model (LLM) backbone. This paper introduces IVTP (Instruction-guided Visual Token Pruning), a novel framework that enhances efficiency by selectively discarding unnecessary visual data. IVTP employs a two-stage pruning strategy: Group-wise Token Pruning (GTP) within the visual encoder to stabilize importance scores via attention rollout, and instruction-aware filtering within the LLM to retain tokens relevant to specific user queries. Experimental results on LLaVA-1.5 demonstrate that IVTP can reduce visual tokens by nearly 90% and computational costs (TFLOPs) by 46% with a minimal accuracy drop (~1%), outperforming existing state-of-the-art pruning techniques.

What Problem Does This Paper Address?

Large Vision-Language Models (LVLMs) process images by decomposing them into a grid of tokens. For instance, a standard 336px image yields 576 tokens. When these are fed into an LLM, they dominate the token budget, leading to high computational overhead and latency.

Existing pruning methods typically suffer from two limitations:

  1. Vision-only pruning: They discard tokens based solely on image content, ignoring the user's specific instruction (e.g., pruning a "cat" token when the user asks about the cat's color).
  2. Instability: Many methods rely on attention weights from a single layer, which are often noisy and can lead to the accidental removal of critical information.
Comparison of pruning paradigms: (a) post-encoder pruning, (b) hierarchical vision-only pruning, and (c) the proposed instruction-guided pruning (IVTP).

Methods

The IVTP framework slims down visual data through a two-stage approach integrated into both the visual encoder and the LLM.

The complete IVTP architecture, featuring Group-wise Token Pruning (GTP) and the instruction-guided pruning mechanism using a textual pseudo CLS token.

1. Group-wise Token Pruning (GTP) in the Visual Encoder

To address the instability of single-layer attention, IVTP groups layers together. It utilizes attention rollout, which recursively multiplies attention matrices (including residual connections) across the group. This provides a stable, holistic view of token importance, ensuring that tokens contributing most to the final image representation are preserved.

2. Instruction-guided Pruning in the LLM

The core innovation of IVTP is pruning based on the text prompt. Since decoder-only LLMs lack a single "summary" token (like a CLS token), the authors introduce a textual pseudo CLS token.

  • Mechanism: A frozen CLIP text encoder identifies words in the user's instruction most relevant to the image. These "key" text tokens are aggregated into the pseudo CLS token.
  • Pruning: In the initial 12 layers of the LLM, visual tokens that do not "attend" to this pseudo CLS token are discarded. This ensures the model focuses only on image regions relevant to the user's query.

Datasets and Evaluation

The model was trained and evaluated using the standard LLaVA-1.5 pipeline:

  • Pre-training: A 558K subset of LAION-CC-SBU.
  • Instruction Tuning: A 665K mix of visual instruction-following examples.
  • Evaluation: A comprehensive suite of 12 benchmarks, including VQAv2, GQA, ScienceQA, TextVQA, POPE, MME, MMBench, and MM-Vet.

Key Results

  • Massive Compression: Visual tokens were reduced by 88.9% (from 576 down to 64).
  • Efficiency Gains: Computational complexity (TFLOPs) decreased by over 46%.
  • High Fidelity: Across 12 benchmarks, the average accuracy drop was only 1.0%.
  • Superiority: IVTP outperformed popular methods like ToMe and EViT by approximately 2% in accuracy at equivalent compression levels.
  • Zero-Shot Capability: The method is effective in "inference-only" mode without retraining, allowing for easy integration into existing pre-trained models.

Limitations and Future Work

While effective, IVTP has constraints. Instruction-guided pruning is currently limited to the first 12 LLM layers to minimize overhead. Additionally, the pseudo CLS token is used only for pruning decisions and does not participate in text generation. Future research will explore extending IVTP to multi-image and video tasks, where token counts are significantly higher.

Reference: Huang, K., Zou, H., et al. "IVTP: Instruction-guided Visual Token Pruning for Large Vision-Language Models." Alibaba Group, 2024.

Summary updated

BibTeX
@inproceedings{huang2024ivtp,
  author = {Kai Huang and Hao Zou and Ye Xi and Bochen Wang and Zhen Xie and Liang Yu},
  title = {{IVTP: Instruction-Guided Visual Token Pruning for Large Vision-Language Models}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  url = {https://openreview.net/forum?id=slm4cr26TJ},
}
Figure