A2SG:Adaptive and Asymmetric Surrogate Gradients for Training Deep Spiking Neural Networks

Yechan Kang, Yongjin Kweon, Mingyeong Seo, Sohee Park, Yeonguk Jeon, Jongkil Park, Hyun Jae Jang, Jaewook Kim, YeonJoo Jeong, Suyoun Lee, Seongsik Park

TL;DR

Spiking Neural Networks (SNNs) offer incredible energy efficiency but suffer from training instability and poor generalization due to the non-differentiable nature of discrete spikes. This paper introduces $A^2SG$, a unified framework that dynamically adjusts surrogate gradients to be both adaptive across space/time and asymmetric based on internal neuron states. This approach flattens the loss landscape and resolves temporal gradient conflicts, yielding state-of-the-art accuracy and energy efficiency across both CNN and Transformer-based SNN architectures.

What Problem Does This Paper Address?

SNNs mimic biological brains by communicating via discrete "spikes," making them highly attractive for low-power edge computing. However, because the spiking function is a non-differentiable step function, standard backpropagation cannot be directly applied. Researchers typically bypass this using "surrogate gradients" (SGs) to approximate the derivative during the backward pass.

Unfortunately, standard SGs introduce two major bottlenecks:

  1. Sharp Loss Landscapes: Narrow surrogate windows amplify the magnitude of the Hessian matrix, driving optimization toward sharp minima that generalize poorly to unseen data.
  2. Temporal Gradient Confusion: SNNs process data over multiple timesteps. Standard backpropagation aggregates gradients across time, but if gradients from different timesteps point in conflicting directions, they partially cancel each other out, destabilizing training.

Methods

The authors propose $A^2SG$ (Adaptive and Asymmetric Surrogate Gradients), which replaces static, symmetric surrogate functions with a two-pronged dynamic strategy:

  1. Spatio-Temporal Adaptation (ST-ASG): Instead of using a fixed window width ($\beta$) for the surrogate function, $A^2SG$ employs a Bayesian search strategy (Gaussian Process optimization) to dynamically tune $\beta$ during training. Spatial adaptation minimizes spatial gradient variation (SGV) at the final timestep to promote flatter minima. Temporal adaptation aligns gradients across preceding timesteps to maximize temporal gradient consistency (TGC), preventing conflicting updates.
  2. Asymmetric Surrogate Gradients (ASY): Traditional SGs are symmetric around the firing threshold. $A^2SG$ introduces an asymmetric function that allocates larger gradients to neurons with higher accumulated membrane potentials (i.e., those closer to firing). The authors mathematically prove that this asymmetry inherently reduces local gradient variance compared to symmetric alternatives like Boxcar or Triangle functions.
Overview of the proposed A2SG framework showing effective window modulation, temporal/spatial adaptation, and loss landscape effects.

Datasets

The framework was evaluated across a diverse set of tasks and architectures:

  • Static Image Classification: CIFAR-10, CIFAR-100, and ImageNet.
  • Neuromorphic (Event-based) Classification: CIFAR10-DVS.
  • Semantic Segmentation: ADE20K (using SNN backbones like E-SpikeFormer).

Key Insights and Ideas

  • Curvature vs. Smoothness: A key finding is that simply making a surrogate gradient function "smooth" (such as using an Arctan function) reduces the irregularity of the loss landscape but does not reduce its overall sharpness (curvature). Asymmetry, rather than smoothness, is the decisive factor for flat-minima convergence.
  • Gradient Variance Dictates Flatness: The authors establish a direct mathematical link showing that the largest eigenvalue of the Fisher Information Matrix (a proxy for loss landscape curvature) grows linearly with the coefficient of variation of local gradients. Lowering gradient variance directly flattens the landscape.
  • Neuron Behavior-Aware Design: Treating all neurons identically regardless of their internal state wastes gradient updates. Prioritizing neurons that are closer to firing focuses gradient allocation, reducing unnecessary variability and stabilizing optimization.

Key Results

  • Flatter Landscapes: Visualizations and Fisher Information Matrix (FIM) eigenvalue measurements confirm that $A^2SG$ leads to significantly flatter loss landscapes compared to standard Boxcar or Triangle surrogates.
Visualization of the loss landscape demonstrating that A2SG leads to a flatter region compared to conventional surrogate gradients.
  • State-of-the-Art Performance: On CIFAR-100 with ResNet19, $A^2SG$ achieved 81.05% accuracy, outperforming previous adaptive methods like LSG (76.85%) and state-of-the-art methods like MPD-AGL (80.49%). On ImageNet, it boosted E-SpikeFormer performance to 85.43%.
  • Energy Efficiency: $A^2SG$ consistently reduced total spike counts (e.g., from 94.6k to 84.9k on CIFAR-10 using VGG16), which directly translates to lower power consumption on neuromorphic hardware.
  • Task Versatility: Beyond classification, the method achieved a higher mIoU (40.94%) on the ADE20K semantic segmentation dataset while reducing energy consumption compared to baseline models.

Limitations and Future Work

  • Theoretical Open Problems: While the empirical and statistical evidence is strong, providing a formal, rigorous convergence proof for surrogate gradients under this framework remains an open theoretical challenge.
  • Hyperparameter Formalization: The exact error bound for the asymmetric surrogate as a function of its gradient-bias hyperparameter ($h$) requires deeper mathematical formalization in future work.

Summary updated

Abstract

Training deep spiking neural networks (SNNs) remains challenging due to sharp loss landscapes and temporal inconsistency caused by surrogate gradients. To address these challenges, we propose a unified framework: adaptive and asymmetric surrogate gradients A2SG. The adaptive gradients adjust an effective window for spatio-temporal adaptation, reducing spatial gradient variation and maintaining directional consistency of gradients over time. The asymmetric gradients reflect neuronal dynamics by assigning larger gradients to neurons with higher membrane potentials, and we prove that they yield lower variation than symmetric surrogates. Our analysis further establishes a direct connection between local gradient variation and the curvature of the loss landscape, providing a principled explanation for how A2SG promotes convergence to flatter minima and improves generalization. We conduct extensive experiments on diverse models, including CNN-based and Transformer-based SNNs, across various tasks such as image classification using both static and neuromorphic datasets, as well as segmentation. The results demonstrate that A2SG consistently improves accuracy and energy efficiency, establishing it as a general and reliable solution for training deep SNNs. Our code is available at https://github.com/KIST-NCL/A2SG.git.
BibTeX
@inproceedings{kang2026sg,
  author = {Yechan Kang and Yongjin Kweon and Mingyeong Seo and Sohee Park and Yeonguk Jeon and Jongkil Park and Hyun Jae Jang and Jaewook Kim and YeonJoo Jeong and Suyoun Lee and Seongsik Park},
  title = {{A2SG:Adaptive and Asymmetric Surrogate Gradients for Training Deep Spiking Neural Networks}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=4fX2DEypNL},
}
Figure