Faster Vision Mamba is Rebuilt in Minutes via Merged Token Re-training

Mingjia Shi, Yuhao Zhou, Ruiji Yu, Zekai Li, Zhiyuan Liang, Xuanlei Zhao, Xiaojiang Peng, Tanmay Rajpurohit, Shanmukha Ramakrishna Vedantam, Wangbo Zhao, Kai Wang, Yang YouarXiv 2024 · DOI

Abstract

Vision Mamba (Vim) has emerged as a high-efficiency alternative to Vision Transformers (ViTs) due to its linear scaling properties. However, standard token reduction techniques like pruning, which work well for ViTs, often lead to significant performance degradation in Mamba-based architectures. This paper identifies the "Enrichment Effect"—a phenomenon where sequential processing causes information to accumulate in later tokens—as the primary cause of this sensitivity. We propose R-MeeTo, a framework that replaces token pruning with merging and utilizes a high-speed, 3-epoch re-training phase to recover accuracy. R-MeeTo achieves up to a 1.5× inference speedup on ImageNet-1K with minimal accuracy loss, with the entire optimization process taking only minutes.

Introduction

As vision models move toward real-time edge applications, reducing computational overhead through token reduction is critical. While Vision Transformers (ViTs) handle token pruning effectively due to their parallel nature, Vision Mamba (Vim) models exhibit a sharp drop in accuracy when tokens are simply discarded. This research investigates the architectural reasons for this sensitivity and introduces a robust, "minute-level" solution for compressing Vision Mamba models.

The Enrichment Effect and Token Asymmetry

The core challenge in reducing Mamba tokens lies in the Enrichment Effect. Unlike the parallel attention mechanism in Transformers, Mamba’s State Space Model (SSM) processes tokens sequentially. As the model traverses a sequence, each token absorbs and accumulates information from its predecessors. Consequently, tokens are not informationally equivalent; those appearing later in the sequence often carry more "general knowledge" about the entire image.

The Enrichment Effect: Sequential processing in SSMs leads to asymmetric information distribution across tokens, making them highly sensitive to removal.

This asymmetry means that deleting tokens—especially those at the end of a sequence—disrupts the context required for accurate classification. Mathematical analysis (Theorem 1 in the original paper) confirms that later tokens contain higher mutual information regarding the overall input compared to earlier ones, explaining why Mamba is uniquely sensitive to token order and pruning.

Methodology: The R-MeeTo Framework

To address these limitations, the authors propose R-MeeTo, which consists of two primary components:

  1. Token Merging: Instead of discarding "unimportant" tokens, R-MeeTo identifies similar tokens using cosine similarity and merges them. This approach preserves the essential features that would otherwise be lost during pruning, maintaining the integrity of the information flow.
  2. Minute-Level Re-training: Merging tokens alters the data distribution, which initially impacts model performance. However, the researchers discovered that a full re-training is unnecessary. A brief "re-calibration" phase of just 3 epochs is sufficient to adapt the model to the reduced token set. This process is extremely efficient, taking as little as 5 to 17 minutes depending on the model size.

Experimental Results

The R-MeeTo framework was evaluated on ImageNet-1K across various Vim scales (Tiny, Small, and Base). The results demonstrate a superior trade-off between speed and accuracy compared to existing token reduction methods.

Performance comparison of R-MeeTo against baseline and state-of-the-art token reduction methods on ImageNet-1K.

Key findings include:

  • Significant Accuracy Recovery: For the Vim-Ti model, R-MeeTo provided a 35.9% accuracy boost over training-free baselines after only 3 epochs of re-training.
  • Inference Speedup: On an NVIDIA RTX 4090, the framework delivered up to a 1.5× throughput increase. For example, a Vim-S model maintained high accuracy (79.9%) while significantly reducing FLOPs from 5.08G to 3.58G.
  • Generalization to Video: The method also proved effective for VideoMamba on the Kinetics-400 dataset, where temporal redundancy makes token merging even more impactful.

Conclusion

R-MeeTo demonstrates that Vision Mamba models can be made significantly faster without the heavy cost of traditional fine-tuning. By understanding the sequential nature of SSMs and replacing pruning with merging, researchers can rebuild efficient, high-performance models in minutes. Future work will explore the application of R-MeeTo to dense prediction tasks like object detection and semantic segmentation.

Summary updated

BibTeX
@misc{shi2024faster,
  author = {Mingjia Shi and Yuhao Zhou and Ruiji Yu and Zekai Li and Zhiyuan Liang and Xuanlei Zhao and Xiaojiang Peng and Tanmay Rajpurohit and Shanmukha Ramakrishna Vedantam and Wangbo Zhao and Kai Wang and Yang You},
  title = {{Faster Vision Mamba is Rebuilt in Minutes via Merged Token Re-training}},
  year = {2024},
  eprint = {2412.12496},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.12496},
}
Figure