TL;DR
Vision Mamba (Vim) models offer an efficient, linear-complexity alternative to Vision Transformers, but they suffer from severe overfitting when scaled up. This paper introduces Stochastic Layer-Wise Shuffle (SLWS), a zero-overhead, plug-and-play regularization technique that progressively shuffles token sequences in deeper layers to build position-invariant semantic representations. Combined with masked feature distillation, SLWS successfully prevents model collapse and sets a new state-of-the-art for Vision Mamba on ImageNet-1K.
What Problem Does This Paper Address?
While Vision Transformers (ViTs) dominate computer vision, their self-attention mechanism suffers from quadratic complexity relative to the number of image tokens. State Space Models (SSMs), specifically Mamba, have emerged as a promising alternative due to their hardware-friendly, linear-complexity design.
However, adapting Mamba from 1D text sequences to 2D images requires flattening image patches into a 1D sequence and using fixed scanning paths. This artificial serialization causes a major bottleneck: when researchers try to scale up Vision Mamba (Vim) models, they encounter severe overfitting and even total model collapse. The fixed scanning paths don't naturally align with 2D spatial contexts, causing the model to overfit to exact token positions rather than learning robust visual semantics. This paper aims to solve Vim's scaling and overfitting challenges without altering its efficient underlying architecture.
Methods
The authors propose Stochastic Layer-Wise Shuffle (SLWS), a simple yet highly effective regularization technique applied during training (and completely deactivated during inference).
For each non-hierarchical Vim layer, SLWS operates in four distinct steps:
- Probability Allocation: Each layer is assigned a shuffle probability ($p_\ell$) that increases linearly with layer depth.
- Operation Sampling: A Bernoulli trial determines whether the current layer will undergo shuffling.
- Sequence Shuffling: If selected, the input token sequence is randomly permuted, disrupting the fixed 1D scanning order.
- Order Restoration: Crucially, after the layer processes the shuffled tokens, the output tokens are rearranged back into their original sequence order before being passed to the next layer.
Masked Feature Distillation (MFD)
To further boost performance, the authors integrate SLWS into a Masked Feature Distillation pre-training pipeline. A large portion of image patches are masked out, and the Vim student model processes the remaining visible patches. A lightweight transformer decoder then attempts to reconstruct feature representations that match targets produced by a frozen, semantic-rich teacher model (a CLIP vision encoder).
Datasets
The proposed methods were evaluated on standard, widely accepted vision benchmarks:
- ImageNet-1K: Used for supervised classification training from scratch, pre-training, and fine-tuning evaluation (1.28 million images).
- ADE20K: Used to evaluate downstream performance on semantic segmentation.
- COCO2017: Used to evaluate downstream performance on object detection and instance segmentation.
Key Insights and Ideas
- Hierarchical Semantic Abstraction: Shallow layers in a vision network need strict positional sensitivity to capture low-level features like edges and textures. Deeper layers, however, focus on high-level semantics where exact patch coordinates matter less. Linearly scaling up the shuffle probability in deeper layers perfectly matches this cognitive hierarchy.
- The Power of Order Restoration: Simply shuffling tokens across the entire network would destroy spatial coherence entirely. Rearranging the tokens back to their original order at the end of each block prevents chaotic recursive disruptions, ensuring subsequent layers still receive structured inputs.
- Effective Regularization: As shown in the loss curves, SLWS forces the model to stabilize at a higher training loss but yields a significantly lower evaluation loss, proving it successfully mitigates overfitting.
Key Results
- Supervised Classification Boost: On ImageNet-1K, SLWS improved the accuracy of the base model (Vim-B) by 2.9% (jumping from 79.8% to 82.7%).
- Preventing Model Collapse: While a large vanilla Vim model (Vim-L) completely collapsed during standard supervised training, applying SLWS stabilized the training completely, achieving 82.9% accuracy.
- State-of-the-Art Pre-training: When combined with Masked Feature Distillation, SLWS allowed the largest model variant (MambaMLP-H) to reach 87.6% top-1 accuracy on ImageNet-1K, establishing a new state-of-the-art for Vision Mamba models and outperforming competitive ViT baselines.
- Downstream Tasks: In dense prediction tasks like object detection on COCO, a base Mamba model trained with SLWS outperformed both ViT-Adapter-B and ConvNeXt-B by 0.7 points ($AP^b$).
Limitations and Future Work
The primary limitation of SLWS is its incompatibility with hierarchical Mamba architectures. Hierarchical models utilize spatial downsampling operations that reduce the token sequence length mid-network. Because the token count changes, it is mathematically impossible to perform the final "order restoration" step.
Future work will focus on adapting position-invariant regularization strategies to hierarchical models and exploring alternative scanning mechanisms that natively handle 2D spatial relationships without succumbing to overfitting.
Summary updated