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.
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 E→I→E.[1]
Physical time is t, the simulation-step index is k, and tk=kΔtsim, where Δtsim is the integration timestep. A presentation contains Nt timesteps and has duration Tpresent=NtΔtsim. Superscripts on conductances identify AMPA or GABA polarity, while subscripts identify the receiving population.
Continuous membrane dynamics
For neuron j in population X∈{E,I}, the membrane equation is
In Equation 1, Vm is membrane voltage, Cm is capacitance, gL is leak conductance, and gE and gI are total AMPA and GABA conductances. The reversal potentials are
EL=−65mV,EE=0mV,EI=−80mV.(2)
A conductance g with reversal potential E supplies current I=g(E−Vm). Equation 2 therefore makes AMPA normally depolarizing and GABA normally hyperpolarizing. The fixed membrane parameters are
The corresponding passive membrane time constants follow from τm=gLCm:
τm,E=20ms,τm,I=5ms.(4)
Continuous synaptic dynamics
The continuous spike train emitted by presynaptic neuron i is
si(t)=j∑δ(t−ti,j),(5)
where ti,j is event time j and δ is the Dirac impulse. A postsynaptic conductance gj with decay constant τ satisfies
dtdgj=−τgj+i∑wevent,i,jsi(t).(6)
Here wevent,i,j is the conductance increment produced by one presynaptic event. AMPA and GABA use separate copies of Equation 6 with τAMPA=2ms and the canonical τGABA=6ms.
In Equation 11, s[k] is a dimensionless binary presynaptic spike vector, W has presynaptic neurons on rows and postsynaptic neurons on columns, and u[k] is an external conductance increment. The simulator performs exact exponential decay followed by the full, undecayed event increment.[1]
The canonical architecture sets WE→E=WI→I=0. COBA additionally disables WE→I and WI→E. 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
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 r[k] be the non-negative integer refractory counter. It is decremented before the threshold decision:
r−[k+1]=max(r[k]−1,0).(24)
A neuron emits the binary spike
s[k+1]=H(Vcandidate[k+1]−Vth)1[r−[k+1]=0],(25)
where H is the Heaviside step function, Vth=−50mV, and 1 is an indicator. A neuron that spikes, or remains refractory after Equation 24, is stored at Vreset=−65mV. A new spike sets the counter to the population’s refractory step count; otherwise it retains r−[k+1].
The canonical timestep is Δtsim=0.1ms. The excitatory and inhibitory refractory durations, 1.2ms and 0.6ms, 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 h[k] be the final hidden E-population spike vector and Wout the hidden-to-output matrix. With output decay βo=exp(−Δτotsim), the pre-reset dimensionless output state is
where θo=1. 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:
zc=Nt1k=1∑Ntao,c[k].(28)
For minibatch member b, softmax-normalized evidence is
pb,c=∑q=1Noutexp(zb,q)exp(zb,c).(29)
It is used for optimization but is not assumed to be a calibrated probability. For true class yb, the mean cross-entropy training loss is
LCE=−B1b=1∑Blnpb,yb.(30)
Some conditions add a one-sided firing-rate ceiling. Let Kb,l,j=∑k=1Ntsb,l,j[k] be the spike count of hidden E neuron j in layer l for presentation b. Its sample-wise population-mean rate is
∣r∣b,l=NE,lTpresent1j=1∑NE,lKb,l,j.(31)
With tested ceiling rE,ceil and coefficient λrate, the penalty is
The canonical reference conditions set λrate=0; 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 x[k]. One complete simulation step has the abstract form
x[k+1]=Fk(x[k],u[k];θ),Ltotal=ℓ(x[Nt],y).(33)
Fk 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 Fk.
Here u[k] denotes external input, θ is the shared trainable parameter vector, and ℓ includes the readout and objective defined in Equation 28–Equation 32. At Δtsim=0.1ms, a 200ms presentation applies Fk 2,000 times. Each copy has a different state but reuses the same parameters.
Define the state sensitivity
δ[k]=∇x[k]Ltotal,Jstep[k]=∂x[k]∂Fk.(34)
Let xi[k] be component i of the current state and Fk,j component j of Fk. The project evaluates its loss from the terminal readout and rate accumulators. Consequently, for k<Nt, 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 xi[k] to the later loss through next-state component xj[k+1]. 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 g[k+1]=βg[k]+s[k]W gives
∇WLtotal=k∑s[k]⊤∇g[k+1]Ltotal.(37)
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 ξ=Vcandidate−Vth, the chosen proxy is
p(ξ)=1+β∣ξ∣βξ,∂ξ∂s≈(1+β∣ξ∣)2β.(38)
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 β=1.
Let sg(z) denote stop-gradient: it returns z forward but has zero derivative. The simulator constructs
s=sg(H(ξ))+p(ξ)−sg(p(ξ)).(39)
Equation 39 equals H(ξ) numerically, while autograd differentiates only p(ξ).[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:
δVE→δsE→δgE→I→δVI→δsI→δgI→E→δVE.(41)
The local gain of this route follows from the membrane equations rather than from an extra model quantity. Choose X=E for excitatory conductance or X=I for inhibitory conductance. Differentiating Equation 18 and the decay a in Equation 23 gives
∂gX∂V∞=gtotEX−V∞,∂gX∂a=−CmΔtsima.(42)
Applying the product rule to ΔV=(V∞−Vm)(1−a) gives the conductance-to-voltage response
The response RX in Equation 43 has units of millivolts per microsiemens. Let RE→I and RI→E be diagonal matrices of the appropriate responses at I and E neurons. Let SE and SI be diagonal matrices containing the local surrogate derivatives from Equation 38. One complete backward traversal of Equation 41 then has return Jacobian
Jloop=RI→EWI→E⊤SIRE→IWE→I⊤SE.(44)
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 n times contains JloopnδVE. If the spectral radius ρ(Jloop)>1, 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 dgrad>0, define
αgrad=dgrad1,Dα(z)=αz+(1−α)sg(z).(45)
Forward evaluation of Equation 45 gives Dα(z)=z, but its backward derivative is
∂z∂Dα(z)=α.(46)
The hidden E and I membrane updates replace Equation 23 by
Vcandidate[k+1]=Vm[k]+Dαgrad(ΔV[k]).(47)
Equation 45 and Equation 47 leave voltages and spikes unchanged forward. Backward, each selected conductance-to-voltage response is multiplied by αgrad. The PING return term in Equation 44 consequently becomes
Jloop,damped=αgrad2Jloop.(48)
The standard paired classifiers use dgrad=1000, so αgrad=10−3 and this particular complete loop term is scaled by 10−6. This does not scale the entire state Jacobian because Equation 45 is inserted only on the ΔV 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 αgrad, but the direct identity route from Vm[k] to Vcandidate[k+1] 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 αgrad for which the complete step Jacobian is simply αgradJstep.
Without damping, Equation 50 reduces to a. 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 g=∇θLtotal, the trainer computes its global Euclidean norm
∥g∥2=p∑i∑gp,i2.(51)
With clipping threshold c=1, it replaces the gradient by
g~=gmin(1,∥g∥2c).(52)
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
m^[n]=1−β1nm[n],v^[n]=1−β2nv[n].(54)
For learning rate η, decoupled weight decay λwd, and numerical stabilizer ε, AdamW applies
θ[n+21]=(1−ηλwd)θ[n]−ηv^[n]+εm^[n].(55)
The standard training recipe used η=0.0004, λwd=0, 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:
θ[n+1]=max(0,θ[n+21]).(56)
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.