This paper introduces ToP-ViM, a novel framework for token pruning in Vision State Space Models (SSMs). While token pruning is a staple for making Vision Transformers (ViTs) more efficient, applying these same techniques to SSMs like Mamba leads to a catastrophic loss in accuracy. By introducing a "pruning-aware hidden state alignment" and a specialized importance metric, the researchers achieve significant computational savings (up to 41% FLOPs reduction) with negligible impact on performance.
The Problem: Why Standard Pruning Fails on SSMs
In the quest for efficient computer vision, Vision Transformers (ViTs) have reigned supreme, but their "quadratic complexity"—where the computational cost quadruples as the image resolution doubles—is a major bottleneck. State Space Models (SSMs), specifically the Mamba architecture, have emerged as a linear-complexity alternative that processes image patches (tokens) in a sequence.
To make ViTs even faster, researchers often use token pruning: identifying and discarding "unimportant" image patches (like background sky) mid-way through the network. However, when the authors tried to apply ViT pruning methods to SSMs, the models failed spectacularly, losing over 68% of their accuracy.
The core issue is that SSMs are path-dependent. Unlike Transformers, where every token can "see" every other token via global attention, SSMs process tokens in a specific scanning order. If you simply delete a token, the next token in the sequence suddenly has a new, "unnatural" neighbor. This disrupts the hidden state of the model, effectively "confusing" the network about the image's spatial structure.
The ToP-ViM Solution
The authors propose three primary innovations to fix the "broken" pruning process in SSMs:
- Pruning-Aware Hidden State Alignment: Instead of completely deleting a pruned token and closing the gap, the authors keep a "placeholder" for it in the sequence. For pruned tokens, the model still updates its internal hidden state based on the previous state (a "one-step forward" calculation) but ignores the actual input of the pruned patch. This ensures that the remaining tokens maintain their original relative positions and "neighborhoods" during the scan.
- Adapted Token Importance Evaluation: To decide which tokens to prune, the authors look at the output of the SSM blocks. They aggregate and clip the values across high-dimensional channels to create a saliency map. This metric proved more effective than standard norms (like $\ell_1$ or $\ell_2$) used in Transformers.
- Efficient Implementation: To ensure these "placeholders" don't eat up the speed gains, the authors developed a custom GPU kernel. This kernel intelligently switches between full computation for remaining tokens and a lightweight "state-only" update for pruned ones, resulting in actual wall-clock speedups.
Key Results and Insights
The researchers evaluated their method on standard computer vision benchmarks (ImageNet-1K, COCO 2017, and ADE20K) across several SSM backbones, including ViM (Vision Mamba) and PlainMamba.
- Efficiency vs. Accuracy: On ImageNet, the pruned PlainMamba-L3 achieved 81.7% accuracy with a 41.4% reduction in FLOPs.
- Superiority over ViT Baselines: When compared to applying the popular EViT pruning method directly to SSMs, ToP-ViM outperformed it by 3.8% to 4.0% in accuracy on the same hardware.
- Real-world Speedup: The method isn't just a theoretical reduction in math; it achieved a 1.43x throughput increase on NVIDIA V100 GPUs for the PlainMamba-L3 model.
- Downstream Tasks: The benefits translated well to object detection (COCO), where the pruned models maintained performance within 0.5% of the dense, unpruned versions.
The "Sequential Property" is Fragile: The most important takeaway is that SSMs are fundamentally different from Transformers regarding data geometry. In a Transformer, tokens are a "bag of words"; in an SSM, they are a "string of pearls." Breaking the string ruins the model. By calculating a simplified hidden state for pruned patches, ToP-ViM preserves the "spatial memory" of the model without the heavy lifting of full feature extraction.
Limitations and Future Work
The efficiency gains are currently limited by the baseline architecture. If the underlying SSM model isn't already optimized for the specific hardware, pruning can only do so much. Additionally, the SSM scan itself only accounts for 10–20% of the total computation in some models. While pruning tokens helps the entire model (including the linear layers), future work should look at accelerating the non-SSM parts of the blocks even further and exploring dynamic pruning rates that adapt to the complexity of the specific input image.
Summary updated