Saliency-Driven Token Merging for Vision Transformers

Weiying Xie, Xiaoyu Chen, Xin Zhang, Chenhe Hao, Jitao Ma, Yunsong Li, Leyuan FangCVPR 2026

TL;DR

SAD-TM is a training-free token merging method for Vision Transformers (ViTs) that accelerates inference by combining dynamic attention scores with offline-computed visual saliency metrics. By identifying and merging "saliency outlier" tokens that deviate from global gradient directions, it achieves significant FLOPs reductions with negligible accuracy loss. A key variant, SAD-TM-DM, defers merging in early layers where attention is unstable, further preserving model performance.

What Problem Does This Paper Address?

Vision Transformers (ViTs) have set new benchmarks across visual tasks, but their computational appetite remains a major bottleneck. The core issue lies in the self-attention mechanism, where computational complexity scales quadratically ($N^2$) with the number of visual tokens (patches).

To make ViTs more efficient, researchers typically turn to token pruning (discarding redundant tokens) or token merging (fusing similar tokens). While merging is generally preferred because it avoids outright information loss, existing methods suffer from a major flaw: they decide which tokens to merge based solely on layer-specific attention parameters. Because attention maps fluctuate drastically from the bottom to the top of a network, these methods lack a stable, global criterion for token importance. As a result, they often require expensive model retraining or fine-tuning to maintain accuracy.

Methods

The authors introduce SAliency-Driven Token Merging (SAD-TM), a training-free framework that establishes a global token importance metric by bridging semantic relevance with latent visual saliency.

The workflow consists of two primary components:

  1. Offline Visual Saliency: Before inference, the framework computes a saliency map for input patches via backpropagation gradients (the relationship between model input and output). By calculating the pairwise Pearson correlation coefficients between patch saliency vectors, they derive a "saliency outlier score." Tokens with high outlier scores deviate from the global gradient direction, signaling that they contain redundant or inconsistent information and can be safely merged.
  2. Online Semantic Relevance: During the forward pass, standard class attention scores are dynamically averaged across all attention heads.

These two metrics are combined via a weighted sum to produce a final importance score. Tokens with the lowest scores are funneled into a merging set and fused with the most similar tokens in a candidate set using a similarity-weighted average.

Figure 1. Overall workflow of our proposed SAD-TM. On one hand, saliency statistics can be precomputed in an offline manner by providing a cross-layer global importance indicator. This helps to enhance the causal awareness between inputs and outputs. On the other hand, class attention scores are dynamically computed during inference as forward propagation proceeds to capture semantic relevance. To this end, SAD-TM unifies the two via a weighted sum to achieve an optimal balance.

Deferred Merging Strategy (SAD-TM-DM)

Through systematic layer analysis, the authors discovered that class attention varies wildly across the early blocks of a ViT as the network focuses on low-level feature exploration. To counter this instability, they propose a variant called SAD-TM-DM, which suspends token merging entirely for the first few layers ($\tau$), allowing the attention mechanism to stabilize before any compression occurs.

Datasets

The authors validated their approach on the standard ImageNet dataset. They evaluated SAD-TM across a diverse suite of pre-trained ViT architectures, including DeiT (Tiny, Small, Base), MAE (Base, Large, Huge), and LV-ViT-S, ensuring a thorough assessment of the method's robustness.

Key Insights and Ideas

  • Saliency as a Global Anchor: While internal attention parameters shift dramatically between layers, input-output gradient saliency provides a robust, cross-layer consistent metric of what the model actually finds important.
  • Outliers are Safe to Merge: Counterintuitively, tokens that act as statistical outliers in the saliency space are the safest to merge because their deviation from the global gradient direction implies they represent noise or redundant data.
  • Early Attention Instability: By analyzing Mean Squared Error (MSE) between adjacent layers, the authors proved that early ViT blocks exhibit massive attention variance. Deferring compression until later layers yields much more robust results.
  • Cross-Model Transferability: Saliency maps computed on one model (e.g., DeiT-Tiny) can be successfully transferred to guide token merging in a completely different model (e.g., DeiT-Base) as long as they share the same patch size, making the offline precomputation highly reusable.

Key Results

SAD-TM and its deferred variant consistently outperformed existing token pruning and merging techniques without requiring a single epoch of retraining:

  • DeiT-Tiny: Achieved a 23.08% reduction in FLOPs with virtually zero drop in Top-1 accuracy (72.02% vs. 72.17% baseline).
  • DeiT-Small: Reduced FLOPs by 43.48% with only a 0.6% accuracy loss using standard SAD-TM. The deferred variant (SAD-TM-DM) reduced FLOPs by 28.26% while losing a mere 0.09% accuracy.
  • Massive Models (MAE-Huge): Maintained high accuracy (86.58% and 86.42%) while yielding significant FLOPs reductions of 39.01% and 44.68% respectively, outperforming other training-free alternatives.

Limitations and Future Work

While powerful, SAD-TM relies on two hyperparameters ($\alpha$ and $\beta$) to balance the contribution of attention and saliency scores. The authors note that an equal 0.5/0.5 split isn't always optimal, meaning some manual tuning is required for peak performance. Additionally, while the inference phase is highly efficient, the method still requires an offline preprocessing step to generate the initial saliency maps.

For future work, the authors suggest exploring automated methods to adaptively determine the optimal layer threshold ($\tau$) for deferred merging and extending the framework to downstream tasks like object detection and semantic segmentation.

Summary updated

BibTeX
@inproceedings{xie2026saliency,
  author = {Weiying Xie and Xiaoyu Chen and Xin Zhang and Chenhe Hao and Jitao Ma and Yunsong Li and Leyuan Fang},
  title = {{Saliency-Driven Token Merging for Vision Transformers}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=OkrPIllBT7},
}
Figure