Training event-based neural networks with exact gradients via Differentiable ODE Solving in JAX

Lukas König, Manuel Kuhn, David Kappel, Anand Subramoney
3/9/2026
3 citations
cs.LG

Official code: Efficient-Scalable-Machine-Learning/eventax (4 stars, Python, last commit 2026-04-15).

Abstract

Existing frameworks for gradient-based training of spiking neural networks face a trade-off: discrete-time methods using surrogate gradients support arbitrary neuron models but introduce gradient bias and constrain spike-time resolution, while continuous-time methods that compute exact gradients require analytical expressions for spike times and state evolution, restricting them to simple neuron types such as Leaky Integrate and Fire (LIF). We introduce the Eventax framework, which resolves this trade-off by combining differentiable numerical ODE solvers with event-based spike handling.

Show full abstract

Built in JAX, our frame-work uses Diffrax ODE-solvers to compute gradients that are exact with respect to the forward simulation for any neuron model defined by ODEs . It also provides a simple API where users can specify just the neuron dynamics, spike conditions, and reset rules. Eventax prioritises modelling flexibility, supporting a wide range of neuron models, loss functions, and network architectures, which can be easily extended. We demonstrate Eventax on multiple benchmarks, including Yin-Yang and MNIST, using diverse neuron models such as Leaky Integrate-and-fire (LIF), Quadratic Integrate-and-fire (QIF), Exponential integrate-and-fire (EIF), Izhikevich and Event-based Gated Recurrent Unit (EGRU) with both time-to-first-spike and state-based loss functions, demonstrating its utility for prototyping and testing event-based architectures trained with exact gradients. We also demonstrate the application of this framework for more complex neuron types by implementing a multi-compartment neuron that uses a model of dendritic spikes in human layer 2/3 cortical Pyramidal neurons for computation. Code available at https://github.com/efficient-scalable-machine-learning/eventax.

View on arXivView PDF

Code Implementations(1)

Event-based training of continuous time spiking networks in JAX

40Python, JavaScriptFeb 27, 20267 months ago

Similar Papers

Cite this paper

@article{knig2026training,
  title  = {Training event-based neural networks with exact gradients via Differentiable ODE Solving in JAX},
  author = {Lukas König and Manuel Kuhn and David Kappel and Anand Subramoney},
  year   = {2026},
  eprint = {2603.08146},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2603.08146v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2603.08146.svg)](https://codeofpaper.com/paper/2603.08146)

Discussion