TL;DR
The authors introduce a custom automatic differentiation (AD) pipeline built on JAX and Graphax that enables general, memory-efficient, and truly sparse online training for spiking neural networks (SNNs). By automatically exploiting the diagonal sparsity of synaptic plasticity rules like eligibility propagation (e-prop), the framework eliminates the need for hand-derived gradients while keeping memory usage completely independent of sequence length.
What Problem Does This Paper Address?
Training Spiking Neural Networks (SNNs) over long temporal sequences is notoriously difficult. Standard deep learning relies on Backpropagation Through Time (BPTT), an offline algorithm requiring memory that scales linearly with sequence length. This makes BPTT highly memory-intensive for long sequences and biologically implausible.
An alternative is Real-Time Recurrent Learning (RTRL), which propagates gradient information forward in time online. However, naive RTRL suffers from devastating computational ($O(n^4)$) and memory ($O(n^3)$) scaling. While biologically inspired local learning rules like e-prop circumvent this by using sparse approximations, researchers previously had to meticulously hand-craft and manually code these rules for every single neuron model. This paper bridges the gap, providing the programming ease of automatic differentiation with the extreme efficiency of sparse, online plasticity rules.
Methods
The authors leverage Graphax, a novel JAX-based AD library that uses vertex elimination on computational graphs to automatically detect and exploit sparsity patterns.
In SNNs, the Jacobian tracking a neuron's internal state dynamics is often diagonally sparse—meaning a neuron's future state depends primarily on its own history and direct synaptic inputs, rather than complex cross-neuron interactions at the same time-step. Graphax stores these diagonal tensors in a compressed form and replaces expensive tensor contractions with simple element-wise multiplications.
The authors package this into a library called synaptax. It automatically differentiates through arbitrary neuron dynamics, extracts eligibility traces, and executes the online recursion efficiently without manual gradient derivation.
Datasets
The framework was evaluated using:
- Spiking Heidelberg Digits (SHD): A standard audio speech classification benchmark consisting of spoken digits converted into spike trains.
- Synthetic Data: Generated with pooled input channels to rigorously profile computational and memory scaling behavior across various network sizes and sequence lengths.
Key Insights and Ideas
- Sparsity is Inherent, Not Accidental: The Jacobians of common neuron models (like Leaky Integrate-and-Fire [LIF] and Adaptive LIF [ALIF]) are naturally diagonal. Graphax exploits this structural property directly at the compiler level.
- Vertex Elimination Unlocks Automation: Instead of standard forward or reverse-mode AD, using vertex elimination allows the framework to analyze the graph topology and compress tensors before performing arithmetic, avoiding redundant multiplications by zero.
- Beating BPTT at Its Own Game: By combining forward-mode time propagation with reverse-mode spatial differentiation at each step, the implementation achieves constant memory relative to sequence length while actually running faster than BPTT for moderate network sizes.
Key Results
- Mathematical Exactness: The gradients computed by the pipeline match BPTT exactly up to machine precision (absolute deviation $\sim 10^{-6}$).
- Classification Performance: On the SHD dataset, the framework achieved test accuracies identical to BPTT (~78.5% for LIF and ~82.6% for ALIF neurons).
- Constant Memory Scaling: Unlike BPTT, which consumes linearly increasing memory over time,
synaptaxmaintains a flat, constant memory footprint regardless of the number of time-steps. - Significant Speedups: The sparse AD pipeline ran over two orders of magnitude faster than a naive e-prop implementation and outperformed standard BPTT for networks up to 512 hidden neurons.
Limitations and Future Work
The primary limitation is that the current evaluation is restricted to a feed-forward network architecture with a single hidden layer of spiking neurons. In this specific setup, e-prop and BPTT gradients are mathematically equivalent. Extending this automated sparse AD framework to deep, multi-layer recurrent networks—where local approximations must be made and gradients diverge from exact BPTT—remains an open and important direction for future work.
Summary updated