Abstract
Spiking Vision Transformers (SViTs) offer a promising path toward energy-efficient computer vision by leveraging sparse, event-driven computation. However, their substantial memory requirements remain a barrier for edge deployment. This paper presents QSViT, a systematic methodology for compressing SViTs through mixed-precision quantization. By identifying layer-specific sensitivities, QSViT achieves a 22.75% reduction in memory and a 21.33% reduction in power consumption on ImageNet, maintaining accuracy within 2.1% of the full-precision baseline.
Introduction
Vision Transformers (ViTs) have redefined state-of-the-art performance across various computer vision tasks. Despite their success, their massive parameter counts and high computational demands pose significant challenges for deployment on resource-constrained edge devices, such as drones and wearable sensors. Spiking Vision Transformers (SViTs) have emerged as a bio-inspired alternative, utilizing discrete spikes to reduce energy consumption. Yet, even SViTs often require 210MB–250MB of memory, necessitating further compression.
Quantization—the process of reducing the bit-width of model weights—is a standard approach for model compression. However, uniform quantization often leads to catastrophic accuracy loss in SViTs due to the varying sensitivities of different architectural components. This work introduces QSViT, a four-stage methodology designed to optimize the precision of individual layers to balance efficiency and performance.
The QSViT Methodology
The QSViT framework employs a structured approach to determine the optimal mixed-precision configuration for an SViT using Post-Training Quantization (PTQ). The methodology consists of four primary stages:
- Layer-wise Sensitivity Analysis: Each quantizable layer, including convolutional (CONV), linear, and attention weights, is evaluated independently at 16, 12, 8, and 4-bit precisions. This identifies how precision reduction in specific layers impacts overall model accuracy.
- Establishing Precision Boundaries: Two reference points are defined:
bSettingH(the highest precision required for stability) andbSettingL(the minimum precision before total performance collapse). - Guided Quantization Strategy: Using the boundaries established in the previous stage, the methodology explores the "sweet spot" for each layer. The goal is to find the lowest possible bit-width that keeps accuracy degradation within a 5% threshold.
- Network Assembly and Evaluation: The final mixed-precision model is assembled and benchmarked against the original 32-bit floating-point baseline.
Key Insights: Sensitivity and Robustness
The research reveals critical insights into the internal dynamics of SViTs. A primary finding is that Spike-Driven Self-Attention (SDSA) modules are exceptionally fragile. Quantizing these weights even to 16-bit resulted in significant accuracy drops, leading the methodology to maintain these components at 32-bit precision.
In contrast, Convolutional layers and downsampling blocks proved remarkably robust. Many of these layers could be reduced to 8-bit or 4-bit precision with minimal impact on performance. Interestingly, sensitivity was found to be stage-dependent; for instance, 4-bit quantization in Stage-1 downsampling blocks was detrimental, while the same precision was acceptable for Stage-3 downsampling. These findings underscore the necessity of a mixed-precision approach over a "one-size-fits-all" strategy.
Experimental Results
The methodology was validated using the SDTv2 (Spike-Driven Transformer v2) architecture on the ImageNet dataset. The results demonstrate that QSViT effectively bridges the gap between high-performance transformers and edge-ready models:
- Accuracy: The quantized model achieved a 76.8% top-1 accuracy, representing a modest 2.1% drop from the 78.9% baseline.
- Efficiency: Memory footprint was reduced from 211MB to 163MB (a 22.75% saving).
- Power: Testing on an Nvidia RTX 4090 showed a power reduction from 319.66W to 251.48W (a 21.33% saving).
Compared to other SViT variants like Spikformer (74.8%), QSViT provides higher accuracy while maintaining a significantly smaller memory footprint.
Conclusion and Future Work
QSViT demonstrates that strategic, mixed-precision quantization can significantly enhance the deployability of Spiking Vision Transformers. While the current work focuses on Post-Training Quantization (PTQ), future research into Quantization-Aware Training (QAT) may further narrow the accuracy gap. Additionally, while the power savings are notable on standard GPUs, the methodology's impact is expected to be even more pronounced on specialized neuromorphic hardware or FPGAs. Expanding this approach to complex tasks such as object detection and semantic segmentation remains a vital next step.
Summary updated