A spiking neuron either fires or it does not — its output is a step. And the derivative of a step is zero everywhere except one point, where it is infinite. Feed that into backpropagation and no gradient flows: the network cannot learn. The fix that made deep spiking networks trainable is deceptively simple — keep the hard spike on the forward pass, and substitute a smooth stand-in derivative on the backward pass. Below is exactly that substitution, drawn from the surrogate SC-NeuroCore actually uses.
The forward spike is a Heaviside step: the neuron emits a $1$ the instant its membrane potential $v$ crosses threshold $\vartheta$, and a $0$ otherwise. That is exactly what you want on hardware — a clean binary event — but it is a disaster for gradient descent. The true derivative $\partial S/\partial v$ is zero for every $v\neq\vartheta$ and a Dirac spike at $v=\vartheta$: almost everywhere it says “changing $v$ changes nothing”, so the weights receive no signal.
The blue curve is the surrogate that stands in for the orange one during the backward pass. It peaks at the threshold — where a nudge to $v$ is most likely to flip the spike — and falls off smoothly on either side, so neurons near firing receive the strongest learning signal. Raise $\beta$ and the window narrows toward the true (unusable) Dirac; lower it and the window widens, letting gradient flow to neurons further from threshold at the cost of faithfulness. That single knob is the crux of surrogate-gradient training.
The toolkit's differentiable neuron uses the SuperSpike surrogate of Zenke & Ganguli (2018): a smooth, bell-shaped derivative that is largest at threshold and decays like the square of the distance from it. It is the “fast-sigmoid” family — cheap to evaluate, bounded, and with a single sharpness parameter $\beta$.
Because inference is unchanged, a network trained this way lowers to exactly the same event-driven, binary-spike datapath the hardware pages describe — the smoothing exists only in the optimiser, never in the deployed model.
Sharpness $\beta$ sets the width of the gradient window, and it is a genuine trade, not a free choice. A large $\beta$ makes the surrogate hug the true derivative — faithful, but so narrow that only neurons almost exactly at threshold learn, and gradients vanish elsewhere. A small $\beta$ spreads the window wide, so many neurons receive signal and training is stable, but the surrogate now poorly approximates the real sensitivity and can bias the solution. The default sits in between; the demo lets you feel both failure modes at the extremes.
Surrogate gradients are what let a spiking network be trained with the same autograd machinery as an ordinary deep net — and they compose with the rest of the toolkit. The quantum front-end trains by an exact parameter-shift rule rather than a surrogate; the stochastic and spike layers train through this smooth stand-in; and both meet in one optimiser. The alternative route — skip training in the spike domain entirely and convert a pre-trained ordinary network — is covered separately.
Evidence boundary: the demo plots the library's exact SuperSpike surrogate $1/(\beta\lvert v-\vartheta\rvert+1)^2$ and the true step in your browser. Actual training runs through the toolkit's PyTorch/JAX backends over full networks and datasets, not on this page; no training-speed or accuracy figures are quoted here.