Trimming Down Large Spiking Vision Transformers via Heterogeneous Quantization Search

Boxun Xu, Yufei Song, Peng Li

TL;DR

Researchers have developed SpikeHQ, a novel framework that slashes the energy and storage requirements of Spiking Vision Transformers (SNN-based ViTs) by up to 10x. By using a "heterogeneous" approach—automatically choosing between different math-friendly quantization schemes for each layer—they achieved high-performance computer vision on edge-device budgets with less than a 1% drop in accuracy.

What Problem Does This Paper Address?

Vision Transformers (ViTs) are the gold standard for many AI tasks, but they are notorious "power hogs," making them difficult to run on battery-powered devices like smartphones or drones. Spiking Neural Networks (SNNs) offer a solution; they mimic biological neurons by processing information as discrete "spikes," which is inherently more energy-efficient.

However, even Spiking ViTs have a weight problem. Most current models use 32-bit floating-point numbers for their internal parameters. This leads to massive model sizes and requires expensive multiplication hardware. While "quantization" (shrinking those 32-bit numbers to 2 or 4 bits) is a common fix, applying the same rules to every layer usually tanks the model's accuracy. The challenge is finding the "Goldilocks" quantization for every single layer in a complex transformer architecture.

Methods

The authors introduce SpikeHQ, which uses a Bi-level Neural Architecture Search (NAS) to automate the compression process. Instead of a one-size-fits-all approach, SpikeHQ searches for the best configuration for each layer from a mix of:

  • Uniform Quantization: Mapping weights to a standard integer grid (e.g., 2-bit or 4-bit integers).
  • Power-of-Two (PoT) Quantization: Mapping weights 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 is significantly faster and cheaper than a full multiplication.

To find the best setup, they use a Differentiable Search. They create a "supernet" where every layer is a weighted combination of all possible quantization choices. Using a technique called Gumbel-Softmax, the system "learns" which quantization scheme works best for each layer while simultaneously training the model's weights (Quantization-Aware Training). Crucially, they include a Hardware Loss function that penalizes the model for being too energy-intensive or taking up too much memory.

Datasets

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 sophisticated spatio-temporal event streams.

Key Insights and Ideas

  • Heterogeneity is Key: The "aha moment" is that different parts of a transformer have different needs. The first layer (the Tokenizer) and the last layer (Classification) are "bottlenecks" that require higher precision (4-bit uniform) to maintain accuracy. Meanwhile, the middle "attention" layers can often be squeezed down to 2-bit Power-of-Two schemes without much loss.
  • The Power of the Shift: By favoring Power-of-Two quantization in the middle layers, the researchers replaced energy-expensive Multiplier-Accumulator (MAC) units with much simpler Shift-Accumulator (SAC) units.
  • Automated Trade-offs: By adjusting a single hyperparameter ($\beta$), engineers can choose whether they want the absolute highest accuracy or the absolute lowest energy consumption, and the NAS will find the optimal architecture for that specific goal.

Key Results

SpikeHQ demonstrated that you don't need high-precision weights for high-performance spiking transformers:

  • 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.

Limitations and Future Work

  • The Tokenizer Bottleneck: The study identified the "Spiking Tokenizer" (the very first layer) as the primary energy and storage bottleneck. Even with quantization, it remains the most resource-heavy part of the network. The authors suggest that future research should focus on redesigning this specific component.
  • Hardware Specificity: The energy savings were modeled based on 45nm CMOS technology. While these are standard benchmarks, actual savings might vary on different specialized neuromorphic hardware (like Intel's Loihi or IBM's TrueNorth).
  • Search Complexity: While the differentiable search is efficient, it still requires training a "supernet," which is more computationally intensive than training a single standard model once.

Summary updated

BibTeX
@inproceedings{xu2025trimming,
  author = {Boxun Xu and Yufei Song and Peng Li},
  title = {{Trimming Down Large Spiking Vision Transformers via Heterogeneous Quantization Search}},
  booktitle = {ASAP},
  year = {2025},
  url = {https://openreview.net/forum?id=RSpJ7csVNg},
}
Figure