COBA and PING Dynamics, Discretisation, and Learning
A textbook derivation of the conductance-based COBA and PING equations, their discrete simulation, and their training by surrogate-gradient BPTT, voltage-gradient damping, gradient clipping, AdamW, and Dale projection.
Abstract
COBA and PING classifiers share conductance-based leaky integrate-and-fire dynamics but differ in whether excitatory and inhibitory populations form a reciprocal feedback loop. We derive their event-driven synapses, exponential-Euler membrane update, spike and readout rules, and complete training calculation. We then explain why long recurrent gradient paths can amplify in this model and how voltage-gradient damping stabilizes selected backward sensitivities without changing the forward simulation.
Model family and notation
The COBA and PING classifiers use the same conductance-based leaky integrate-and-fire neuron. Their distinction is architectural. The COBA condition disables the recurrent excitatory-to-inhibitory-to-excitatory pathway, whereas PING enables the loop .[1]
Physical time is , the simulation-step index is , and , where is the integration timestep. A presentation contains timesteps and has duration . Superscripts on conductances identify AMPA or GABA polarity, while subscripts identify the receiving population.
Continuous membrane dynamics
For neuron in population , the membrane equation is
In Equation 1, is membrane voltage, is capacitance, is leak conductance, and and are total AMPA and GABA conductances. The reversal potentials are
A conductance with reversal potential supplies current . Equation 2 therefore makes AMPA normally depolarizing and GABA normally hyperpolarizing. The fixed membrane parameters are
The corresponding passive membrane time constants follow from :
Continuous synaptic dynamics
The continuous spike train emitted by presynaptic neuron is
where is event time and is the Dirac impulse. A postsynaptic conductance with decay constant satisfies
Here is the conductance increment produced by one presynaptic event. AMPA and GABA use separate copies of Equation 6 with and the canonical .
Discretising the synaptic equations
Between events, Equation 6 reduces to
Integrating Equation 7 from to gives
Exponentiating Equation 8 yields the event-free decay
Integrating Equation 6 across an infinitesimal interval containing one event gives
Combining Equation 9 and Equation 10 gives the timestep recurrence
In Equation 11, is a dimensionless binary presynaptic spike vector, has presynaptic neurons on rows and postsynaptic neurons on columns, and is an external conductance increment. The simulator performs exact exponential decay followed by the full, undecayed event increment.[1]
EβI conductance recurrences
Define the dimensionless decay factors
For one EβI layer, Equation 11 expands to
The canonical architecture sets . COBA additionally disables and . PING enables those two projections: excitatory spikes recruit inhibitory neurons through Equation 15, and inhibitory spikes subsequently produce GABA conductance through Equation 14. A recurrent spike generated in one iteration is consumed in the next, giving each recurrent projection a one-timestep delay.
Exponential-Euler membrane discretisation
The simulator first updates conductances with Equation 13βEquation 16, then holds those new values constant during the membrane step. Expanding Equation 1 for one neuron gives
Define the total conductance and its conductance-weighted equilibrium voltage by
Substituting Equation 18 into Equation 17 gives
Let . Because the conductances and are constant within the timestep,
Integrating Equation 20 over one timestep gives
Returning to membrane voltage produces the pre-threshold candidate
Equivalently, define
Equation 22 is the update used by the simulator. It is exact for the linear membrane equation under the stated zero-order hold on conductances; it is not an exact solution of the continuously co-evolving neuron and synapses.
Spike, reset, and refractory dynamics
Let be the non-negative integer refractory counter. It is decremented before the threshold decision:
A neuron emits the binary spike
where is the Heaviside step function, , and is an indicator. A neuron that spikes, or remains refractory after Equation 24, is stored at . A new spike sets the counter to the populationβs refractory step count; otherwise it retains .
The canonical timestep is . The excitatory and inhibitory refractory durations, and , therefore correspond exactly to 12 and 6 timesteps.
Output readout and classification loss
The canonical classifier uses an output LIF with mean pre-reset voltage. Let be the final hidden E-population spike vector and the hidden-to-output matrix. With output decay , the pre-reset dimensionless output state is
The output spike and subtractive reset are
where . Output state and its evidence accumulator begin at zero for each independent image presentation. Hidden E/I voltages, conductances, spikes and refractory counters likewise initialize anew for every independent presentation. The decoder therefore receives presentation boundaries through these per-forward resets. The class score is the mean pre-reset state over the complete readout window:
For minibatch member , softmax-normalized evidence is
It is used for optimization but is not assumed to be a calibrated probability. For true class , the mean cross-entropy training loss is
Some conditions add a one-sided firing-rate ceiling. Let be the spike count of hidden E neuron in layer for presentation . Its sample-wise population-mean rate is
With tested ceiling and coefficient , the penalty is
The canonical reference conditions set ; activity-ceiling conditions use Equation 32 with a positive coefficient.
Backpropagation through time
Collect all differentiable voltages, conductances, spikes, output states and accumulators into the state vector . One complete simulation step has the abstract form
is a bundle rather than one additional simulator equation. It combines the discrete synapse rule in Equation 11 and the decay factors in Equation 12; the population-specific conductance updates from Equation 13 through Equation 16; the implemented membrane update in Equation 23; the refractory, spike and reset operations in Equation 24 and Equation 25; and the output update in Equation 26 and Equation 27. It also advances the accumulators used to construct Equation 28 and Equation 31. The earlier continuous equations and intermediate derivation steps explain these operations but are not extra updates inside .
Here denotes external input, is the shared trainable parameter vector, and includes the readout and objective defined in Equation 28βEquation 32. At , a presentation applies 2,000 times. Each copy has a different state but reuses the same parameters.
Define the state sensitivity
Let be component of the current state and component of . The project evaluates its loss from the terminal readout and rate accumulators. Consequently, for , the current state affects the loss through the next state. Applying the multivariable chain rule component by component gives
The second line of Equation 35 sums every route from state component to the later loss through next-state component . The third line substitutes Equation 34 and Equation 33. Stacking the component equations produces the transpose-Jacobian vector product in the fourth line; the final line supplies the terminal condition from Equation 33. Because each parameter is reused, its total gradient is
Equation 35 and Equation 36 define backpropagation through time (BPTT). PyTorch autograd evaluates these vectorβJacobian products and accumulates parameter gradients when backward propagation is requested; it need not construct the full Jacobian matrices explicitly.[4]
For example, the local recurrence gives
Equation 37 shows temporal credit assignment directly: every use of the shared weight contributes according to the later loss sensitivity of the conductance it created.
Surrogate spike derivatives
BPTT requires derivatives of the update operations, but the hard spike in Equation 25 has derivative zero away from threshold and is undefined at threshold. Direct use of that derivative would block useful learning signals.
Surrogate-gradient learning retains the binary forward spike while assigning a smooth backward derivative.[2] For , the chosen proxy is
The approximate equality in Equation 38 denotes an assigned backward rule rather than the true derivative of the Heaviside function. For hidden neurons, is measured in millivolts and in reciprocal millivolts. The standard classifiers use .
Let denote stop-gradient: it returns forward but has zero derivative. The simulator constructs
Equation 39 equals numerically, while autograd differentiates only .[5] Boolean reset and refractory decisions remain non-differentiable. Resetting hidden voltage to a constant cuts that voltage-state path, while the floating spike value carries the surrogate derivative into downstream synapses and the readout.
Why voltage gradients can explode
Expanding Equation 35 across many steps produces repeated Jacobian products:
Products in Equation 40 can shrink useful sensitivities or amplify them. This project combines a 2,000-step graph with voltage, conductance, spike and output-state memory. PING adds a closed route by which a voltage perturbation can return to the population from which it began:
The local gain of this route follows from the membrane equations rather than from an extra model quantity. Choose for excitatory conductance or for inhibitory conductance. Differentiating Equation 18 and the decay in Equation 23 gives
Applying the product rule to gives the conductance-to-voltage response
The response in Equation 43 has units of millivolts per microsiemens. Let and be diagonal matrices of the appropriate responses at I and E neurons. Let and be diagonal matrices containing the local surrogate derivatives from Equation 38. One complete backward traversal of Equation 41 then has return Jacobian
The transposes in Equation 44 convert the simulatorβs presynaptic-row, postsynaptic-column weight storage into maps acting on column perturbations.
At a fixed local linearization, a sensitivity returning through the loop times contains . If the spectral radius , some modes grow geometrically. A singular value above one permits amplification over one traversal, while time-varying, non-normal products can amplify transiently even if each instantaneous eigenvalue has magnitude below one.[3] Inhibitory polarity can reverse a perturbationβs sign without making its magnitude small.
Recurrence therefore does not guarantee exploding gradients. It creates the return operator in Equation 44, which BPTT may traverse many times. Loop-disabled COBA lacks that particular operator, but it still carries gradients through membrane, conductance, spike and readout state across the same long presentation.
Global gradient clipping cannot by itself repair this internal propagation. It acts only after BPTT has formed the complete parameter gradient. Internal sensitivities may already be enormous, non-finite, or dominated by the amplifying paths in Equation 40 before clipping occurs.
Voltage-gradient damping
The project therefore intervenes inside the backward recurrence while preserving the physical forward trajectory. For dimensionless divisor , define
Forward evaluation of Equation 45 gives , but its backward derivative is
The hidden E and I membrane updates replace Equation 23 by
Equation 45 and Equation 47 leave voltages and spikes unchanged forward. Backward, each selected conductance-to-voltage response is multiplied by . The PING return term in Equation 44 consequently becomes
The standard paired classifiers use , so and this particular complete loop term is scaled by . This does not scale the entire state Jacobian because Equation 45 is inserted only on the branch of Equation 47. For one hidden neuron, the three local derivatives entering its candidate voltage are therefore
Thus the conductance-to-voltage blocks are multiplied by , but the direct identity route from to retains coefficient one. The conductance decay and spike-injection blocks, the refractory-counter update, and the local output recurrence contain no damping operator and are not directly rescaled. Downstream composite derivatives can nevertheless inherit attenuation when their path passes through a damped hidden-voltage increment. There is therefore no scalar for which the complete step Jacobian is simply .
Holding conductances fixed before bounds and reset, Equation 49 and Equation 23 give
Without damping, Equation 50 reduces to . Strong damping moves the direct old-voltage derivative toward one while attenuating sensitivities entering through the membrane increment. It can therefore suppress recurrent-drive amplification without simply erasing membrane memory.
Voltage-gradient damping is an altered backward rule, not a biophysical process or the exact derivative of the forward simulator. It deliberately biases temporal credit assignment and may suppress useful sensitivities along with unstable ones. The divisor is therefore an empirical training choice. Standard classifiers apply it to hidden E and I membrane increments, before voltage bounds, spike detection and reset; output-neuron updates are undamped.[1]
Gradient clipping, AdamW, and Dale projection
After BPTT has accumulated the batch gradient , the trainer computes its global Euclidean norm
With clipping threshold , it replaces the gradient by
A non-finite norm causes the optimizer step to be skipped. Otherwise AdamW forms first- and second-moment estimates
The square in Equation 53 is elementwise. Bias correction gives
For learning rate , decoupled weight decay , and numerical stabilizer , AdamW applies
The standard training recipe used , , minibatches of 256 presentations and 50 epochs. With zero weight decay, Equation 55 is numerically the Adam update for the same hyperparameters.
Dale-constrained trainable connection weights are finally projected onto the non-negative orthant:
The canonical input and readout matrices are trainable, while recurrent EβI matrices are fixed unless an experiment explicitly makes them trainable. Thus one optimization cycle evaluates the forward dynamics, computes Equation 32, applies surrogate-gradient BPTT with the internal rule in Equation 47, clips by Equation 52, updates by Equation 55, and finishes with Equation 56.
Scope and interpretation
The dynamical discretisation is a numerical approximation to the continuous hybrid system, although Equation 9 and Equation 22 exactly solve their respective subproblems under the stated within-step assumptions. Surrogate spike derivatives and voltage-gradient damping introduce additional backward rules: they make learning possible and tractable but do not turn BPTT into the exact derivative of a smooth physical neuron.
The loop derivation isolates one interpretable amplification route rather than the full state Jacobian, and it does not imply that gamma oscillation itself causes gradient explosion. A paired empirical comparison can vary loop engagement and damping independently.
References
-
Pinglab contributors. SNNsim and the paired COBA/PING training specification. Software snapshot (2026): membrane dynamics and learning rules, training loop and optimizer, and paired training choices.
-
E. O. Neftci, H. Mostafa and F. Zenke. βSurrogate Gradient Learning in Spiking Neural Networks.β arXiv (2019). doi:10.48550/arXiv.1901.09948
-
R. Pascanu, T. Mikolov and Y. Bengio. βOn the Difficulty of Training Recurrent Neural Networks.β Proceedings of the 30th International Conference on Machine Learning, 1310β1318 (2013).
-
PyTorch contributors. βAutograd mechanicsβ, βTensor.backwardβ, and βtorch.optim.β PyTorch documentation (accessed 15 September 2026).
-
PyTorch contributors. βTensor.detach.β PyTorch documentation (accessed 15 September 2026).