Rethinking Token Reduction for State Space Models

Zheng Zhan, Yushu Wu, Zhenglun Kong, Changdi Yang, Yifan Gong, Xuan Shen, Xue Lin, Pu Zhao, Yanzhi Wang

State Space Models (SSMs) like Mamba have emerged as powerful, subquadratic-time alternatives to Transformers, especially for long-sequence tasks. However, as these models scale to billions of parameters, inference efficiency remains a bottleneck. While "token reduction"—the process of pruning or merging redundant input tokens—is a standard technique for Transformers, simply porting these methods to SSMs often leads to significant performance degradation.

The Challenge of Token Reduction in SSMs

In Transformer architectures, tokens are often redundant, and techniques like EViT (pruning) or PuMer (merging) exploit this by removing or combining tokens to save computation. However, applying these methods to Mamba models results in catastrophic performance collapses. For instance, accuracy can drop by over 20% even with modest reduction rates.

Standard token reduction methods like EViT and PuMer cause significant accuracy drops when applied to Mamba models.

The core issue lies in the fundamental difference between Attention and SSMs. SSMs rely on a sequential state update mechanism. Pruning a token doesn't just remove its local information; it disrupts the hidden state propagation for all subsequent tokens. This information loss is amplified as the sequence progresses, leading to the observed failures.

Unified Token Reduction by Token Importance Classification (UTRC)

To address these issues, this paper introduces Unified Token Reduction by token importance Classification (UTRC). UTRC is a specialized post-training token reduction method that intelligently decides whether to prune or merge a token based on a novel importance metric.

Overview of the UTRC method, illustrating importance classification, the hybrid reduction strategy, and specific design choices for hidden states and residuals.

Key components of the UTRC module include:

  1. Importance Metric: Instead of attention maps, UTRC uses the clipped values of hidden states across channels. The high-dimensional channel space in SSMs provides a fine-grained distribution that effectively identifies critical tokens.
  2. Decoupling and Similarity Matching: Tokens are classified into "more important" and "less important" sets. Each less important token is matched to its most similar counterpart in the important set using cosine similarity.
  3. Hybrid Reduction Strategy: For matched pairs, the model performs a 50/50 split: half are pruned and half are merged. This balance eliminates redundancy while preserving essential contextual information.
  4. Intra-layer Design: The method treats hidden states and residual connections differently, utilizing merging for residual connections to preserve information flow from previous layers.

Experimental Results

The UTRC method was evaluated on six common-sense reasoning benchmarks, including LAMBADA, HellaSwag, and PIQA, using Mamba-1 and Mamba-2 architectures.

UTRC consistently outperformed SOTA Transformer baselines:

  • Accuracy: On Mamba-2, UTRC improved average accuracy by 5.7% to 13.1% compared to EViT and PuMer at equivalent FLOPs reduction levels.
  • Perplexity (PPL): While baselines often saw perplexity explode, UTRC maintained stable PPL. For Mamba-2.8B at 20% reduction, UTRC achieved a PPL of 23.97, compared to 9784.73 for EViT.
  • Efficiency: The method achieved up to 1.37x throughput speedup and reduced peak GPU memory usage by up to 40%.

Conclusion

SSMs are highly sensitive to sequence integrity. By recognizing that merging is generally safer than pruning for residual paths and that importance-based classification prevents the dilution of critical signals, UTRC provides a robust framework for efficient SSM inference. Future work may explore fine-tuning to further recover performance and extending the method to vision-based SSMs.

Summary updated

BibTeX
@inproceedings{zhan2024rethinking,
  author = {Zheng Zhan and Yushu Wu and Zhenglun Kong and Changdi Yang and Yifan Gong and Xuan Shen and Xue Lin and Pu Zhao and Yanzhi Wang},
  title = {{Rethinking Token Reduction for State Space Models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.100},
}
Figure