PuMer: Pruning and Merging Tokens for Efficient Vision Language Models

Qingqing Cao, Bhargavi Paranjape, Hannaneh Hajishirzi

Abstract

Large-scale Vision-Language (VL) models, such as ViLT and METER, have significantly advanced the state-of-the-art in cross-modal understanding. However, the Transformer architectures underlying these models suffer from quadratic computational complexity relative to the number of input tokens. This "token tax" makes processing high-resolution images alongside text computationally expensive and memory-intensive. This paper presents PuMer, a framework designed to enhance the efficiency of VL models by intelligently pruning and merging tokens. By utilizing text-informed pruning and modality-aware merging, PuMer achieves up to a 2x increase in throughput and a 50% reduction in memory footprint with minimal impact on accuracy.

Introduction

Vision-Language models typically process images by dividing them into a grid of patches, each treated as a token. When combined with text tokens, the resulting sequence length leads to significant latency and memory overhead during self-attention and cross-attention operations. Existing efficiency methods often focus on a single modality or introduce heavy learnable parameters that offset the gains from token reduction.

PuMer addresses these challenges by introducing a cascaded reduction strategy that is both dynamic and parameter-free. It recognizes that the importance of an image patch is often dependent on the associated text—a concept referred to as "dynamic salience." By reducing the token count as data flows through the model's layers, PuMer optimizes the efficiency-accuracy trade-off.

Methodology

PuMer employs two primary non-parametric modules integrated into the cross-modal layers of the Transformer backbone:

1. Text-Informed Pruning (TIP)

Unlike static pruning methods, TIP leverages the existing cross-attention mechanism within the model. It identifies image tokens that receive the least attention from text tokens. If the linguistic context does not "attend" to specific visual regions, those regions are deemed irrelevant to the task and are pruned. This ensures that the model focuses its computational budget on the most semantically relevant parts of the image.

2. Modality-Aware Merging (MAM)

Following pruning, the remaining tokens may still contain redundant information. MAM utilizes a bipartite soft matching algorithm to identify and combine semantically similar tokens. To prevent "modality confusion," MAM is strictly modality-aware: image tokens are only merged with other image tokens, and text tokens with text tokens. This preserves the distinct structural and semantic integrity of each input source.

Training and Distillation

To mitigate the minor information loss inherent in token reduction, PuMer utilizes Knowledge Distillation. During training, the compressed PuMer model (the student) is trained to mimic the output distributions of the original, uncompressed model (the teacher). Because the reduction modules are parameter-free, PuMer also accelerates the training process itself by reducing the number of tokens processed during the backward pass.

Experimental Setup

The researchers evaluated PuMer using two major backbones: ViLT (110M parameters) and METER (330M parameters). The framework was tested across five standard VL benchmarks:

  • VQAv2: Visual Question Answering
  • Flickr30k: Image-to-Text and Text-to-Image retrieval
  • NLVR2: Natural Language Visual Reasoning
  • SNLI-VE: Visual Entailment

Results and Discussion

PuMer demonstrates a superior ability to maintain performance while drastically reducing resource consumption. Key findings include:

  • Efficiency Gains: The models achieved an inference throughput increase of 1.7x to 2.1x. Peak memory usage was reduced by 38% to 50%.
  • Accuracy Preservation: Across all evaluated tasks, the drop in accuracy remained under 1%. For instance, on the VQAv2 benchmark, the METER backbone's accuracy only shifted from 77.5% to 76.8% despite the near-doubling of speed.
  • The Hybrid Advantage: Ablation studies revealed that neither pruning nor merging alone could achieve the same efficiency-accuracy balance as the combined PuMer approach. Pruning provides significant speedups but can be aggressive, while merging preserves information but offers lower latency gains.
  • Training Acceleration: PuMer improved training wall-clock time by 15-20%, a rare benefit for token reduction frameworks which often add overhead during the training phase.

Limitations

PuMer is most effective when the computational bottleneck resides in the cross-modal encoder. In architectures where a massive, independent vision encoder (such as those in ALBEF or X-VLM) dominates the latency, the end-to-end speedup provided by PuMer is less pronounced.

Conclusion

PuMer offers a lightweight, effective solution for scaling Vision-Language models to resource-constrained environments. By making token reduction "text-aware" and "modality-aware," it ensures that computational resources are spent only on the most informative data. Future research may explore applying these text-informed strategies earlier in the pipeline, specifically within uni-modal encoders, to further optimize the initial stages of visual processing.

Summary updated

BibTeX
@inproceedings{cao2023pumer,
  author = {Qingqing Cao and Bhargavi Paranjape and Hannaneh Hajishirzi},
  title = {{PuMer: Pruning and Merging Tokens for Efficient Vision Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-long.721},
}
Figure