Abstract
This paper introduces a novel training framework for Spiking Neural Networks (SNNs) that dynamically allocates the number of time steps to different modules within a Vision Transformer (ViT). By allowing the network to "skip" unnecessary temporal computations in less sensitive layers, the authors achieve state-of-the-art accuracy on complex vision tasks with significantly lower latency and up to 17x better energy efficiency than non-spiking counterparts.
Introduction
Spiking Neural Networks (SNNs) are brain-inspired models attractive for edge computing due to their use of sparse binary pulses (spikes). This replaces expensive multiply-accumulate (MAC) operations with energy-efficient additions (AC). However, SNNs face a "time problem": achieving high accuracy typically requires multiple time steps, which increases latency. While time-step reduction has worked for Convolutional Neural Networks (CNNs), it often fails for Vision Transformers (ViTs), leading to either inefficiency or accuracy drops. This research identifies that different ViT components (e.g., self-attention vs. MLP blocks) have varying temporal sensitivities, a nuance ignored by fixed-time-step models.
Methodology: Dynamic Time Step Spiking (DTSS)
The core innovation is the Dynamic Time Step Spiking (DTSS) layer. Instead of a fixed duration ($T_{max}$), the framework introduces trainable score tensors that determine a layer's "importance" at each time step. These scores are converted into binary masks ($TM^t_l$); a zero mask allows the layer to skip computation, saving energy.
Key refinements include:
- Surrogate Gradient Learning: Enables training of non-differentiable binary masks.
- Layer Binning: Groups ViT layers (Patch Splitting, QKV, Attention, MLP) to apply dynamic stepping based on sensitivity.
- Architectural Adjustments: Replacing Layer Norm with Batch Norm and removing Softmax in attention blocks to maintain spike compatibility. As shown in the architecture, the dot-product attention is scaled without softmax because spiking inputs ensure outputs are non-negative and bounded.
Experimental Results
The DTSS framework was evaluated on CIFAR-10, CIFAR-100, and ImageNet. It consistently outperformed existing SNN-ViT models:
- ImageNet: Achieved 68.04% accuracy with an average of 1.30 time steps—a 2% improvement over 1-step baselines with 46% fewer steps than 2-step models.
- CIFAR-100: Reached 78.09% accuracy with 2.73 average time steps, reducing latency by ~36% compared to a 6-step Spikformer.
- Energy Efficiency: Demonstrated a 16.12x reduction in energy compared to non-spiking ViTs and a 2.98x reduction compared to previous state-of-the-art spiking ViTs.
Key Insights
Analysis of activation maps revealed that "qkv" and "mlp" modules are significantly more sensitive to temporal resolution than "sps" or "attn" modules. Dynamic allocation exploits this "slack" to balance accuracy and efficiency.
Beyond computational savings, skipping time steps reduces memory access for "membrane potentials," addressing a major energy bottleneck in edge hardware. The framework uses a hyperparameter ($\lambda_m$) to allow developers to tune the model for either maximum precision or maximum battery life.
Conclusion and Future Work
While DTSS proves theoretical gains, real-world deployment requires specialized hardware compilers for "zero-gating" logic. Future research will extend this dynamic temporal approach to object detection and video processing, where temporal dynamics are even more critical.
Summary updated