Meta-learning Spiking Neural Networks with Surrogate Gradient Descent

Kenneth Michael Stewart, Emre Neftci

TL;DR

This paper introduces a framework for gradient-based meta-learning in Spiking Neural Networks (SNNs) by combining Model-Agnostic Meta-Learning (MAML) with twice-differentiable surrogate gradients. The approach enables SNNs to achieve high-accuracy, few-shot learning on event-based datasets using only a few large-magnitude weight updates, making it highly suitable for low-precision edge neuromorphic hardware.

What Problem Does This Paper Address?

Spiking Neural Networks (SNNs) are highly attractive for low-power edge computing because their event-based, asynchronous nature mimics the efficiency of the biological brain. However, training state-of-the-art SNNs typically requires long, iterative optimization processes, massive datasets, and high-precision weight updates.

This creates a severe mismatch with physical neuromorphic hardware operating at the edge, which must adapt in real-time under strict memory and power constraints. Furthermore, online learning on streaming data often suffers from correlated data samples and catastrophic forgetting. Standard deep learning relies on thousands of tiny, high-precision updates to generalize, but edge hardware needs a way to adapt rapidly with minimal data and low-precision memory.

Methods

The authors bridge this gap by applying Model-Agnostic Meta-Learning (MAML) to SNNs. MAML uses a bi-level optimization loops:

  • Outer Loop (Meta-Training): Optimizes a global parameter initialization ($\theta_0$) across a variety of tasks. This phase can be computed offline using resource-heavy optimizers like ADAM.
  • Inner Loop (Adaptation): Quickly adapts the initialized network to a specific unseen task using just one or a few steps of standard Stochastic Gradient Descent (SGD). This lightweight phase is ideal for edge hardware.
Meta-Learning framework for SNNs using surrogate gradients.

To compute the second-order gradients required by MAML's outer loop, the SNN must be twice-differentiable. However, the standard step function that dictates whether a neuron spikes is non-differentiable. The authors overcome this by using a surrogate gradient method with a smooth fast sigmoid function. Because this surrogate function can be differentiated twice, it unlocks standard second-order MAML optimization for spiking architectures.

Datasets

Meta-learning requires task-based datasets, but no standard benchmarks existed for event-based neuromorphic data where temporal dynamics are critical. To evaluate their method, the authors introduced two new benchmarks by combining existing event-based datasets:

  • Double N-MNIST: Pairs of digits from the Neuromorphic MNIST dataset combined into 100ms event streams to form double-digit numbers (100 total tasks).
  • Double ASL-DVS: Pairs of letters from the American Sign Language Dynamic Vision Sensor dataset (576 total tasks).
Examples of Double N-MNIST (top) and Double ASL-DVS (bottom) tasks.

Key Insights and Ideas

  • Twice-Differentiable Surrogates Unlock Meta-Learning: SNNs can leverage powerful second-order optimization techniques like MAML simply by choosing a smooth, twice-differentiable surrogate gradient function rather than a piecewise linear one.
  • Few, Large Updates: Conventional deep learning requires high-precision memory to accumulate millions of tiny gradients. In contrast, meta-trained SNNs can adapt to new tasks using a few large-magnitude updates. This allows edge hardware to use low-precision weight memory without sacrificing performance.
  • Feature Reuse Over Rapid Learning: By progressively freezing layers during adaptation, the authors discovered that MAML primarily optimizes the network to learn highly generalized features at initialization (feature reuse), rather than radically changing weights during the few-shot adaptation phase.

Key Results

  • State-of-the-Art Few-Shot Accuracy: In 1-shot, 5-way classification tasks, the MAML-trained SNN achieved 98.23% ± 1.12% accuracy on Double N-MNIST and 96.04% ± 2.31% on Double ASL-DVS, matching or outperforming equivalent non-spiking Artificial Neural Networks (CNNs).
  • Crucial Second-Order Gradients: First-order MAML (FOMAML), which ignores second-order terms to save memory, performed significantly worse (dropping to 92.63% on Double N-MNIST), proving the necessity of the twice-differentiable surrogate approach.
  • Superior to Transfer Learning: Conventional transfer learning required 9 to 10 shots of data to match the accuracy that the MAML-SNN achieved in just a single shot.

Limitations and Future Work

  • High Meta-Training Overhead: Computing second-order gradients through time over long sequences requires substantial memory and computational power during the offline meta-training phase.
  • Hardware Deployment: While the inner loop is mathematically optimized for edge constraints, this work was validated via simulation. The next major step is deploying and testing this framework directly on physical neuromorphic chips (such as Intel's Loihi) to process real-time streaming sensor data.

Summary updated

BibTeX
@inproceedings{stewart2022meta,
  author = {Kenneth Michael Stewart and Emre Neftci},
  title = {{Meta-learning Spiking Neural Networks with Surrogate Gradient Descent}},
  booktitle = {Neuromorph. Comput. Eng},
  year = {2022},
  doi = {10.1088/2634-4386/ac8828},
}
Figure