COBA and PING: Dynamics 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 E→I→EE \to I \to E.[1]

Physical time is tt, the simulation-step index is kk, and tk=kΔtsimt_{k} = k \Delta t_{\text{sim}}, where Δtsim\Delta t_{\text{sim}} is the integration timestep. A presentation contains NtN_{t} timesteps and has duration Tpresent=NtΔtsimT_{\text{present}} = N_{t} \Delta t_{\text{sim}}. Superscripts on conductances identify AMPA or GABA polarity, while subscripts identify the receiving population.

Continuous membrane dynamics

For neuron jj in population X∈{E,I}X \in \{ E , I \}, the membrane equation is

Cm,XdVm,X,jdt=−gL,X(Vm,X,j−EL)−gX,jE(Vm,X,j−EE)−gX,jI(Vm,X,j−EI).(1)C_{m , X} \frac{d V_{m , X , j}}{d t} = - g_{L , X} ( V_{m , X , j} - E_{L} ) - g_{X , j}^{E} ( V_{m , X , j} - E_{E} ) - g_{X , j}^{I} ( V_{m , X , j} - E_{I} ) . \tag{1}

In Equation 1, VmV_{m} is membrane voltage, CmC_{m} is capacitance, gLg_{L} is leak conductance, and gEg^{E} and gIg^{I} are total AMPA and GABA conductances. The reversal potentials are

EL=−65 mV,EE=0 mV,EI=−80 mV.(2)E_{L} = - 65 \: \text{mV} , \quad E_{E} = 0 \: \text{mV} , \quad E_{I} = - 80 \: \text{mV} . \tag{2}

A conductance gg with reversal potential EE supplies current I=g(E−Vm)I = g ( E - V_{m} ). Equation 2 therefore makes AMPA normally depolarizing and GABA normally hyperpolarizing. The fixed membrane parameters are

Cm,E=1 nF,gL,E=0.05 μS,Cm,I=0.5 nF,gL,I=0.1 μS.(3)C_{m , E} = 1 \: \text{nF} , \quad g_{L , E} = 0.05 \: \mu\mathrm{S} , \quad C_{m , I} = 0.5 \: \text{nF} , \quad g_{L , I} = 0.1 \: \mu\mathrm{S} . \tag{3}

The corresponding passive membrane time constants follow from τm=CmgL\tau_{m} = \frac{C_{m}}{g_{L}}:

τm,E=20 ms,τm,I=5 ms.(4)\tau_{m , E} = 20 \: \text{ms} , \quad \tau_{m , I} = 5 \: \text{ms} . \tag{4}

Continuous synaptic dynamics

The continuous spike train emitted by presynaptic neuron ii is

si(t)=∑jδ(t−ti,j),(5)s_{i ( t )} = \sum_{j} \delta ( t - t_{i , j} ) , \tag{5}

where ti,jt_{i , j} is event time jj and δ\delta is the Dirac impulse. A postsynaptic conductance gjg_{j} with decay constant τ\tau satisfies

dgjdt=−gjτ+∑iwevent,i,jsi(t).(6)\frac{d g_{j}}{d t} = - \frac{g_{j}}{\tau} + \sum_{i} w_{\text{event} , i , j} s_{i ( t )} . \tag{6}

Here wevent,i,jw_{\text{event} , i , j} is the conductance increment produced by one presynaptic event. AMPA and GABA use separate copies of Equation 6 with τAMPA=2 ms\tau_{\text{AMPA}} = 2 \: \text{ms} and the canonical τGABA=6 ms\tau_{\text{GABA}} = 6 \: \text{ms}.

Discretising the synaptic equations

Between events, Equation 6 reduces to

dgdt=−gτ,dgg=−dtτ.(7)\frac{d g}{d t} = - \frac{g}{\tau} , \quad \frac{d g}{g} = - \frac{d t}{\tau} . \tag{7}

Integrating Equation 7 from tkt_{k} to tk+1=tk+Δtsimt_{k + 1} = t_{k} + \Delta t_{\text{sim}} gives

∫g[k]g−[k+1]dgg=−∫tktk+Δtsimdtτ,ln⁡g−[k+1]g[k]=−Δtsimτ.(8)\int_{g [ k ]}^{g^{-} [ k + 1 ]} \frac{d g}{g} = - \int_{t_{k}}^{t_{k} + \Delta t_{\text{sim}}} \frac{d t}{\tau} , \quad \ln \frac{g^{-} [ k + 1 ]}{g [ k ]} = - \frac{\Delta t_{\text{sim}}}{\tau} . \tag{8}

Exponentiating Equation 8 yields the event-free decay

g−[k+1]=g[k]exp⁡(−Δtsimτ).(9)g^{-} [ k + 1 ] = g [ k ] \exp ( - \frac{\Delta t_{\text{sim}}}{\tau} ) . \tag{9}

Integrating Equation 6 across an infinitesimal interval containing one event gives

g(ti+)−g(ti−)=wevent.(10)g ( t_{i}^{+} ) - g ( t_{i}^{-} ) = w_{\text{event}} . \tag{10}

Combining Equation 9 and Equation 10 gives the timestep recurrence

g[k+1]=exp⁡(−Δtsimτ)g[k]+s[k]W+u[k].(11)\boldsymbol{g} [ k + 1 ] = \exp ( - \frac{\Delta t_{\text{sim}}}{\tau} ) \boldsymbol{g} [ k ] + \boldsymbol{s} [ k ] W + \boldsymbol{u} [ k ] . \tag{11}

In Equation 11, s[k]\boldsymbol{s} [ k ] is a dimensionless binary presynaptic spike vector, WW has presynaptic neurons on rows and postsynaptic neurons on columns, and u[k]\boldsymbol{u} [ k ] 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

βAMPA=exp⁡(−ΔtsimτAMPA),βGABA=exp⁡(−ΔtsimτGABA).(12)\beta_{\text{AMPA}} = \exp ( - \frac{\Delta t_{\text{sim}}}{\tau_{\text{AMPA}}} ) , \quad \beta_{\text{GABA}} = \exp ( - \frac{\Delta t_{\text{sim}}}{\tau_{\text{GABA}}} ) . \tag{12}

For one E–I layer, Equation 11 expands to

gE[k+1]E=βAMPAgE[k]E+sE[k]WE→E+x[k]Win+uE[k]E,(13)\boldsymbol{g}_{E [ k + 1 ]}^{E} = \beta_{\text{AMPA}} \boldsymbol{g}_{E [ k ]}^{E} + \boldsymbol{s}_{E [ k ]} W_{E \to E} + \boldsymbol{x} [ k ] W_{\text{in}} + \boldsymbol{u}_{E [ k ]}^{E} , \tag{13} gE[k+1]I=βGABAgE[k]I+sI[k]WI→E+uE[k]I,(14)\boldsymbol{g}_{E [ k + 1 ]}^{I} = \beta_{\text{GABA}} \boldsymbol{g}_{E [ k ]}^{I} + \boldsymbol{s}_{I [ k ]} W_{I \to E} + \boldsymbol{u}_{E [ k ]}^{I} , \tag{14} gI[k+1]E=βAMPAgI[k]E+sE[k]WE→I+xI[k]Win,I+uI[k]E,(15)\boldsymbol{g}_{I [ k + 1 ]}^{E} = \beta_{\text{AMPA}} \boldsymbol{g}_{I [ k ]}^{E} + \boldsymbol{s}_{E [ k ]} W_{E \to I} + \boldsymbol{x}_{I [ k ]} W_{\text{in} , I} + \boldsymbol{u}_{I [ k ]}^{E} , \tag{15} gI[k+1]I=βGABAgI[k]I+sI[k]WI→I+uI[k]I.(16)\boldsymbol{g}_{I [ k + 1 ]}^{I} = \beta_{\text{GABA}} \boldsymbol{g}_{I [ k ]}^{I} + \boldsymbol{s}_{I [ k ]} W_{I \to I} + \boldsymbol{u}_{I [ k ]}^{I} . \tag{16}

The canonical architecture sets WE→E=WI→I=0W_{E \to E} = W_{I \to I} = 0. COBA additionally disables WE→IW_{E \to I} and WI→EW_{I \to 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

CmdVmdt=−(gL+gE+gI)Vm+gLEL+gEEE+gIEI.(17)C_{m} \frac{d V_{m}}{d t} = - ( g_{L} + g_{E} + g_{I} ) V_{m} + g_{L} E_{L} + g_{E} E_{E} + g_{I} E_{I} . \tag{17}

Define the total conductance and its conductance-weighted equilibrium voltage by

gtot=gL+gE+gI,V∞=gLEL+gEEE+gIEIgtot.(18)g_{\text{tot}} = g_{L} + g_{E} + g_{I} , \quad V_{\infty} = \frac{g_{L} E_{L} + g_{E} E_{E} + g_{I} E_{I}}{g_{\text{tot}}} . \tag{18}

Substituting Equation 18 into Equation 17 gives

CmdVmdt=−gtot(Vm−V∞),τeff=Cmgtot.(19)C_{m} \frac{d V_{m}}{d t} = - g_{\text{tot} ( V_{m} - V_{\infty} )} , \quad \tau_{\text{eff}} = \frac{C_{m}}{g_{\text{tot}}} . \tag{19}

Let q=Vm−V∞q = V_{m} - V_{\infty}. Because the conductances and V∞V_{\infty} are constant within the timestep,

dqdt=−qτeff,dqq=−dtτeff.(20)\frac{d q}{d t} = - \frac{q}{\tau_{\text{eff}}} , \quad \frac{d q}{q} = - \frac{d t}{\tau_{\text{eff}}} . \tag{20}

Integrating Equation 20 over one timestep gives

ln⁡q[k+1]q[k]=−Δtsimτeff,q[k+1]=q[k]exp⁡(−Δtsimτeff).(21)\ln \frac{q [ k + 1 ]}{q [ k ]} = - \frac{\Delta t_{\text{sim}}}{\tau_{\text{eff}}} , \quad q [ k + 1 ] = q [ k ] \exp ( - \frac{\Delta t_{\text{sim}}}{\tau_{\text{eff}}} ) . \tag{21}

Returning to membrane voltage produces the pre-threshold candidate

Vcandidate[k+1]=V∞+(Vm[k]−V∞)exp⁡(−ΔtsimgtotCm).(22)V_{\text{candidate} [ k + 1 ]} = V_{\infty} + ( V_{m [ k ]} - V_{\infty} ) \exp ( - \frac{\Delta t_{\text{sim}} g_{\text{tot}}}{C_{m}} ) . \tag{22}

Equivalently, define

a=exp⁡(−ΔtsimgtotCm),ΔV[k]=(V∞−Vm[k])(1−a),Vcandidate[k+1]=Vm[k]+ΔV[k].(23)\begin{gathered} a = \exp ( - \frac{\Delta t_{\text{sim}} g_{\text{tot}}}{C_{m}} ) , \\ \Delta V [ k ] = ( V_{\infty} - V_{m [ k ]} ) ( 1 - a ) , \\ V_{\text{candidate} [ k + 1 ]} = V_{m [ k ]} + \Delta V [ k ] . \end{gathered} \tag{23}

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]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)r^{-} [ k + 1 ] = \max ( r [ k ] - 1 , 0 ) . \tag{24}

A neuron emits the binary spike

s[k+1]=H(Vcandidate[k+1]−Vth)𝟏[r−[k+1]=0],(25)s [ k + 1 ] = H ( V_{\text{candidate} [ k + 1 ]} - V_{\text{th}} ) 𝟏 [ r^{-} [ k + 1 ] = 0 ] , \tag{25}

where HH is the Heaviside step function, Vth=−50 mVV_{\text{th}} = - 50 \: \text{mV}, and 𝟏𝟏 is an indicator. A neuron that spikes, or remains refractory after Equation 24, is stored at Vreset=−65 mVV_{\text{reset}} = - 65 \: \text{mV}. A new spike sets the counter to the population’s refractory step count; otherwise it retains r−[k+1]r^{-} [ k + 1 ].

The canonical timestep is Δtsim=0.1 ms\Delta t_{\text{sim}} = 0.1 \: \text{ms}. The excitatory and inhibitory refractory durations, 1.2 ms1.2 \: \text{ms} and 0.6 ms0.6 \: \text{ms}, 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]\boldsymbol{h} [ k ] be the final hidden E-population spike vector and WoutW_{\text{out}} the hidden-to-output matrix. With output decay βo=exp⁡(−Δtsimτo)\beta_{o} = \exp ( - \Delta \frac{t_{\text{sim}}}{\tau_{o}} ), the pre-reset dimensionless output state is

ao[k+1]=βouo[k]+1−βoΔtsimh[k+1]Wout.(26)\boldsymbol{a}_{o [ k + 1 ]} = \beta_{o} \boldsymbol{u}_{o [ k ]} + \frac{1 - \beta_{o}}{\Delta t_{\text{sim}}} \boldsymbol{h} [ k + 1 ] W_{\text{out}} . \tag{26}

The output spike and subtractive reset are

so[k+1]=H(ao[k+1]−θo),uo[k+1]=ao[k+1]−θoso[k+1],(27)\boldsymbol{s}_{o [ k + 1 ]} = H ( \boldsymbol{a}_{o [ k + 1 ]} - \theta_{o} ) , \quad \boldsymbol{u}_{o [ k + 1 ]} = \boldsymbol{a}_{o [ k + 1 ]} - \theta_{o} \boldsymbol{s}_{o [ k + 1 ]} , \tag{27}

where θo=1\theta_{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=1Nt∑k=1Ntao,c[k].(28)z_{c} = \frac{1}{N_{t}} \sum_{k = 1}^{N_{t}} a_{o , c} [ k ] . \tag{28}

For minibatch member bb, softmax-normalized evidence is

pb,c=exp⁡(zb,c)∑q=1Noutexp⁡(zb,q).(29)p_{b , c} = \frac{\exp ( z_{b , c} )}{\sum_{q = 1}^{N_{\text{out}}} \exp ( z_{b , q} )} . \tag{29}

It is used for optimization but is not assumed to be a calibrated probability. For true class yby_{b}, the mean cross-entropy training loss is

LCE=−1B∑b=1Bln⁡pb,yb.(30)L_{\text{CE}} = - \frac{1}{B} \sum_{b = 1}^{B} \ln p_{b , y_{b}} . \tag{30}

Some conditions add a one-sided firing-rate ceiling. Let Kb,l,j=∑k=1Ntsb,l,j[k]K_{b , l , j} = \sum_{k = 1}^{N_{t}} s_{b , l , j} [ k ] be the spike count of hidden E neuron jj in layer ll for presentation bb. Its sample-wise population-mean rate is

∣r∣b,l=1NE,lTpresent∑j=1NE,lKb,l,j.(31){\vert r \vert}_{b , l} = \frac{1}{N_{E , l} T_{\text{present}}} \sum_{j = 1}^{N_{E , l}} K_{b , l , j} . \tag{31}

With tested ceiling rE,ceilr_{E , \text{ceil}} and coefficient λrate\lambda_{\text{rate}}, the penalty is

Lrate=λrateBL∑b=1B∑l=1Lmax⁡(0,∣r∣b,l−rE,ceil)2,Ltotal=LCE+Lrate.(32)L_{\text{rate}} = \frac{\lambda_{\text{rate}}}{B L} \sum_{b = 1}^{B} \sum_{l = 1}^{L} {\max ( 0 , {\vert r \vert}_{b , l} - r_{E , \text{ceil}} )}^{2} , \quad L_{\text{total}} = L_{\text{CE}} + L_{\text{rate}} . \tag{32}

The canonical reference conditions set λrate=0\lambda_{\text{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]\boldsymbol{x} [ k ]. One complete simulation step has the abstract form

x[k+1]=Fk(x[k],u[k];θ),Ltotal=ℓ(x[Nt],y).(33)\boldsymbol{x} [ k + 1 ] = F_{k ( \boldsymbol{x} [ k ] , \boldsymbol{u} [ k ] ; \theta )} , \quad L_{\text{total}} = \ell ( \boldsymbol{x} [ N_{t} ] , y ) . \tag{33}

FkF_{k} 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 FkF_{k}.

Here u[k]\boldsymbol{u} [ k ] denotes external input, θ\theta is the shared trainable parameter vector, and ℓ\ell includes the readout and objective defined in Equation 28–Equation 32. At Δtsim=0.1 ms\Delta t_{\text{sim}} = 0.1 \: \text{ms}, a 200 ms200 \: \text{ms} presentation applies FkF_{k} 2,000 times. Each copy has a different state but reuses the same parameters.

Define the state sensitivity

δ[k]=∇x[k]Ltotal,Jstep[k]=∂Fk∂x[k].(34)\boldsymbol{\delta} [ k ] = \nabla_{\boldsymbol{x} [ k ]} L_{\text{total}} , \quad J_{\text{step} [ k ]} = \frac{\partial F_{k}}{\partial \boldsymbol{x} [ k ]} . \tag{34}

Let xi[k]x_{i [ k ]} be component ii of the current state and Fk,jF_{k , j} component jj of FkF_{k}. The project evaluates its loss from the terminal readout and rate accumulators. Consequently, for k<Ntk < N_{t}, the current state affects the loss through the next state. Applying the multivariable chain rule component by component gives

δi[k]=∂Ltotal∂xi[k]=∑j∂Ltotal∂xj[k+1]∂xj[k+1]∂xi[k]=∑jδj[k+1]∂Fk,j∂xi[k],δ[k]=Jstep[k]⊤δ[k+1],δ[Nt]=∇x[Nt]ℓ(x[Nt],y).(35)\begin{aligned} \delta_{i [ k ]} & = \frac{\partial L_{\text{total}}}{\partial x_{i [ k ]}} \\ & = \sum_{j} \frac{\partial L_{\text{total}}}{\partial x_{j [ k + 1 ]}} \frac{\partial x_{j [ k + 1 ]}}{\partial x_{i [ k ]}} \\ & = \sum_{j} \delta_{j [ k + 1 ]} \frac{\partial F_{k , j}}{\partial x_{i [ k ]}} , \\ \boldsymbol{\delta} [ k ] & = J_{\text{step} [ k ]}^{\top} \boldsymbol{\delta} [ k + 1 ] , \quad \boldsymbol{\delta} [ N_{t} ] = \nabla_{\boldsymbol{x} [ N_{t} ]} \ell ( \boldsymbol{x} [ N_{t} ] , y ) . \end{aligned} \tag{35}

The second line of Equation 35 sums every route from state component xi[k]x_{i [ k ]} to the later loss through next-state component xj[k+1]x_{j [ 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

∇θLtotal=∇θdirectLtotal+∑k=0Nt−1∂Fk∂θ⊤δ[k+1].(36)\nabla_{\theta} L_{\text{total}} = \nabla_{\theta}^{\text{direct}} L_{\text{total}} + \sum_{k = 0}^{N_{t} - 1} {\frac{\partial F_{k}}{\partial \theta}}^{\top} \boldsymbol{\delta} [ k + 1 ] . \tag{36}

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\boldsymbol{g} [ k + 1 ] = \beta \boldsymbol{g} [ k ] + \boldsymbol{s} [ k ] W gives

∇WLtotal=∑ks[k]⊤∇g[k+1]Ltotal.(37)\nabla_{W} L_{\text{total}} = \sum_{k} \boldsymbol{s} {[ k ]}^{\top} \nabla_{\boldsymbol{g} [ k + 1 ]} L_{\text{total}} . \tag{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\xi = V_{\text{candidate}} - V_{\text{th}}, the chosen proxy is

p(ξ)=βξ1+β∣ξ∣,∂s∂ξ≈β(1+β∣ξ∣)2.(38)p ( \xi ) = \frac{\beta \xi}{1 + \beta \vert \xi \vert} , \quad \frac{\partial s}{\partial \xi} \approx \frac{\beta}{{( 1 + \beta \vert \xi \vert )}^{2}} . \tag{38}

The approximate equality in Equation 38 denotes an assigned backward rule rather than the true derivative of the Heaviside function. For hidden neurons, ξ\xi is measured in millivolts and β\beta in reciprocal millivolts. The standard classifiers use β=1\beta = 1.

Let sg⁡(z)\operatorname{sg} ( z ) denote stop-gradient: it returns zz forward but has zero derivative. The simulator constructs

s=sg⁡(H(ξ))+p(ξ)−sg⁡(p(ξ)).(39)s = \operatorname{sg} ( H ( \xi ) ) + p ( \xi ) - \operatorname{sg} ( p ( \xi ) ) . \tag{39}

Equation 39 equals H(ξ)H ( \xi ) numerically, while autograd differentiates only p(ξ)p ( \xi ).[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:

δ[k]=Jstep[k]⊤Jstep[k+1]⊤…Jstep[Nt−1]⊤δ[Nt]+direct terms.(40)\boldsymbol{\delta} [ k ] = J_{\text{step} [ k ]}^{\top} J_{\text{step} [ k + 1 ]}^{\top} \ldots J_{\text{step} [ N_{t} - 1 ]}^{\top} \boldsymbol{\delta} [ N_{t} ] + \text{direct terms} . \tag{40}

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)\delta \boldsymbol{V}_{E} \to \delta \boldsymbol{s}_{E} \to \delta \boldsymbol{g}_{E \to I} \to \delta \boldsymbol{V}_{I} \to \delta \boldsymbol{s}_{I} \to \delta \boldsymbol{g}_{I \to E} \to \delta \boldsymbol{V}_{E} . \tag{41}

The local gain of this route follows from the membrane equations rather than from an extra model quantity. Choose X=EX = E for excitatory conductance or X=IX = I for inhibitory conductance. Differentiating Equation 18 and the decay aa in Equation 23 gives

∂V∞∂gX=EX−V∞gtot,∂a∂gX=−ΔtsimCma.(42)\frac{\partial V_{\infty}}{\partial g_{X}} = \frac{E_{X} - V_{\infty}}{g_{\text{tot}}} , \quad \frac{\partial a}{\partial g_{X}} = - \frac{\Delta t_{\text{sim}}}{C_{m}} a . \tag{42}

Applying the product rule to ΔV=(V∞−Vm)(1−a)\Delta V = ( V_{\infty} - V_{m} ) ( 1 - a ) gives the conductance-to-voltage response

RX≔∂ΔV∂gX=(EX−V∞)(1−a)gtot+(V∞−Vm)ΔtsimCma.(43)R_{X} \coloneqq \frac{\partial \Delta V}{\partial g_{X}} = \frac{( E_{X} - V_{\infty} ) ( 1 - a )}{g_{\text{tot}}} + ( V_{\infty} - V_{m} ) \frac{\Delta t_{\text{sim}}}{C_{m}} a . \tag{43}

The response RXR_{X} in Equation 43 has units of millivolts per microsiemens. Let RE→IR_{E \to I} and RI→ER_{I \to E} be diagonal matrices of the appropriate responses at I and E neurons. Let SES_{E} and SIS_{I} 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)J_{\text{loop}} = R_{I \to E} W_{I \to E}^{\top} S_{I} R_{E \to I} W_{E \to I}^{\top} S_{E} . \tag{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 nn times contains JloopnδVEJ_{\text{loop}}^{n} \delta \boldsymbol{V}_{E}. If the spectral radius ρ(Jloop)>1\rho ( J_{\text{loop}} ) > 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>0d_{\text{grad}} > 0, define

αgrad=1dgrad,Dα(z)=αz+(1−α)sg⁡(z).(45)\alpha_{\text{grad}} = \frac{1}{d_{\text{grad}}} , \quad \mathcal{D}_{\alpha ( z )} = \alpha z + ( 1 - \alpha ) \operatorname{sg} ( z ) . \tag{45}

Forward evaluation of Equation 45 gives Dα(z)=z\mathcal{D}_{\alpha ( z )} = z, but its backward derivative is

∂Dα(z)∂z=α.(46)\frac{\partial \mathcal{D}_{\alpha ( z )}}{\partial z} = \alpha . \tag{46}

The hidden E and I membrane updates replace Equation 23 by

Vcandidate[k+1]=Vm[k]+Dαgrad(ΔV[k]).(47)V_{\text{candidate} [ k + 1 ]} = V_{m [ k ]} + \mathcal{D}_{\alpha_{\text{grad}}} ( \Delta V [ k ] ) . \tag{47}

Equation 45 and Equation 47 leave voltages and spikes unchanged forward. Backward, each selected conductance-to-voltage response is multiplied by αgrad\alpha_{\text{grad}}. The PING return term in Equation 44 consequently becomes

Jloop,damped=αgrad2Jloop.(48)J_{\text{loop,damped}} = \alpha_{\text{grad}}^{2} J_{\text{loop}} . \tag{48}

The standard paired classifiers use dgrad=1000d_{\text{grad}} = 1000, so αgrad=10−3\alpha_{\text{grad}} = 10^{- 3} and this particular complete loop term is scaled by 10−610^{- 6}. This does not scale the entire state Jacobian because Equation 45 is inserted only on the ΔV\Delta V branch of Equation 47. For one hidden neuron, the three local derivatives entering its candidate voltage are therefore

∂Vcandidate∂(Vm,gE,gI)=1+αgrad∂ΔV∂Vm,αgrad∂ΔV∂gE,αgrad∂ΔV∂gI.(49)\frac{\partial V_{\text{candidate}}}{\partial ( V_{m} , g_{E} , g_{I} )} = 1 + \alpha_{\text{grad}} \frac{\partial \Delta V}{\partial V_{m}} , \alpha_{\text{grad}} \frac{\partial \Delta V}{\partial g_{E}} , \alpha_{\text{grad}} \frac{\partial \Delta V}{\partial g_{I}} . \tag{49}

Thus the conductance-to-voltage blocks are multiplied by αgrad\alpha_{\text{grad}}, but the direct identity route from Vm[k]V_{m [ k ]} to Vcandidate[k+1]V_{\text{candidate} [ 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\alpha_{\text{grad}} for which the complete step Jacobian is simply αgradJstep\alpha_{\text{grad}} J_{\text{step}}.

Holding conductances fixed before bounds and reset, Equation 49 and Equation 23 give

∂Vcandidate[k+1]∂Vm[k]=1−αgrad(1−a).(50)\frac{\partial V_{\text{candidate} [ k + 1 ]}}{\partial V_{m [ k ]}} = 1 - \alpha_{\text{grad} ( 1 - a )} . \tag{50}

Without damping, Equation 50 reduces to aa. 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\boldsymbol{g} = \nabla_{\theta} L_{\text{total}}, the trainer computes its global Euclidean norm

∥g∥2=∑p∑igp,i2.(51)\Vert \boldsymbol{g} \Vert_{2} = \sqrt{\sum_{p} \sum_{i} g_{p , i}^{2}} . \tag{51}

With clipping threshold c=1c = 1, it replaces the gradient by

g~=gmin⁡(1,c∥g∥2).(52)\tilde{\boldsymbol{g}} = \boldsymbol{g} \min ( 1 , \frac{c}{\Vert \boldsymbol{g} \Vert_{2}} ) . \tag{52}

A non-finite norm causes the optimizer step to be skipped. Otherwise AdamW forms first- and second-moment estimates

m[n]=β1m[n−1]+(1−β1)g~[n],v[n]=β2v[n−1]+(1−β2)g~[n]2.(53)\boldsymbol{m} [ n ] = \beta_{1} \boldsymbol{m} [ n - 1 ] + ( 1 - \beta_{1} ) \tilde{\boldsymbol{g}} [ n ] , \quad \boldsymbol{v} [ n ] = \beta_{2} \boldsymbol{v} [ n - 1 ] + ( 1 - \beta_{2} ) \tilde{\boldsymbol{g}} {[ n ]}^{2} . \tag{53}

The square in Equation 53 is elementwise. Bias correction gives

m^[n]=m[n]1−β1n,v^[n]=v[n]1−β2n.(54)\hat{\boldsymbol{m}} [ n ] = \frac{\boldsymbol{m} [ n ]}{1 - \beta_{1}^{n}} , \quad \hat{\boldsymbol{v}} [ n ] = \frac{\boldsymbol{v} [ n ]}{1 - \beta_{2}^{n}} . \tag{54}

For learning rate η\eta, decoupled weight decay λwd\lambda_{\text{wd}}, and numerical stabilizer ε\varepsilon, AdamW applies

θ[n+12]=(1−ηλwd)θ[n]−ηm^[n]v^[n]+ε.(55)\theta^{[ n + \frac{1}{2} ]} = ( 1 - \eta \lambda_{\text{wd}} ) \theta^{[ n ]} - \eta \frac{\hat{\boldsymbol{m}} [ n ]}{\sqrt{\hat{\boldsymbol{v}} [ n ]} + \varepsilon} . \tag{55}

The standard training recipe used η=0.0004\eta = 0.0004, λwd=0\lambda_{\text{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+12]).(56)\theta^{[ n + 1 ]} = \max ( 0 , \theta^{[ n + \frac{1}{2} ]} ) . \tag{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.

References

  1. 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.

  2. E. O. Neftci, H. Mostafa and F. Zenke. “Surrogate Gradient Learning in Spiking Neural Networks.” arXiv (2019). doi:10.48550/arXiv.1901.09948

  3. 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).

  4. PyTorch contributors. “Autograd mechanics”, “Tensor.backward”, and “torch.optim.” PyTorch documentation (accessed 15 September 2026).

  5. PyTorch contributors. “Tensor.detach.” PyTorch documentation (accessed 15 September 2026).