Source-linked AI summary
Event-Based Backpropagation can compute Exact Gradients for Spiking Neural Networks
Timo C. Wunderlich, Christian Pehle
TL;DR
Spiking networks need a way to train through discrete spikes without replacing their hard thresholds with approximations. This work derives EventProp by combining adjoint dynamics with partial-derivative jumps, obtaining exact event-based gradients and competitive results on Yin-Yang and MNIST, while identifying critical-point divergences as a limitation.
Problem
Hard spike thresholds obstruct straightforward gradient computation in spiking neural networks, so common approaches use smoothed, stochastic, or surrogate neuron models.
Method
EventProp combines the adjoint method with partial-derivative jumps to backpropagate errors at spike times and compute exact gradients for general losses.
Results
EventProp trains single-hidden-layer spiking networks with competitive classification performance on the Yin-Yang and MNIST datasets.
Takeaways & Limitations
EventProp provides an event-based gradient-computation framework that stores forward state primarily at spike times and is amenable to neuromorphic implementation.
Takeaways & Limitations
Gradients can diverge near parameters where the membrane potential becomes tangent to threshold, and common losses do not selectively add or remove spikes at such critical points.
Abstract
from arXiv · showhide
Spiking neural networks combine analog computation with event-based communication using discrete spikes. While the impressive advances of deep learning are enabled by training non-spiking artificial neural networks using the backpropagation algorithm, applying this algorithm to spiking networks was previously hindered by the existence of discrete spike events and discontinuities. For the first time, this work derives the backpropagation algorithm for a continuous-time spiking neural network and a general loss function by applying the adjoint method together with the proper partial derivative jumps, allowing for backpropagation through discrete spike events without approximations. This algorithm, EventProp, backpropagates errors at spike times in order to compute the exact gradient in an event-based, temporally and spatially sparse fashion. We use gradients computed via EventProp to train networks on the Yin-Yang and MNIST datasets using either a spike time or voltage based loss function and report competitive performance. Our work supports the rigorous study of gradient-based learning algorithms in spiking neural networks and provides insights toward their implementation in novel brain-inspired hardware.
1 Introduction
Spiking neural networks promise efficient event-based processing, but hard spike thresholds obstruct straightforward gradient computation. EventProp combines partial-derivative jumps with the adjoint method to compute exact, event-based gradients and demonstrates competitive training results.
- 1 Introduction: Hard spiking thresholds prevent straightforward differential-calculus gradients, motivating surrogate, smoothed, or stochastic alternatives.These alternatives replace or soften the threshold rather than differentiating the hard event directly.
- 1 Introduction: EventProp computes exact gradients for general recurrent spiking networks with hard thresholds and arbitrary losses defined over spike times and membrane potentials.Feed-forward and convolutional networks are included as special cases.
- EventProp: Event-Based Backpropagation of Errors: EventProp derives backpropagation by combining hybrid-system partial-derivative jumps with the adjoint method, sending errors backward at spike times.The resulting adjoint spiking network supports event-based gradient computation.
- EventProp: Event-Based Backpropagation of Errors: EventProp can reduce memory requirements by storing state variables only at spike times rather than across every discrete time step.Discrete-time surrogate-gradient approaches typically retain state variables at every time step for backward computation.
2 Results
EventProp derives an event-based adjoint algorithm for exact gradients in recurrent leaky integrate-and-fire networks, including spike-time and voltage-dependent losses. The method trains networks on Yin-Yang and MNIST with competitive classification performance.
- 2.2 Gradient via Backpropagation: EventProp computes gradients by solving an adjoint spiking network backward in time and sampling the post-synaptic adjoint variable at presynaptic spike times.For voltage-independent losses, the backward pass retains spike times and firing-neuron synaptic currents from the forward pass.
- 2.2 Gradient via Backpropagation: The algorithm handles voltage-dependent losses by storing the non-zero voltage-loss derivatives along the forward trajectory.For purely discrete voltage-independent losses, EventProp can operate in a purely event-based manner.
- 2.3 Experiments: EventProp trains a two-layer leaky integrate-and-fire network on Yin-Yang and a network with non-firing readout neurons on MNIST.Yin-Yang uses time-to-first-spike classification, whereas MNIST uses maximum readout voltage.
- 2.3.1 Yin-Yang Dataset: 98.1 ± 0.2% test accuracy was achieved on Yin-Yang, comparable to 95.9 ± 0.7% reported with a smaller hidden layer.The results average over 10 random seeds; the hidden layer sizes were 200 versus 120 neurons.
- 2.3.2 MNIST Dataset: 97.6 ± 0.1% test accuracy was achieved on MNIST, representing competitive performance against previously published single-hidden-layer spiking networks.The result is the mean and standard deviation over 10 random seeds.
3 Discussion
EventProp computes exact gradients for leaky integrate-and-fire networks by combining adjoint dynamics with derivative jumps at spike discontinuities. The method is event-based and scalable, but its gradients diverge at critical spike-transition points and the demonstration used a two-layer feed-forward network.
- EventProp computes exact gradients for leaky integrate-and-fire networks by treating parameter-dependent spike discontinuities with the adjoint method and partial derivative jumps.The backward pass propagates errors at spike times along the reverse network path without approximations or smoothing.
- The algorithm’s forward pass stores spike times and synaptic currents, while its backward pass accumulates gradients through event-based error propagation.This structure uses the adjoint spiking network to backpropagate errors at presynaptic spike events.
- Exact-gradient learning has a critical-point limitation: gradient magnitudes diverge when the membrane potential becomes tangent to the firing threshold.Gradient clipping can mitigate the divergence in practice, but the resulting learning dynamics do not selectively recruit or dismiss spikes at these points.
- EventProp is formulated for leaky integrate-and-fire neurons, while extensions such as refractory periods, adaptive thresholds, and multiple compartments can be treated analogously.Such extensions may require sophisticated numerical techniques for event-based simulation.
- The adjoint dynamics provide a potential neuromorphic implementation in which spike times and forward-pass scaling factors are stored for backward error transmission.The proposed hardware mapping transmits errors at fixed postsynaptic spike times using retained factors proportional to the inverse membrane-potential slope.
- EventProp’s computational and spatial complexity scales linearly with network size when average firing rates per neuron remain constant.The authors state that the algorithm can compute gradients for arbitrary recurrent or convolutional architectures, although the demonstration used a two-layer feed-forward network.
4 Methods
The methods derive gradients for discontinuous spiking dynamics by combining hybrid-system derivative jumps with the adjoint method. This yields a reverse-time, event-based gradient computation for leaky integrate-and-fire networks.
- 4.1 Partial Derivatives in a Hybrid System: The derivation treats state discontinuities by propagating parameter-derivative jumps across event times, illustrated for bouncing-ball impacts and leaky integrate-and-fire resets.The implicit function theorem supplies differentiable event-time relations when the relevant crossing velocity is nonzero.
- 4.2 Adjoint Method: The adjoint method replaces forward integration of N^3 partial derivatives with N adjoint variables computed in an additional backward pass.For a recurrent network with N neurons and N^2 weights, explicitly storing all parameter sensitivities requires N^3 partial derivatives.
- 4.3 Derivation of Gradient: EventProp applies the adjoint method to leaky integrate-and-fire dynamics, splitting the loss integral at spike times and enforcing reverse-time adjoint transitions.The forward dynamics use membrane potentials and synaptic currents between spikes, while transition terms account for discontinuous events.
- 4.3 Derivation of Gradient: At each spike, threshold crossing defines the event time implicitly, and the membrane-potential and synaptic-current relations determine derivative and adjoint updates across the transition.The derivation assumes nonzero pre-spike voltage slope; under that condition, the event time is differentiable with respect to synaptic weights.
- 4.3 Derivation of Gradient: The resulting spike-transition relation is exact for non-critical parameters but invalid at critical parameters.The paper distinguishes this exact relation from approximate surrogate-gradient treatments.
Contributions
The authors describe their respective roles in conceiving, deriving, implementing, evaluating, and writing the EventProp work.
- Contributions: CP conceived the idea and derived the adjoint equations with TW, while TW implemented the event-based simulator and conducted the simulations.Both authors wrote and edited the manuscript.
Funding
The research was supported by European Commission Horizon 2020 grants and the Joachim Herz foundation.
- Funding: Funding came from EC Horizon 2020 Framework Programme grants 785907 and 945539 and financial support from the Joachim Herz foundation.
A Simulation Parameters
Table 4 lists the simulation parameters used for the results in section 2.3.
- A Simulation Parameters: Table 4 provides the simulation parameters for the results reported in section 2.3.