HomeArticlesNeuroscience

Spiking Neural Networks: Neurons That Talk in Timed Pulses, Not Numbers

How leaky integrate-and-fire neurons, excitatory-inhibitory balance and spike-timing-dependent plasticity build a network that learns from timing alone.

mysimulator teamUpdated June 2026≈ 8 min read▶ Open the simulation

A neuron that spikes, not a number that squashes

Standard artificial neural networks pass continuous numbers through smooth activation functions. A spiking neural network (SNN) instead models neurons much closer to biology: each unit accumulates input as a continuously evolving membrane voltage and only communicates by firing discrete, all-or-nothing spikes when that voltage crosses a threshold — information is carried in when spikes happen, not in a continuous activation level.

The standard workhorse model for the individual neuron is the leaky integrate-and-fire (LIF) neuron — a deliberately simplified model that captures the essential dynamics (integration, leak, threshold, reset) without the biophysical detail of, say, the Hodgkin-Huxley ion-channel equations:

τ dV/dt = −(V − V_rest) + R·I(t)

when V ≥ V_threshold:  neuron fires a spike, then V → V_reset (hard reset)

τ      = membrane time constant (leak rate)
V_rest  = resting potential the voltage decays back toward with no input
R·I(t)  = driving current from incoming synaptic spikes
live demo · a network of LIF neurons spiking and connecting● LIVE

Excitatory and inhibitory balance

Real cortical circuits, and this simulation's 40-excitatory/10-inhibitory split, are built from two functionally different populations. Excitatory neurons (releasing neurotransmitters like glutamate) push a postsynaptic neuron's voltage up toward threshold; inhibitory neurons (releasing GABA) push it down, away from threshold. A network with too much unchecked excitation runs away into synchronized, seizure-like firing; one with too little cannot sustain any activity at all. The roughly 80:20 excitatory-to-inhibitory ratio seen in real cortex, and mirrored here, sits in a regime where inhibition actively restrains and shapes excitation rather than simply damping it — producing the kind of irregular, sparse, information-rich firing patterns seen in real cortical recordings rather than either silence or synchronized bursts.

STDP: synapses that learn from timing, not from being told the answer

Spike-timing-dependent plasticity (STDP) is the leading biological model for how synapses strengthen or weaken based purely on the relative timing of pre- and postsynaptic spikes, discovered experimentally in the 1990s and directly inspired by Hebb's older, looser postulate that cells which fire together wire together.

if pre-synaptic spike arrives shortly BEFORE post-synaptic spike (Δt > 0):
    synapse strengthens (long-term potentiation, LTP)
    "this input looks like it helped cause the output — reward it"

if pre-synaptic spike arrives shortly AFTER post-synaptic spike (Δt < 0):
    synapse weakens (long-term depression, LTD)
    "this input arrived too late to have caused the output — penalize it"

Δw ~ A⁺·exp(−Δt/τ⁺)  if Δt > 0,   A⁻·exp(Δt/τ⁻)  if Δt < 0

This turns causal timing into a learning signal without ever needing an external error label or teacher: a synapse that reliably fires just before its target neuron does gets rewarded, one that fires just after gets punished, and over many spikes the network's connectivity self-organises around whichever inputs are actually predictive of downstream firing.

Reading a raster plot

The standard way to visualise spiking activity across many neurons at once is a raster plot: one row per neuron, one tick mark per spike, time running along the horizontal axis. Instead of a single continuous trace it exposes population-level structure directly — a synchronized vertical band means many neurons fired together, a diagonal streak means activity is propagating like a wave through the population, and quiet, evenly-scattered dots mean the network is in an irregular, asynchronous firing regime.

Why spikes instead of continuous activations at all

Spiking is not merely a more biologically faithful detail bolted onto an otherwise ordinary network — it changes what the network can compute and how cheaply. Because a neuron only communicates when it crosses threshold, most units in a large, sparsely-active SNN are silent at any given instant, which is the whole appeal of neuromorphic hardware (like Intel's Loihi or IBM's TrueNorth): computation and communication happen only when a spike actually occurs, so power consumption scales with activity rather than network size — a very different trade-off from a conventional neural network, which does dense matrix multiplication on every unit at every step whether or not that unit's output ends up mattering.

Frequently asked questions

What is the key difference between a spiking neuron and a normal artificial neuron?

A standard artificial neuron outputs a continuous number every time step, via a smooth activation function. A spiking neuron instead integrates input into a membrane voltage over time and only communicates a discrete, all-or-nothing spike when that voltage crosses a threshold — information is encoded in spike timing, not a continuous value.

How does STDP let a network learn without labelled training data?

STDP strengthens a synapse when the presynaptic neuron fires just before the postsynaptic one (suggesting it may have helped cause that spike) and weakens it when the timing is reversed. This purely local, timing-based rule requires no external error signal or teacher, which is why it is considered a biologically plausible alternative to backpropagation.

Why does the network need both excitatory and inhibitory neurons?

Excitatory neurons push other neurons toward firing threshold, while inhibitory neurons push them away from it. Without inhibition to balance excitation, activity in a recurrently connected network tends to run away into synchronized, seizure-like bursts rather than the sparse, irregular firing patterns characteristic of healthy cortical activity.

Try it live

Everything above runs in your browser — open Spiking Neural Network and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open Spiking Neural Network simulation

What did you find?

Add reproduction steps (optional)