NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Exact Gradients for Stochastic Spiking Neural Networks Driven by Rough Signals

Christian Holberg, Cristopher Salvi

Introduction Spiking Neural Networks (SNNs) offer an energy-efficient, biologically inspired alternative to traditional artificial neural networks. However, they are notoriously difficult to train using standard backpropagation due to the non-differentiable nature of discrete "spike" events. While researchers have developed workarounds for deterministic SNNs, introducing stochasticity—a crucial element for modeling noisy biological systems and hardware implementations—often breaks these mathematical approximations. Recently presented at NeurIPS 2024, this paper introduces a mathematically rigorous framework based on rough path theory to compute exact gradients for Stochastic Spiking Neural Networks (SSNNs). This approach enables gradient-based training even when noise affects both the internal dynamics and the precise timing of spikes.

The Challenge of Stochastic Spikes In deterministic SNNs, the discrete jump in a neuron's state (the spike) creates a non-differentiable loss landscape. Researchers typically bypass this using "surrogate gradients" (smooth approximations of the spike) or the Implicit Function Theorem. However, when noise is introduced to the system, the Implicit Function Theorem frequently fails. Until now, there has been no rigorous method to compute exact gradients for SSNNs where stochasticity influences both the membrane potential and the exact moment a spike is triggered.

A Rough Path to Exact Gradients To overcome this hurdle, the authors turn to Rough Path Theory, a modern branch of stochastic analysis, to build a robust and generalizable solution. Their methodology is built on several key mathematical innovations:

  • Event SDEs: The network is modeled as a system of Stochastic Differential Equations (SDEs) that experience discontinuous "events." When a neuron's potential reaches a specific threshold, it triggers a jump (or reset) and propagates the signal to connected neurons.
  • Marcus Integration: Standard Ito or Stratonovich integration falls short when dealing with discontinuous jumps. The authors employ Marcus integration, a framework that preserves the chain rule even when the driving signal contains jumps. This is critical for deriving pathwise gradients.
  • Recursive Gradient Relations: The researchers identify sufficient conditions under which the solution trajectories and event times remain differentiable. They derive a recursive formula to successfully propagate these gradients through the discontinuous spikes.

By correctly accounting for discontinuities using the Marcus lift, the framework demonstrates that researchers do not have to rely on surrogate approximations; they can compute the "true" gradient of the numerical solver. Furthermore, this approach is not limited to simple Brownian motion—it can handle highly irregular or "rough" noise processes.

Marcus Signature Kernels for Generative Modeling Comparing discontinuous spike trains requires a specialized loss function. Standard signature kernels are designed for continuous paths. To address this, the authors introduce a new class of "Marcus signature kernels." This provides a mathematically sound distance metric between two sets of discontinuous paths (the model's output and the target data), enabling the training of SSNNs as generative models.

Experimental Validation The paper focuses primarily on establishing this novel mathematical framework, validating it through targeted synthetic experiments:

  • Parameter Recovery: Using simulated spike trains from a Stochastic Leaky Integrate-and-Fire (SLIF) model, the framework successfully recovered the true underlying input current from noisy spike trains in approximately 600 training steps, demonstrating robustness across different noise levels.
  • Weight Learning: In a small-scale feed-forward SSNN simulation (4 input, 16 hidden, and 2 output neurons), the model achieved a test loss of nearly zero, successfully mirroring the target "ground truth" model.

Limitations and Future Directions While this framework is the first of its kind to enable exact gradient-based training for SSNNs with complex noise, it faces practical limitations. The current EventSDESolve algorithm scales poorly, requiring a full solver call and a root-finding step for every single spike event. In large networks with high spike rates, this computational complexity becomes a significant bottleneck. Additionally, while stochasticity smooths the loss landscape, it does not entirely resolve the "dead neuron" problem, where a neuron that never spikes provides zero gradient signal to learn from.

Future work will likely focus on implementing adjoint methods to improve memory efficiency and scaling. The authors also aim to explore how these exact gradients might bridge the gap toward more biologically plausible online learning rules.

Implementation Note: The authors have made their end-to-end autodifferentiable solver available as part of the popular JAX-based differential equation library, diffrax.

Summary updated

BibTeX
@inproceedings{holberg2024exact,
  author = {Christian Holberg and Cristopher Salvi},
  title = {{Exact Gradients for Stochastic Spiking Neural Networks Driven by Rough Signals}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=mCWZj7pa0M},
}
Figure