A Truly Sparse and General Implementation of Gradient-Based Synaptic Plasticity
Jamie Lohoff †, Anil Kaya †, Florian Assmuth, Emre Neftci · 2025
Read A Truly Sparse and General Implementation of Gradient-Based Synaptic Plasticity by Jamie Lohoff †, Anil Kaya †, Florian Assmuth, Emre Neftci (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2501-11407.txt.
Introduction
Jamie Lohoff and co-authors present a software engine that computes learning gradients for brain style networks exactly as they run, in a paper from 2025. The catalog title carries a funding footnote, which the head omits. Gradient based synapse rules learn well but usually need hand derived math or memory heavy replay of the whole sequence.
Their pipeline uses forward automatic differentiation with a sparse layout, swapping big tensor operations for simple element wise steps where structure allows. Memory then grows with network size, not with sequence length. Tests matched standard backpropagation gradients on a synthetic task and on speech benchmarks. The authors offer the engine for arbitrary neuron models.
Catalog record
| CREATOR | Jamie Lohoff †, Anil Kaya †, Florian Assmuth, Emre Neftci |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 39 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2501-11407
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
A Truly Sparse and General Implementation of Gradient-Based Synaptic Plasticity ∗ Thanks: ∗ Sponsored by the Federal Ministry of Education and Research BMBF Neurosys and Neurotec II (03ZU1106CB, 16ME0398K, and 16ME0399). † \dagger These authors contributed equally. Jamie Lohoff †, Anil Kaya †, Florian Assmuth, Emre Neftci Abstract Online synaptic plasticity rules derived from gradient descent achieve high accuracy on a wide range of practical tasks. However, their software implementation often requires tediously hand-derived gradients or using gradient backpropagation which sacrifices the online capability of the rules. In this work, we present a custom automatic differentiation (AD) pipeline for sparse and online implementation of gradient-based synaptic plasticity rules that generalizes to arbitrary neuron models. Our work combines the programming ease of backpropagation-type methods for forward AD while being memory-efficient. To achieve this, we exploit the advantageous compute and memory scaling of online synaptic plasticity by providing an inherently sparse implementation of AD where expensive tensor contractions are replaced with simple element-wise multiplications if the tensors are diagonal. Gradient-based synaptic plasticity rules such as eligibility propagation (e-prop) have exactly this property and thus profit immensely from this feature. We demonstrate the alignment of our gradients with respect to gradient backpropagation on an synthetic task where e-prop gradients are exact, as well as audio speech classification benchmarks. We demonstrate how memory utilization scales with network size without dependence on the sequence length, as expected from forward AD methods. I Introduction Recent advances in deep learning continually push the boundary of tackling and solving new challenges previously thought to be unsolvable. However, deep learning achieves its performance through gradient backpropagation which is not biologically plausible. Backpropagation violates two fundamental properties of physical computing, which are spatial locality and online learning. In the brain, synaptic plasticity plays an important role in achieving mid- to long-term adaptation of behavior. A common ground between biological heuristics and optimization algorithms in deep learning is provided by synaptic plasticity rules derived from gradient descent. However, in many cases the implementation of these gradient-based plasticity rules sacrifices generality by being meticulously handcrafted for a certain problem and neuron model. Machine learning software frameworks are generally designed for efficient execution of backpropagation on various general purpose accelerators. Synaptic plasticity rules derived from gradient descent can leverage these frameworks and backpropagation 1 1 1 Often with stop_gradient operations where necessary to take into account the approximations used in the plasticity rule at the cost of sacrificing online operation and requiring memory that grows with sequence length. However, gradient-based plasticity rules operate on the principle of forward-mode Automatic Differentiation (AD) Zenke and Neftci 2021 with approximations that constrain the rule to be local Murray 2019 . In the case of recurrent neural networks that are unrolled along the time axis, forward-mode AD is also called Real-Time Recurrent Learning (RTRL) Williams and Zipser 1989 . With RTRL, the information necessary for computing gradients is propagated forward in time, allowing for online learning. However, naïve implementations of forward-mode AD have high memory and time complexity compared to backpropagation ( reverse-mode AD ) Williams and Zipser 1995 . Such naïve implementations calculate the exact gradients, and miss the improvements gained with local approximations. By providing a novel extension of the popular machine learning framework JAX Bradbury et al. 2018 this work aims to harnesses the advantageous properties of approximate gradient-based synaptic plasticity rules. We employ the recently proposed AD library, Graphax Lohoff and Neftci 2024 to showcase the efficient implementation of gradient-based plasticity rules and exploiting their inherently sparse formulation to arrive at the computational and memory complexities as expected from theory (see Table I ). Our contributions are summarized as follows: • We provide the first AD package for spiking neural networks that leverages the inherent sparsity of gradient-based synaptic plasticity rules, • Our AD package can automatically differentiate through arbitrary neuron dynamics and determine the resulting eligibility traces and their sparsity structure, • We demonstrate how custom sparse AD operates faster and more memory efficient than current state-of-the-art BPTT methods. The source code of the project is available under https://github.com/jamielohoff/synaptax . TABLE I : Upper bounds on computational and memory complexity for various gradient-based synaptic plasticity algorithms. RTRL BPTT e-prop (BPTT) e-prop Ours Compute \mathcal{O}(n^{4}T) \mathcal{O}(n^{2}T) \mathcal{O}(n^{2}T) \boldsymbol{\mathcal{O}}(\boldsymbol{n^{2}}T) \boldsymbol{\mathcal{O}}(\boldsymbol{n^{2}T}) Memory \mathcal{O}(n^{3}) \mathcal{O}(nT) \mathcal{O}(nT) \boldsymbol{\mathcal{O}}(\boldsymbol{n}) \boldsymbol{\mathcal{O}}(\boldsymbol{n}) Automatic Yes 2 2 2 e.g. in JAX using jacfwd Yes Yes No Yes II Prior Work Using various forms of surrogate functions, a wide range of methods have been developed for training spiking neural networks that approximate gradient backpropagation Bohte et al. 2000 ; Shrestha and Orchard 2018 ; Neftci et al. 2019 . In shallow, feed-forward networks, these gradient-based rules can be written in an online form Zenke and Ganguli 2018 ; Kaiser et al. 2020 ; Bellec et al. 2020 that can be interpreted as a three-factor rule Gerstner et al. 2018 . In deep networks, the spatial credit assignment problem can be addressed by backpropagating in space and forward propagating in time Kaiser et al. 2020 ; Bohnstingl et al. 2020 . Such synaptic plasticity rules generally have to be hand-crafted, especially for the forward propagation. While some methods have shown that temporal gradients can be ignored Yin et al. 2023 ; Meng et al. 2023 , these either use other approximate methods for computing traces or test on inherently static datasets where temporal integration is not necessary. Other approaches that do not use gradient backpropagation are event-prop , which uses the adjoint method to compute gradients exactly when the number of events is fixed Wunderlich and Pehle 2021 ; parameter updates based on spike times Göltz et al. 2021 ; and prospective coding which leverages the advanced response of the neuron with respect to their inputs Brandt et al. 2024 . To study gradient-based synaptic plasticity rules, several software frameworks for SNN training have been developed. These are typically built on top of common machine learning libraries like PyTorch, TensorFlow or JAX. Particularly PyTorch is very popular for implementation of such simulators with snnTorch and SpikingJelly being the most prominent Eshraghian et al. 2023 ; Fang et al. 2023 . Additionally, Norse implements a spike-time based approach to gradient computation Pehle and Pedersen 2021 . These simulators enable simulation and training of SNNs with almost arbitrary network topology and neuron types on modern general purpose accelerators like GPUs. Another strain of frameworks puts more emphasis on the training of SNNs dedicated to specific neuromorphic hardware backends, thereby (sometimes artificially) limiting the set of operations. Examples include Lava and SINABS Sheik et al. 2023 ; Intel Labs 2021 . Other works have focused on accelerating gradient computations since they pose a significant bottleneck to SNN training where sequence lengths are generally in the hundreds. They leverage implicit differentiation and custom CUDA kernels for simple LIF models Bauer et al. 2022 . However, these methods require meticulously handcrafted kernels for every neuron type which makes them often unfeasible in practice. Recent works instead implemented SNN simulators in JAX, a general-purpose numerical computing library with numpy -like API. JAX-based simulators like SNNAX , Slax and Spyx take advantage of Just-In-Time (JIT) compilation to accelerate training, thereby achieving similar performance as methods with custom kernels Lohoff et