Introduction
Training Spiking Neural Networks (SNNs) presents a significant challenge for modern machine learning. The standard approach, Backpropagation Through Time (BPTT), is computationally demanding and unsuitable for real-time applications because its memory requirements scale linearly with sequence length. While Real-Time Recurrent Learning (RTRL) offers an "online" alternative with constant memory, its $O(n^4)$ computational complexity for $n$ neurons makes it prohibitive for large-scale models.
Biologically inspired rules like e-prop attempt to bridge this gap by approximating gradients. However, these rules typically require manual derivation for every new neuron model, hindering the flexibility and ease of use found in standard deep learning frameworks. This paper introduces Synaptax, a custom automatic differentiation (AD) pipeline that automates the implementation of sparse, online gradient-based rules, achieving high efficiency without sacrificing generality.
The Synaptax Framework
Synaptax is built as an AD interpreter on top of JAX and the Graphax library. Its primary innovation is the automated exploitation of Jacobian sparsity. In many common neuron models, such as the Leaky Integrate-and-Fire (LIF) model, a neuron's state at a given time step primarily influences its own state at the next. This dynamic results in Jacobians that are largely diagonal.
Instead of executing standard $O(n^3)$ or $O(n^4)$ matrix multiplications, Synaptax performs vertex elimination on the computational graph to identify these sparse structures. It then replaces heavy tensor contractions with simple, element-wise multiplications. This allows the system to automatically derive efficient "e-prop-like" rules for arbitrary neuron models, such as those with adaptive thresholds (ALIF), without requiring manual mathematical derivation.
Experimental Evaluation
The researchers evaluated Synaptax using synthetic tasks to verify gradient accuracy and the Spiking Heidelberg Digits (SHD) dataset, a standard benchmark for audio speech classification in SNNs. The framework was compared against standard BPTT, RTRL, and "naïve" implementations of e-prop.
Key Results
Synaptax demonstrates several key advantages over existing training methods:
- Gradient Accuracy: The gradients produced by Synaptax match those of BPTT to within machine precision ($10^{-6}$), ensuring that efficiency gains do not compromise training quality.
- Computational Efficiency: Synaptax significantly outperforms naïve e-prop and RTRL. As sequence lengths increase, it even surpasses standard BPTT in speed.
- Constant Memory Scaling: By utilizing forward-mode AD, Synaptax maintains a constant memory profile regardless of the input sequence length, making it ideal for processing indefinitely long data streams.
Conclusion and Future Work
Synaptax provides a general and highly efficient framework for online SNN training by leveraging the inherent sparsity of synaptic plasticity. While current work focuses on single-layer recurrent structures, the authors identify the generalization of this sparse AD approach to multi-layer architectures as a critical next step. Furthermore, while optimized for GPUs, Synaptax is uniquely positioned to benefit from future neuromorphic hardware that can natively exploit fine-grained sparsity.
Summary updated