They answer different questions.它们回答的,不是同一个问题。
How a neuron produces spikes and how a network learns a task are different questions. Separate the model, the gradient, and the learning rule before combining their equations.神经元“怎样产生脉冲”,与网络“怎样学会任务”,是两个层次。先把模型、梯度与学习规则分开,后面的公式才不会混在一起。
How does the state evolve?状态怎样演化?
Define integration, output, and reset: these determine the network’s forward computation.[1][2]定义积分、输出和复位;决定网络前向计算什么。[1][2]
UltraLIF can therefore be trained with BPTT. Standard LIF can use surrogate-gradient BPTT, STDP, or continuous-time event differentiation with EventProp. These are not five mutually exclusive algorithms.因此,UltraLIF 可以用 BPTT 训练;标准 LIF 可以搭配代理梯度 BPTT、STDP,或采用 EventProp 的连续时间事件求导。它们不是五个互相替代的算法。
LIF: a leaky capacitor that fires.LIF:一只会“放电”的漏电电容。
Input current raises the membrane potential; leakage pulls it toward rest. At threshold, the neuron emits a spike and resets: the three operations in Leaky Integrate-and-Fire.[1]输入电流把膜电位往上推,漏电把它拉回静息状态。达到阈值时,神经元发出脉冲,然后复位。这就是 Leaky Integrate-and-Fire 的三个动作。[1]
Start with current conservation从电流守恒开始
Let membrane capacitance be
Define
This describes only integration. The firing condition
What happens when the input exceeds threshold?把输入推过阈值,会发生什么?
Derivation A: integrating factors, exponential memory, and constant input推导 A:积分因子、指数记忆与恒定输入解 DERIVATION
Write the equation as
Integrating from
This is exponentially weighted memory: old input persists, but its influence decays with time. For constant
Starting from reset value
Here
Discrete implementation: integrate, test, reset离散实现:先积分,再判断,再复位
Assuming constant input within each step, exact integration gives
Hard reset硬复位
After a spike, return directly to the specified potential. Any overshoot within the discrete step is discarded.放电后直接回到指定电位,离散步内的超调被丢弃。
Subtractive reset减法复位
With a zero reset baseline, subtract the threshold and retain the excess voltage after firing.此处取零复位基准;放电后保留超过阈值的“余量”。
Derivation B: discretization and closed-form propagation of exponential synapses推导 B:离散化与指数突触的闭式传播 DERIVATION
Exact one-step integration differs from Euler approximation精确单步积分与 Euler 近似不同
The leak factors are close only for a sufficiently small time step. State explicitly which discretization the implementation uses.只有时间步足够小时,两者的漏电系数才接近。必须明确代码使用哪一种。
Input spikes first enter the synaptic current输入脉冲先进入突触电流
Let
Over an interval
Substituting into the membrane-potential integral, for
When
This continuous-time, current-based model is also the starting point for the EventProp derivation below.[5]这一电流型连续时间模型也是后文 EventProp 推导的起点。[5]
UltraLIF: make the forward model differentiable. (2026 preprint v1)UltraLIF:让前向模型本身可微。2026 预印本 v1
Instead of borrowing a derivative for a hard threshold, change the forward computation: integrate with a smooth maximum, emit soft spikes with a sigmoid, and differentiate this smooth system directly.[2]另一条路线不是给硬阈值“借一个导数”,而是改变神经元的前向计算:用平滑最大值做积分、用 sigmoid 输出软脉冲,再对这个平滑系统求真实导数。[2]
From addition to max, from multiplication to addition从加法到 max,从乘法到加法
Apply the dimensionless exponential transformations
Set
As
How does temperature change the forward map and its derivative?温度,怎样改变前向与导数?
The complete integrate–output–reset equations完整的积分—输出—复位方程
Following Definition 4.1 of the original paper, let
At finite temperature,
Derivation C: local derivatives of state, input, weights, and reset推导 C:旧状态、输入、权重与复位的局部导数 DERIVATION
Suppress time indices, let
Differentiating LSE:对 LSE 求导:
Differentiating the soft spike:对软脉冲求导:
Write the reset as
The local Jacobians for temporal and input propagation are therefore:所以时间传播与输入传播的局部 Jacobian 分别为:
If
These partial derivatives hold the preceding state fixed. The complete loss gradient must also accumulate the parameter’s influence through future time steps: the role of BPTT in the next section.这里所有偏导都固定先前状态。完整的损失梯度还要把参数经由未来时间步产生的影响加起来,也就是下一节的 BPTT。
Derivation D: why can temperature itself be learned?推导 D:温度为什么也可以学习? DERIVATION
Holding
Using
This is exactly the entropy of the binary distribution
Parameterize temperature as
Two mathematical details worth checking separately两个值得单独核对的数学细节
If the original positive-variable recurrence has a fixed leak coefficient
For example, using the same numerical values
For fixed
Taking
BPTT: unfold time into a computation graph.BPTT:把时间,展开成一张计算图。
A neuron has a different state at each time. Represent each time step as a node, unfold the recurrence, and apply the chain rule backward: Backpropagation Through Time.[3]同一个神经元在不同时刻有不同状态。把每一个时刻复制成图中的一个节点,沿时间展开,再按链式法则逆向传播,就是 Backpropagation Through Time。[3]
The general backward recurrence最通用的反向递推
Let the state equation be
The terminal condition is
How does a product change long-range gradients?一串乘法,怎样改变远期梯度?
BPTT is not synonymous with a surrogate gradientBPTT 不等于代理梯度
When the forward map is differentiable, BPTT is the true chain rule for that discrete model. For hard LIF, a common approach retains hard spikes in the forward pass and replaces only the threshold derivative in the backward pass:[3]若前向映射真正可微,BPTT 就是该离散模型的真实链式法则。对硬 LIF,常见做法是保留前向硬脉冲,仅在反向替换阈值导数:[3]
The symbol
Derivation E: spatial and temporal BPTT for LIF, and weight gradients推导 E:LIF 的时空 BPTT 与权重梯度 DERIVATION
Consider layer
Let
Along the spatial path,
The first line propagates between layers; the second propagates through time. Consequently:第一行是层间反传;第二行是时间反传。于是:
Explicit recurrent connections显式循环连接的情况
If
Derivation F: hard reset, subtractive reset, and detached reset推导 F:硬复位、减法复位与 detach reset IMPLEMENTATION
Reset changes both the forward trajectory and the temporal Jacobian. The backward derivative of hard reset is:复位不仅影响前向轨迹,也改变时间 Jacobian。硬复位的反向导数为:
For subtractive reset:减法复位则为:
If only the spike s in the reset branch is detached, the hard-reset derivative becomes
“沿时间反传”是计算框架。
“用什么导数”才决定你在优化哪个模型。
Hard forward spikes with a surrogate derivative and soft forward spikes with a true derivative may produce similar-looking backward code, but their mathematical meanings differ.硬前向 + 代理导数,与软前向 + 真实导数,可能使用外观相似的反向代码,但其数学含义并不相同。
STDP: milliseconds of timing change a synapse.STDP:先后几十毫秒,改变一条突触。
Spike-Timing-Dependent Plasticity asks a local question: which neuron fires first, the presynaptic or the postsynaptic one? Here we consider the common pair-based exponential Hebbian window, not a universal rule for every biological synapse.[4]Spike-Timing-Dependent Plasticity 关注一个局部问题:突触前、后神经元,谁先放电?下面讨论最常用的双脉冲指数窗口、Hebbian 型规则,而不是声称所有生物突触都服从同一窗口。[4]
Define
Swap the order of two spikes.让两个脉冲交换先后顺序。
A₊ = 1,A₋ = 1.05
The exponential window comes from spike traces指数窗口并不神秘:它来自脉冲痕迹
Let the presynaptic trace
At a postsynaptic spike, read the presynaptic trace and potentiate. At a presynaptic spike, read the postsynaptic trace and depress:当突触后神经元放电时,读取前痕迹并增强;当突触前神经元放电时,读取后痕迹并减弱:
Reading the trace at
Derivation G: recover the pair window from local traces, then discretize推导 G:从局部痕迹恢复配对窗口与离散实现 DERIVATION
With zero initial conditions:零初始条件下:
If the presynaptic spike occurs first, its trace at the postsynaptic spike is
This implements all-to-all pairing; it is not automatically a nearest-neighbor rule.这对应 all-to-all 配对,不自动等于只保留最近一对脉冲。
The correct order in a discrete implementation离散实现的正确顺序
Let
This excludes zero-delay pairs within the same time bin. Coarse bins can erase the actual ordering, so temporal resolution is itself a modeling choice.这种写法不计同一时间格的零延迟配对。时间格太粗会抹去真实的先后顺序,因此时间分辨率本身就是模型选择。
Derivation H: correlation learning, weight drift, and three-factor rules推导 H:相关性学习、权重漂移与三因子规则 DERIVATION
For stationary spike processes, define cross-correlation density
When pre- and postsynaptic activity are independent with rates
Uncorrelated activity can still cause systematic drift. Additive STDP does not inherently keep weights bounded. With
A third factor: how good was the outcome?第三个因子:结果好不好?
Local pre- and postsynaptic activity does not directly know the task loss. One can maintain an eligibility trace e and gate it with a reward or modulatory signal M:[6]局部的前、后活动不直接知道任务损失。可以先维护资格痕迹 e,再用奖励或调制信号 M 门控:[6]
This provides a mechanism for delayed feedback, but an arbitrary three-factor rule is not automatically an exact gradient. A gradient interpretation requires a specified probabilistic model, loss, and eligibility trace.这为延迟反馈提供一种机制,但任意三因子规则也不自动等于精确梯度。是否可解释为梯度,需要明确概率模型、损失与资格痕迹的定义。
Ordinary STDP普通 STDP
Presynaptic activity times a postsynaptic local trace: this defines a learning rule.突触前活动 × 突触后局部痕迹。
它定义的是一种学习规则。
BPTT / EventProp
Presynaptic activity times an error signal propagated from the loss: these methods address gradient computation.突触前活动 × 从损失反传的误差信号。
它们解决的是梯度计算问题。
EventProp: differentiate when the threshold is crossed, rather than the hard threshold itself.EventProp:不去求硬阈值的导数,
而去求“何时越过阈值”。
A spike is a discrete event, but its time can move continuously with a weight. EventProp uses implicit differentiation to track that shift, then propagates event-related errors backward with an adjoint method.[5]一个脉冲看起来是离散事件,但它发生的时间,可以随着权重连续移动。EventProp 用隐式求导追踪这个时间变化,再用伴随法把事件处的误差信号反传。[5]
An implicit equation opens the door to event gradients一条隐式方程,打开事件梯度的入口
Suppose neuron n reaches threshold at
A parameter change affects both voltage and event time. Differentiate the equation with respect to both:参数改变时,电压和事件时间都会变。对上式同时求导:
How much earlier does the spike occur after a small weight change?轻轻改变权重,脉冲会提前多少?
Why does resetting voltage to zero not erase the gradient?为什么复位到零,梯度却不归零?
The reset condition is
Trajectories with slightly different parameters reset at different times. At the same absolute time, they have therefore undergone different durations of post-reset evolution. Differentiating only the assignment “set voltage to zero” misses this temporal path.[5]两条参数略有不同的轨迹,会在不同的时刻复位。在同一个绝对时刻比较时,它们已经经历了不同长度的复位后演化。只对“把电压设成零”这个赋值求导,会遗漏这条时间路径。[5]
Derivation I: hybrid systems and the saltation matrix推导 I:混合系统与跳跃敏感度矩阵 DERIVATION
Assume current-based LIF without self-connections or delays; fixed initial state, threshold, and time constants; and isolated events that cross the threshold transversally from below:以下采用无自连接、无延迟、电流型 LIF,固定初始状态、阈值和时间常数,并假设事件彼此孤立、从下方横截穿越阈值:
Write the state as
The event condition gives the time perturbation:由事件条件,时间扰动为:
Advance the perturbed trajectory to its shifted event, apply the reset, then align the post-event trajectory to the same reference time:先把扰动轨迹推进到移动后的事件,施加复位,再把事件后的轨迹对齐到同一参考时刻:
Substitution of the time perturbation gives the saltation matrix:代入时间扰动,得到跳跃敏感度矩阵,又称 saltation matrix:
The second term corrects for the moving event time. Here the event condition has no direct parameter dependence. Learnable thresholds or explicitly time-dependent event conditions require additional terms.第二项正是事件时间移动的修正。这里事件条件不直接依赖参数;若阈值可学习或事件条件显含时间,公式需添加相应项。
The adjoint method: avoid tracking every weight separately伴随法:让梯度计算不必逐个追踪每条权重
Maintaining state sensitivities for every weight is expensive. The adjoint method introduces backward variables
Here
Derivation J: augmented loss, integration by parts, and adjoint jumps推导 J:增广损失、分部积分与伴随跳跃 FULL DERIVATION
Take the loss:取损失:
Within each inter-event interval, add dynamical constraints that evaluate to zero:在每个事件间隔内加入为零的动力学约束:
Differentiate with respect to the parameters, then integrate by parts the terms containing time derivatives of state sensitivities. The coefficients of voltage and current sensitivities are:对参数求导,对含状态敏感度时间导数的项分部积分。电压敏感度和电流敏感度前的系数分别为:
Set both coefficients to zero and rewrite in reverse time to recover the inter-event adjoint equations above.令两者为零,再改写为逆时间,得到正文中的事件间伴随方程。
What remains at the event?事件处还剩什么?
Let
Insert the event-time derivative and sensitivity jump, and eliminate coefficients of the unknown sensitivities. The current adjoint is continuous, as is the voltage adjoint for neurons that did not fire:代入事件时刻导数与状态敏感度跳跃,让未知敏感度前的系数消失。电流伴随连续,未放电神经元的电压伴随连续:
The voltage adjoint of the firing neuron n jumps according to:放电神经元 n 的电压伴随跳跃为:
The four numerator terms represent self-reset, the spike’s effect on the postsynaptic network, direct spike-time loss, and movement of the integration boundary. The denominator again comes from implicit differentiation of the threshold event. This jump condition carries the backward calculation through a hard event.分子中的四部分依次对应:自身复位、输出脉冲对突触后网络的影响、脉冲时刻直接损失、积分边界移动。分母仍来自阈值事件的隐式求导。这个跳跃条件才让反向计算“穿过”硬事件。
The final weight gradient accumulates only at input events最终的权重梯度,只在输入事件上累加
When neuron j fires,
This resembles “presynaptic event times postsynaptic signal.” Here, however, the postsynaptic signal is an adjoint propagated from the global loss, not the local spike trace in ordinary STDP. The minus sign and
Derivation K: the experiment’s closed form and finite-difference check推导 K:交互实验的闭式解与有限差分核验 NUMERICAL CHECK
At t = 0, a fixed external event raises current from zero to w while voltage stays zero. Taking
The maximum of K is 1/4. At threshold 1, only
Choose the larger root to select the first crossing on the rising branch. Implicit differentiation gives:使用较大的根,选择上升段的首次穿越。隐式求导得到:
At the default weight w = 5 and target time 8 ms:在默认值 w = 5、目标时刻 8 ms 时:
The experiment compares the analytic gradient with the central difference
import math
def first_spike_time(w: float) -> float:
"""tau_m=20 ms, tau_s=10 ms, theta=1; ascending crossing."""
if not math.isfinite(w) or w <= 4.0:
raise ValueError("需要 w > 4,才能定义横截穿越的首次事件")
y = (1.0 + math.sqrt(1.0 - 4.0 / w)) / 2.0
return -20.0 * math.log(y)
def event_gradient(w: float, target: float = 8.0) -> float:
if not math.isfinite(target):
raise ValueError("目标时刻必须为有限数值")
t = first_spike_time(w)
k = math.exp(-t / 20.0) - math.exp(-t / 10.0)
dk = -math.exp(-t / 20.0) / 20.0 + math.exp(-t / 10.0) / 10.0
return -(t - target) * k / (w * dk)
w, target, h = 5.0, 8.0, 1e-5
loss = lambda q: 0.5 * (first_spike_time(q) - target) ** 2
finite_difference = (loss(w + h) - loss(w - h)) / (2.0 * h)
print(event_gradient(w, target), finite_difference)
# 两者均约为 3.78202;不是完整 EventProp 网络实现。The gradient applies to the specified hybrid system while event structure is locally unchanged and the threshold crossing is transversal. Event appearance or disappearance, changes of event order, and tangencies can be nondifferentiable; simultaneous events need separate analysis. Numerical implementations still incur event-location and integration error.[5]这里指对指定混合系统,在事件结构局部不变、阈值被横截穿越时成立的梯度。脉冲出现或消失、事件次序变化、切触阈值等临界点可能不可微;同时事件需额外分析。数值实现仍存在事件定位和积分误差。[5]
Set w = 4: the peak just touches threshold, the crossing velocity vanishes, and the derivative’s denominator disappears. For w < 4 there is no event, hence no first-spike time for this loss to differentiate. An event-time gradient cannot be assigned to a spike that does not exist.把实验权重调到 w = 4:电压峰值刚好触及阈值,但穿越速度为零,公式分母消失。w < 4 时没有该事件,也就没有可供这个损失求导的首次放电时刻。不能给“尚不存在的脉冲”硬套上事件时间梯度。
For memory usage, event-based recording is possible under the original paper’s assumptions, such as losses depending only on spike times. Continuous voltage losses require additional trajectory storage or reconstruction. Memory requirements therefore cannot universally be described as depending only on the number of spikes.[5]内存方面,原文在损失只依赖脉冲时刻等条件下可按事件记录;含连续电压损失时,还要存储或重建额外轨迹信息。因此不能把所有实现的内存需求一概说成只与脉冲数有关。[5]
Learning spikes: different interventions, different assumptions.同样是学习脉冲,
改变的“位置”却不一样。
Separate the forward model, backward differentiation, and local plasticity, and many apparent contradictions disappear. This is a comparison of mathematical roles and conditions, not a performance ranking.把前向模型、反向求导和局部可塑性分开,很多表面矛盾就消失了。下面比较的是数学角色与适用条件,不是性能排名。
| 概念 | 它规定什么 | 关键结构 | 应保留的限定 |
|---|---|---|---|
| LIF | 神经元的前向动力学 | 线性 ODE + 阈值 + 复位 | 本身不规定怎么训练。[1] |
| UltraLIF | 平滑的前向模型 | LSE + sigmoid + 连续复位 | 有限温度是软输出;硬极限为 max-plus 递推。[2]不能无条件等同标准加法 LIF。 |
| BPTT | 时间展开图上的求导 | 链式法则 + Jacobian 连乘 | SG-BPTT 使用代理局部导数;BPTT 本身不要求代理。[3] |
| STDP | 局部突触权重更新 | 前后时序 + 痕迹变量 | 通常不等于全局任务损失的精确梯度。[4] |
| EventProp | 连续硬事件系统的求导 | 事件时间隐式导数 + 伴随跳跃 | 非临界事件结构下精确,仍受数值求解误差影响。[5] |
SG-BPTT: change the backward derivativeSG-BPTT:改反向导数
Keep hard spikes in the forward pass and supply a useful surrogate signal for the nondifferentiable threshold in the backward pass.前向依旧是硬脉冲,反向为不可微阈值提供一个可用的代理信号。
UltraLIF + BPTT: change the forward modelUltraLIF + BPTT:改前向模型
Smooth the dynamics, then use the actual derivatives of that smooth model.把动力学平滑化,再使用该平滑模型实际具有的导数。
EventProp: differentiate event timesEventProp:对事件时间求导
Keep hard events while tracking when spikes occur and how sensitivities jump across reset.保留硬事件,同时追踪脉冲何时发生,以及复位前后的敏感度跳跃。
STDP: define local plasticitySTDP:定义局部可塑性
Specify updates directly from relative spike timing, rather than assuming derivation from a global loss.根据脉冲的相对时序直接指定更新,而非默认从一个全局损失推导。
连续的状态,离散的事件,
还有连接它们的导数。
Understanding SNNs means more than memorizing update equations: identify the dynamical system, whose gradient is being computed, and why the weights should change.理解 SNN,不只是记住几条更新公式,更是确认:你描述的是哪个动力系统,你计算的是谁的梯度,你希望权重为什么而改变。
Return to the primary definitions.回到原始定义。
Sources checked on September 22, 2026. The note re-derives equations in consistent notation; its interactive plots are educational calculations, not reproductions of paper benchmarks. UltraLIF qualifications and counterexamples are explicitly identified as algebraic checks rather than unconditional claims about the preprint.来源核对日期:2026 年 9 月 22 日。正文用统一符号重新推导;交互图表为按文中方程计算的教学示例,不是论文基准实验的复现。UltraLIF 的限定和反例单独标为代数核对,避免将预印本主张直接当作不加条件的结论。
Computation, offline reading, and reproducibility本页的计算、离线阅读与复现说明 ABOUT THIS PAGE
LIF: the continuous-time analytic solution for constant input, with explicit threshold-event timing and a 2 ms refractory period before restarting. The event count over the 200 ms window and theoretical steady-state rate are calculated separately.LIF:恒定输入的连续时间解析解;显式定位到阈值的事件,再按 2 ms 不应期重启。图示 200 ms 的有限窗口事件数与理论稳态频率分别计算。
UltraLIF: numerically stable log-sum-exp, with views for soft spikes, LSE, and actual local derivatives. Temperature stays positive; a finite-temperature curve is not presented as the hard limit.UltraLIF:稳定的 log-sum-exp 实现;可切换软脉冲、LSE 和真实局部导数。图中温度始终为正,不把有限温度画成硬极限。
BPTT: a constant scalar Jacobian product on a logarithmic vertical axis; no network training, dataset, or performance measurement.BPTT:恒定标量 Jacobian 的乘积示例,采用对数纵轴;无真实网络训练、数据集或性能测量。
STDP: a single spike pair, an exponential window, and no update at zero delay. The plot shows only Δw/η, without weight clipping, network feedback, or steady-state training.STDP:单次脉冲配对,指数窗口,零延迟不更新。图中只展示 Δw/η,不包含权重裁剪、神经元网络反馈或稳态训练。
EventProp: a fixed single-input first-crossing problem checked using both a closed form and central finite differences. No event, threshold tangency, and valid transversal crossings are distinguished explicitly.EventProp:固定的单输入首次穿越问题,以闭式解与中心差分交叉核验。明确区分未放电、切触临界点和有效横截事件。
Offline and privacy: the article HTML contains its equation vectors and experiment code; the published site also loads shared styles, scripts, and formula fonts from this site. Save the page together with its resources for offline reading. There is no tracking. Clicking Run & verify sends the displayed Python example to Godbolt; reference links lead to external sites.离线与隐私:文章 HTML 包含公式矢量图与实验代码;发布后的页面还会从本站加载共享样式、脚本和公式字体。离线阅读时需要连同页面资源一起保存。没有追踪。自动语言选择可能请求 Country 查询 IP 所在地区;本站不保存 IP。点击“运行验证”会把所示 Python 示例发送给 Godbolt;参考文献链接会访问外部网站。
Printing: printing preserves the current expansion state. Open the derivations you want to include, then use Print / Save PDF or the browser’s print command.打印:打印会保留当前展开状态。先展开需要包含的推导,再使用“打印/保存 PDF”或浏览器的打印功能。