Abstract
Vision transformers dominate image processing tasks due to their superior performance. However, the quadratic complexity of self-attention limits the scalability of these systems and their deployment on resource-constrained devices. State Space Models (SSMs) have emerged as a solution by introducing a linear recurrence mechanism, which reduces the complexity of sequence modeling from quadratic to linear. Recently, SSMs have been extended to high-resolution vision tasks. Nonetheless, the linear recurrence mechanism struggles to fully utilize matrix multiplication units on modern hardware, resulting in a computational bottleneck. We address this issue by introducing VMeanba, a training-free compression method that eliminates the channel dimension in SSMs using mean operations. Our key observation is that the output activations of SSM blocks exhibit low variances across channels. Our VMeanba leverages this property to optimize computation by averaging activation maps across the channel to reduce the computational overhead without compromising accuracy. Evaluations on image classification and semantic segmentation tasks demonstrate that VMeanba achieves up to a 1.12x speedup with less than a 3% accuracy loss. When combined with 40% unstructured pruning, the accuracy drop remains under 3%.
Introduction
While Vision Transformers (ViTs) are the gold standard for accuracy, their self-attention mechanism scales quadratically with image resolution, posing challenges for high-resolution tasks. State Space Models (SSMs) like Mamba offer a linear-complexity alternative. However, the core "selective scan" operation is notoriously difficult to optimize for GPUs. Unlike standard matrix multiplications, it underutilizes specialized hardware units, creating a significant computational bottleneck. In models like VMamba, this operation can account for over 14% of total inference time.
The VMeanba Architecture
VMeanba is a training-free compression method that targets the selective scan operation by exploiting high channel redundancy. The researchers observed that the variance across channels in SSM blocks is remarkably low, suggesting that different channels perform similar computations.
Instead of performing the expensive selective scan across all $D$ internal channels, VMeanba applies a mean operation ($T$) to collapse the channels into a single dimension. The scan is executed on this 1D representation, and a broadcast operator ($T^{-1}$) is used to restore the original dimensions. To maximize efficiency, a custom CUDA kernel was developed specifically for this 1-channel scan, bypassing the overhead of high-dimensional implementations.
Layer Selection Strategy
Not every layer in a deep network is equally amenable to compression. VMeanba employs a greedy "Layer Selection Pipeline" to calculate an impact score for each layer. The method is then applied only to the $K$ least sensitive layers, allowing for a fine-tuned balance between computational speedup and model accuracy.
Experimental Results
The method was evaluated on ImageNet-1k for classification and ADE20k for semantic segmentation using pre-trained VMamba (Tiny, Small, and Base) backbones.
VMeanba achieved an overall model speedup of up to 1.12x. At the kernel level, the optimized scan operation ran up to 293x faster for long sequences. Crucially, accuracy loss was maintained under 3% by selecting an appropriate number of layers ($K$). Furthermore, the memory Read/Write requirements for the scan kernel dropped significantly—from 3.3GB to just 6.4MB in some configurations—enabling larger batch sizes and longer sequence processing.
Conclusion
VMeanba demonstrates that the internal dimensions of Visual SSMs are highly redundant. By collapsing these to a single dimension through a simple mean operation, significant hardware efficiency can be gained without retraining. This approach is orthogonal to other compression techniques like pruning and provides a practical path toward deploying high-performance SSMs on resource-constrained hardware.
Summary updated