PPT: Token Pruning and Pooling for Efficient Vision Transformers

Xinjian Wu, Fanhu Zeng, Xiudong Wang, Xinghao Chen

TL;DR

PPT (Token Pruning & Pooling Transformers) is a novel acceleration framework that adaptively combines token pruning and token pooling to reduce the computational overhead of Vision Transformers (ViTs). By intelligently switching between discarding irrelevant tokens and merging similar ones based on layer depth and image content, PPT achieves significant efficiency gains—such as a 37% reduction in FLOPs and a 45% increase in throughput for DeiT-S—without any loss in accuracy.

What Problem Does This Paper Address?

Vision Transformers (ViTs) have set new benchmarks in computer vision, but their "quadratic complexity"—where computational cost grows exponentially with the number of image patches (tokens)—makes them difficult to deploy in real-time or resource-constrained environments.

Researchers typically tackle this by reducing the number of tokens as they pass through the network. There are two main ways to do this:

  1. Token Pruning: Identifying and discarding "inattentive" tokens that don't contribute much to the final prediction (e.g., background patches).
  2. Token Pooling: Merging "duplicative" tokens that are highly similar to one another (e.g., multiple patches of a clear blue sky).

The authors argue that existing methods are suboptimal because they usually pick one strategy and stick to it. However, the type of redundancy changes as an image moves through the transformer layers. Pruning too early can lead to irreversible information loss, while pooling alone might keep around useless background noise.

Methods

The core of the paper is the Adaptive Token Compression (ATC) module, which can be plugged into standard transformer blocks without adding any new trainable parameters.

Figure 2: Overview of the proposed PPT approach. (a) The Adaptive Token Compression module is simple and can be easily inserted inside the standard transformer block without additional trainable parameter. (b) Our module can adaptively select either token pruning or token pooling policy to tackle corresponding redundancy based on the current token distribution, which is intuitively reflected across various instances and layers in (c). (c) With PPT, similar patches within the same color bounding box are pooled into a single token, while the masked inattentive patches are pruned, resulting in promising trade-offs between the accuracy and FLOPs.

The Adaptive Strategy

Instead of a fixed rule, PPT uses a heuristic based on variance. The authors observed that in shallow layers, token importance scores are relatively uniform (low variance), making it hard to prune safely. In deeper layers, the model becomes more "certain," and importance scores vary wildly (high variance), making it easy to spot which tokens to prune.

  • Redundancy Discrimination: For every layer and every image, PPT calculates the variance of token significance scores.
  • Decision Rule: If the variance is above a threshold ($\tau$), the model assumes there are clear "winners" and "losers" and performs Token Pruning. If the variance is low, it assumes tokens are similar and performs Token Pooling (merging).
  • Instance-Awareness: Because this decision happens per-image, the model can be "cautious" with complex, information-rich images (preferring pooling) and "decisive" with simple images (preferring pruning).

Datasets

The researchers evaluated PPT primarily on the ImageNet-1K (ILSVRC2012) dataset, which contains approximately 1.28 million training images and 50,000 validation images. They tested the framework across several popular ViT architectures, including:

  • DeiT (Tiny, Small, and Base variants)
  • LV-ViT-S
  • T2T-ViT
  • PS-ViT

Key Insights and Ideas

  • Variance as a Compass: The discovery that the variance of significance scores increases with layer depth is the "aha moment." It provides a mathematically simple way to decide when to prune versus when to pool.
  • Synergy over Stacking: Pruning and pooling are complementary. Pruning handles "inattentive" redundancy (noise), while pooling handles "duplicative" redundancy (redundant signal). Using both allows for a much tighter compression of the model's "feature pyramid."
  • Zero-Parameter Efficiency: Because PPT relies on non-parametric scoring (like attention weights and cosine similarity), it can be applied to pre-trained models "off-the-shelf" with minimal accuracy drop, though fine-tuning yields the best results.

Key Results

PPT consistently outperforms state-of-the-art (SOTA) compression methods like ToMe and EViT.

  • DeiT-S Performance: PPT reduced FLOPs by 37% and boosted throughput by 45.8% (from 993 to 1448 images/sec) with zero accuracy loss (maintaining 79.8% Top-1 accuracy).
  • Off-the-Shelf Superiority: Even without fine-tuning, PPT showed a 0.1%–2.3% accuracy improvement over other methods at similar FLOP levels.
  • Visual Evidence: Qualitative results show that PPT effectively preserves the "foreground" objects while aggressively compressing the background through a mix of merging and discarding.
Figure 1: Visualizations of token compression results using dif- ferent methods on the ImageNet with DeiT-S. (a) Original images. (b) Token pruning methods, which discard inattentive tokens. (c) Token pooling methods, which merge similar tokens within the same color bounding box. (d) Our method can effectively address both types of redundancy while achieving superior performance.

Limitations and Future Work

The authors identify two main limitations:

  1. Task Specificity: PPT relies heavily on the classification [CLS] token to score the importance of other tokens. This makes it difficult to apply directly to "dense prediction" tasks like semantic segmentation or object detection, where every token needs to be preserved for spatial mapping.
  2. Self-Supervised Learning: Similarly, the method isn't currently designed for self-supervised learning frameworks that don't utilize a standard [CLS] token for global feature aggregation.

Future research could focus on developing importance metrics that don't rely on a single global token, potentially opening the door for PPT to accelerate a wider range of vision tasks.

Summary updated

BibTeX
@misc{wu2023ppt,
  author = {Xinjian Wu and Fanhu Zeng and Xiudong Wang and Xinghao Chen},
  title = {{PPT: Token Pruning and Pooling for Efficient Vision Transformers}},
  year = {2023},
  eprint = {2310.01812},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.01812},
}
Figure