PACT: Pruning and Clustering-Based Token Reduction for Faster Visual Language Models

Mohamed Dhouib, Davide Buscaldi, Sonia Vanier, Aymen Shabou

This CVPR 2024 paper introduces PACT (Pruning and Clustering-Based Token Reduction), a training-free method designed to make Visual Language Models (VLMs) significantly faster and more memory-efficient by intelligently reducing the number of visual tokens processed by the language model.

TL;DR

PACT accelerates Visual Language Models by pruning irrelevant visual tokens and merging redundant ones at inference time without requiring any extra training. It achieves a 225% speedup and 50-70% token reduction with negligible performance loss, outperforming existing methods while remaining fully compatible with high-speed kernels like FlashAttention.

The Problem: Token Explosion

State-of-the-art VLMs (like LLaVA or Qwen-VL) represent images as a sequence of "visual tokens." As we move toward higher-resolution images and video, the number of tokens explodes—often exceeding 10,000 per image. Because the computational cost of the Transformer's self-attention mechanism grows quadratically with the number of tokens, these models become incredibly slow and memory-hungry.

Existing solutions often fall into two traps:

  1. Attention Dependency: They rely on calculating attention scores to find "important" tokens, which is incompatible with FlashAttention, the industry standard for fast inference.
  2. Positional Bias: Many methods accidentally prune tokens based on their position in the sequence rather than their actual content.

Methods: PACT Pipeline

The authors propose a two-pronged approach applied at an early layer of the language model:

1. EUTI (Efficient Unimportant Tokens Identification)

Instead of looking at attention scores, EUTI identifies unimportant tokens using two metrics:

  • Hidden State Norms: The authors observed that tokens with higher norms tend to carry more information through the network's residual connections.
  • Global Query Relevance: They calculate a "global query vector" and measure how well each token's "key" matches it.
Visual token norms across different statistics, showing the variance used for identification.

2. DBDPC (Distance Bounded Density Peak Clustering)

After pruning, PACT handles redundancy using a novel clustering algorithm that groups similar visual tokens. It enforces a distance bound, ensuring that a cluster doesn't become a "catch-all" for unrelated information.

3. The Full Pipeline

  • Prune: Remove the least important tokens.
  • Cluster: Group the remaining important tokens.
  • Recover: Re-incorporate pruned tokens if they are very close to a cluster to prevent information loss.
  • Merge: Collapse each cluster into a single representative token.

Key Insights

  • The "Aha" on Norms: Hidden state norms are a reliable proxy for token importance, bypassing expensive attention matrix calculations.
  • FlashAttention Compatibility: By avoiding attention scores, PACT is "plug-and-play" for production environments using optimized CUDA kernels.
  • Layer Sensitivity: Token reduction is most effective when applied after a few layers (e.g., layer 4), once the model has "decided" which tokens are distinct and important.

Key Results

PACT was evaluated across over 20 datasets, including general reasoning (MME, ScienceQA), OCR (DocVQA), and video understanding (VideoMME).

  • Efficiency: On LLaVA-OneVision-7B, PACT achieved a 71.3% reduction in visual tokens with only a 1.4% drop in performance.
  • Throughput: The method provided a 2.25x speedup.
  • Memory: GPU memory consumption dropped by roughly 31%.
Performance comparison of PACT against other methods as a function of reduction ratio and throughput.

At high reduction ratios (70%+), PACT significantly outperformed previous state-of-the-art methods like ToME and FastV, which saw performance "fall off a cliff" at those levels.

Limitations and Future Work

While robust, PACT requires setting a pruning percentage ($\lambda$) and a clustering distance ($d_c$). Future work could explore "progressive" reduction—thinning out tokens gradually across multiple layers rather than at a single pre-selected layer. Currently, the method is most effective on models that feed visual tokens directly into the LLM, such as the LLaVA family.

Summary updated

BibTeX
@inproceedings{dhouib2025pact,
  author = {Mohamed Dhouib and Davide Buscaldi and Sonia Vanier and Aymen Shabou},
  title = {{PACT: Pruning and Clustering-Based Token Reduction for Faster Visual Language Models}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2025},
  doi = {10.1109/cvpr52734.2025.01359},
}
Figure