Adaptive Smoothing Gradient Learning for Spiking Neural Networks

Ziming Wang, Runhao Jiang, Shuang Lian, Rui Yan, Huajin Tang

TL;DR

Training Spiking Neural Networks (SNNs) is notoriously difficult because spikes are non-differentiable "all-or-none" events. This paper introduces Adaptive Smoothing Gradient Learning (ASGL), a method that allows a network to "evolve" from a smooth analog model into a discrete spiking model by making the gradient smoothing factor learnable and treating spikes as a form of injected noise.

What Problem Does This Paper Address?

Spiking Neural Networks are often considered the "third generation" of neural networks. They are prized for their extreme energy efficiency on neuromorphic hardware because they communicate via sparse, binary pulses (spikes) rather than continuous numbers. However, they are notoriously difficult to train using standard backpropagation.

The derivative of a spike (a Heaviside step function) is zero everywhere and infinite at the threshold, which effectively "kills" the gradient. The standard workaround is Surrogate Gradient (SG) learning, which uses a smooth, continuous function to approximate the gradient during the backward pass.

Gradient mismatch between the Heaviside operator and the surrogate clipping operator.

The problem with SG learning is that it creates a "gradient mismatch"—the smooth gradients don't perfectly represent the actual discrete loss landscape. Furthermore, the "width" (smoothness) of these surrogates is a sensitive hyperparameter that requires tedious manual tuning. If set incorrectly, the network's accuracy can severely degrade.

Methods: Adaptive Smoothing Gradient Learning

The authors propose ASGL, which moves away from fixed surrogate functions toward a dynamic, learnable approach:

Comparison of standard Surrogate Gradient learning and the proposed Adaptive Smoothing Gradient with noise injection.
  • Learnable Width ($\alpha$): Instead of picking a fixed smoothness for the surrogate function, the "width" parameter $\alpha$ is treated as a learnable variable updated via backpropagation.
  • Dual-Mode Forwarding: During training, the network operates in a hybrid state. It uses a random mask ($m$) to mix analog activations (smooth) and binary spikes (discrete).
  • Noise Injection: The difference between the smooth approximation and the actual binary spike is treated as "spike noise." By fusing this noise into the training process, the network learns to find gradients that are accurate even as the model transitions from analog-heavy to spike-heavy.
  • Evolutionary Training: As training progresses, the network adaptively adjusts its smoothing factor to align the smooth surrogate with the actual spiking dynamics, effectively evolving a prototype "noisy" network into a high-performance SNN.

Key Insights and Ideas

  • Correcting the Mismatch: The authors realized that gradient mismatch isn't just a nuisance; it's a fundamental optimization error. By making the surrogate function's shape learnable, the network "self-corrects" the mismatch.
  • Robustness is the Killer Feature: In standard SNN training, picking the wrong "width" for your surrogate can cause accuracy to crater (e.g., dropping from 93% to 30%). ASGL is remarkably robust; the learnable $\alpha$ allows the network to recover and reach high accuracy regardless of the starting point.
  • Soft Reset vs. Hard Reset: The method naturally implements a "soft reset" mechanism during training, where some membrane potential is retained after a spike, helping maintain a continuous flow of information for the gradients.

Key Results

The authors evaluated ASGL across a diverse range of data types—including static images, neuromorphic event streams, audio, and regression tasks—achieving State-of-the-Art (SOTA) performance across multiple benchmarks:

  • DVS-CIFAR10: Reached 84.50% accuracy, surpassing previous surrogate gradient and conversion methods.
  • DVS128 Gesture: Achieved 97.90% accuracy using a standard 8-layer SNN, outperforming even some specialized ANN architectures.
  • CIFAR-100: Achieved 77.74% accuracy with only 4 time steps, a significant result for deep SNNs which often struggle with complex datasets.
  • Energy Efficiency: The authors estimated that their ResNet-18 SNN on CIFAR-10 uses only 8.96% of the energy of an equivalent ANN while maintaining comparable accuracy.

Limitations and Future Work

While ASGL makes the width $\alpha$ learnable, the "noise probability" $p$ (which controls the ratio of spikes to analog values during training) remains a fixed hyperparameter. Future work could involve creating an automated "scheduler" for $p$, similar to learning rate decay. Additionally, while the dual-mode forwarding adds a slight layer of complexity to the training code, the final deployed model remains a pure, highly efficient SNN.

Summary updated

BibTeX
@inproceedings{wang2023adaptive,
  author = {Ziming Wang and Runhao Jiang and Shuang Lian and Rui Yan and Huajin Tang},
  title = {{Adaptive Smoothing Gradient Learning for Spiking Neural Networks}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=BjDzKKJiFo},
}
Figure