Eight leaky integrate-and-fire neurons sit in a ring, each connected to its next two neighbours downstream. Every synapse carries a weight that governs how strongly a presynaptic spike pushes the postsynaptic neuron toward its firing threshold. Whenever two connected neurons fire within a short window, the synapse between them updates by spike-timing-dependent plasticity (STDP): if the presynaptic (pre) neuron fired shortly before the postsynaptic (post) neuron, the synapse is potentiated — it played a causal role, so it strengthens. If post fired before pre, the synapse is depressed — its input arrived too late to have caused the output, so it weakens. Both effects decay exponentially with how far apart the spikes were.
Δt = t_post − t_pre
Δw = A₊·exp(−Δt/τ₊) if Δt > 0 (pre before post → potentiate)
Δw = −A₋·exp( Δt/τ₋) if Δt < 0 (post before pre → depress)
- Train forward fires the ring in order A→H, so every forward synapse sees pre-before-post repeatedly and strengthens — a pathway forms.
- Train reverse fires H→A: the same forward synapses now see post-before-pre and weaken.
- Synchronous burst fires everyone near Δt≈0, where the STDP curve is near its crossover — updates are small and noisy.
- Spontaneous activity gives every neuron a small random input current; once a pathway is potentiated, spikes propagate along it more easily than through un-potentiated links — the network starts to "prefer" the trained route.
- Homeostatic decay continuously pulls every weight back toward a baseline, so a pathway that stops being used gradually fades — this is the "weaken otherwise" side of Hebbian learning.
Real-world relevance: this asymmetric potentiation/depression rule is believed to be the cellular basis of long-term potentiation (LTP) and long-term depression (LTD) in the hippocampus and cortex — the leading model for how memories and learned associations are physically encoded as changes in synaptic strength.