Introduction
Vision State Space Models (SSMs), particularly Vision Mamba Models (VMMs), have emerged as efficient alternatives to Vision Transformers (ViTs), offering sub-quadratic complexity. However, deploying these models on edge devices necessitates quantization to reduce memory and latency. While Post-Training Quantization (PTQ) typically requires real training data for calibration, privacy and security concerns often make this data inaccessible. Data-Free Quantization (DFQ) addresses this by using synthetic data, but existing DFQ methods designed for ViTs fail when applied to VMMs due to the lack of explicit self-attention and the presence of dynamic activation outliers.
OuroMamba is the first DFQ framework specifically engineered for VMMs. It introduces a novel synthetic data generation method and a dynamic mixed-precision quantization scheme to achieve state-of-the-art accuracy at ultra-low bit-widths without requiring original training data.
Overcoming the Challenges of VMM Quantization
1. Generating Semantically Coherent Synthetic Data
Unlike ViTs, VMMs rely on recurrent state transitions rather than explicit self-attention. This leads to "directional amnesia," where scanning mechanisms lose global spatial coherence as they traverse an image. Consequently, standard DFQ methods produce incoherent noise that fails to calibrate VMMs effectively, leading to significant accuracy drops (7-14%).
To solve this, OuroMamba-Gen constructs an "enhanced implicit attention" representation. By aggregating neighboring tokens into "patched hidden states" weighted by input gate values, the framework enables the model to capture long-range spatial interactions.
As shown in the figure above, the forward and backward scan state transitions illustrate how the model processes spatial information. By applying patch-level contrastive learning to these representations, OuroMamba-Gen successfully generates semantically meaningful synthetic images (e.g., cars, animals, landscapes) from pure noise, requiring only 128 images to achieve high-fidelity calibration.
2. Managing Dynamic Activation Outliers
In ViTs, activation outliers are typically static and confined to specific channels. In contrast, VMM activations exhibit dynamic outliers that shift across time-steps. Static quantization schemes cannot adapt to these variations, resulting in massive performance degradation at low bit-widths like W4A4.
OuroMamba-Quant introduces a dynamic mixed-precision approach. It utilizes a two-step process:
- Offline Calibration: Sets a static magnitude threshold based on synthetic data.
- Inference-Time Detection: Dynamically identifies outlier channels at each time-step using a lightweight scale-factor check.
By maintaining an adaptive "outlier list," the framework quantizes critical outliers at higher precision (e.g., 8-bit) while maintaining the rest of the activations at lower precision (e.g., 4-bit). This ensures accuracy is preserved without sacrificing the speed benefits of quantization.
Hardware Implementation and Performance
To realize the theoretical benefits of mixed-precision quantization, the authors developed a custom hybrid GEMM kernel using CUTLASS. This kernel efficiently handles the separate buffers for 4-bit inliers and 8-bit outliers, fusing the dequantization step to minimize memory overhead.
Key Results
- Accuracy: At W4A4, OuroMamba outperforms existing data-driven PTQ methods (like PTQ4VM) by an average of 7.84% on ImageNet. At W4A8, performance is near-lossless (<1.8% drop).
- Efficiency: The framework achieves superior results using significantly fewer images (128 synthetic vs. 1024 real images for baselines).
- Speedup: The custom hardware implementation delivers up to a 2.36x latency speedup on Vim-B and 1.63x on the Zigma diffusion model compared to FP16 baselines.
- Downstream Tasks: Significant gains were observed in object detection (+21.1 box AP) and semantic segmentation (+6.6 mIoU) at W4A4.
Conclusion
OuroMamba effectively bridges the gap between high-performance Vision Mamba Models and practical, data-secure deployment. By addressing the unique architectural characteristics of SSMs—specifically their scanning mechanisms and dynamic activation profiles—OuroMamba sets a new benchmark for data-free quantization in the post-Transformer era.
Summary updated