Abstract
Spiking Vision Transformers (SNN-ViTs) offer a promising path toward energy-efficient computer vision by mimicking biological neural processing. However, their large memory footprint and high-precision weight requirements hinder deployment on resource-constrained edge devices. We present SpikeHQ, a framework that employs heterogeneous quantization search to drastically reduce energy and storage demands. By automatically selecting optimal quantization schemes for each layer, SpikeHQ achieves up to 10x reduction in memory and energy with minimal accuracy loss (<1%) across several neuromorphic datasets.
Introduction
Vision Transformers (ViTs) have set new benchmarks in computer vision but remain computationally expensive, particularly for battery-powered edge devices. Spiking Neural Networks (SNNs) address this by using discrete "spikes" for information processing, which is inherently more efficient. Despite this, Spiking ViTs often rely on 32-bit floating-point parameters, leading to significant memory overhead and requiring complex multiplication hardware.
Standard quantization techniques often fail to maintain accuracy when applied uniformly across all layers of a complex transformer. The core challenge lies in identifying the optimal precision for each specific layer to balance performance and efficiency.
Methodology: The SpikeHQ Framework
SpikeHQ introduces a Bi-level Neural Architecture Search (NAS) to automate layer-wise compression. Rather than a one-size-fits-all approach, the framework explores a search space of heterogeneous quantization schemes:
- Uniform Quantization: Weights are mapped to a standard integer grid (e.g., 2-bit or 4-bit integers).
- Power-of-Two (PoT) Quantization: Weights are mapped to values like $2^{-1}, 2^{-2}$, etc. This is a "hardware hack"—in digital logic, multiplying by a power of two is just a simple bit-shift, which allows replacing expensive Multiplier-Accumulator (MAC) units with efficient Shift-Accumulator (SAC) units.
The search process utilizes a Differentiable Search on a "supernet" where every layer is a weighted combination of all possible quantization choices. Using Gumbel-Softmax, the system learns the best quantization configuration for each layer during Quantization-Aware Training (QAT). A specialized Hardware Loss function guides the optimization toward configurations that minimize energy consumption and memory storage.
Experimental Setup
The researchers evaluated SpikeHQ on three widely recognized neuromorphic (event-based) datasets:
- DVS128 (DVS Gesture): 11 hand gesture categories captured by event-based cameras.
- N-Caltech101: A spiking version of the classic Caltech101 object recognition dataset.
- CIFAR10-DVS: An event-stream version of the CIFAR-10 dataset, converted from static images into 10,000 spatio-temporal event streams.
Key Insights and Results
The research highlights that different transformer components have varying precision requirements. The Tokenizer and Classification layers act as precision bottlenecks, typically requiring 4-bit uniform quantization to maintain accuracy. In contrast, internal Attention layers can often be compressed to 2-bit PoT schemes without significant degradation.
Performance Metrics
SpikeHQ demonstrated substantial improvements over standard floating-point models:
- Massive Compression: Achieved model compression rates between 8.71× and 10.19× compared to standard floating-point models.
- Energy Efficiency: Reduced energy consumption by 5.69× to 10.2×.
- Minimal Accuracy Loss: On the DVS Gesture and CIFAR10-DVS datasets, the models maintained an average effective resolution of only 3.14–3.67 bits while keeping the accuracy drop under 1%.
- Final Scores: Attained top-tier accuracy of 85.3% on N-Caltech101, 97.57% on DVS-Gesture, and 80.4% on CIFAR10-DVS.
Discussion and Future Work
While SpikeHQ significantly optimizes Spiking ViTs, the Spiking Tokenizer remains a primary resource bottleneck. Future efforts may focus on architectural redesigns of this initial layer. Additionally, while the energy models are based on standard 45nm CMOS benchmarks, performance may vary across specialized neuromorphic hardware like Intel's Loihi. The search complexity, involving "supernet" training, also presents an area for further optimization.
Conclusion
SpikeHQ provides a robust solution for deploying high-performance Spiking Vision Transformers on edge devices. By leveraging heterogeneous quantization and automated search, it bridges the gap between the high accuracy of Transformers and the extreme efficiency required for real-world neuromorphic applications.
Summary updated