01 / 03 The neuron that forgot time
  1. ← Spiking neural networks
  2. 00 Foreword
  3. 01 The neuron that forgot time
  4. 02 The membrane potential
Spiking neural networks · 01 / 03

The neuron that forgot time

Why the foundations neuron cannot hear time, and how an internal state gives it that ear back.

A barn owl hunts in complete darkness. It does not see the mouse darting through the leaves: it hears it. The sound reaches its nearer ear a few millionths of a second before the other, and that tiny gap is enough for it to strike precisely. Somewhere in its brain, neurons are measuring a time difference on the order of a microsecond.

Now take the neuron from the foundations course, the one that computes y=f(wx+b)y = f(\mathbf{w} \cdot \mathbf{x} + b). Could it do what the owl does? The answer is no, and the reason is precise. This chapter starts from that impossibility to rebuild a neuron that can, in fact, hear time.

The foundations neuron lives in an eternal present

Go back to the central formula of the foundations course. For an input x\mathbf{x}, the neuron produces

y=f(wx+b).y = f(\mathbf{w} \cdot \mathbf{x} + b).

Look carefully at what is in this equation, and above all at what is not. There are the inputs, the weights, the bias, the activation. There is no trace of the moment when the input arrives. You can present x\mathbf{x} today or tomorrow, the result yy is the same. The neuron has no clock, no memory of what happened just before. We say it is stateless: its output depends only on the present input.

Suppose we feed it a sequence of inputs, one per time step: x0,x1,x2,\mathbf{x}_0, \mathbf{x}_1, \mathbf{x}_2, \dots The stateless neuron processes them one by one, independently:

yt=f(wxt+b).y_t = f(\mathbf{w} \cdot \mathbf{x}_t + b).

Each output yty_t only looks at its input xt\mathbf{x}_t. The past never enters the computation. An eternal present, with no before and no after.

The owl’s problem: hearing a time gap

Let us formalize the owl’s challenge. Two signals arrive, one per ear. Call them the left input and the right input. What carries the information is neither the intensity of the left sound nor of the right one taken alone: it is the time gap between the two. The brain must fire strongly when the two signals arrive almost together, and stay silent when they are too far apart.

This ability has a name: coincidence detection Coincidence detection The ability of a stateful neuron to fire only when two inputs arrive within a short interval of each other. Its internal integration window makes this computation possible, where a memoryless neuron cannot. Illustrated by the Jeffress model (1948) for sound localization. Source: Jeffress (1948) . It was proposed as early as 1948 by Lloyd Jeffress as a model of sound localization (Jeffress, 1948), and it has since been observed in the brainstem of birds and mammals.

Here is why the stateless neuron fails. Suppose the two inputs never land on exactly the same time step (there is almost always a small gap). Then, at each step, the neuron sees only one active input. Since its output depends only on the present instant, it reacts the same whether the gap is tiny or huge. It cannot measure a distance between two events it never sees together. It is missing a place to hold the trace of the first input while waiting for the second.

Giving the neuron a state

The idea that unlocks everything: add to the neuron an internal variable that remembers, for a brief moment, what just arrived. We call it the membrane potential Membrane potential The internal variable of a stateful neuron measuring its accumulated electric charge. It rises when inputs arrive, slowly leaks back toward rest when no input comes, and triggers a spike once it reaches a threshold, after which it resets. , by analogy with the electric charge that builds up on the membrane of a real neuron. Let us write it vv.

This variable obeys three simple rules, at each time step:

  1. It leaks. With no input, vv slowly falls back toward zero. It keeps only a fraction λ\lambda of its value from one step to the next, with 0λ<10 \le \lambda < 1.
  2. It integrates. When an input of charge ItI_t arrives at step tt, it adds to vv.
  3. It fires. If vv reaches a threshold θ\theta, the neuron emits a spike and vv resets to zero.

The first two rules fit in a single recurrence:

v(t+1) = λ · v(t) + I(t)
Potential update, one time step

In compact notation:

vt+1=λvt+It.v_{t+1} = \lambda\, v_t + I_t.

This equation reads: the new value of the potential equals the old one times the retention λ\lambda, plus the input received at this step. The factor λ\lambda is the neuron’s memory. At λ=0\lambda = 0, it forgets everything instantly and becomes stateless again. The closer λ\lambda gets to 11, the longer it holds the trace of the past.

This three-rule neuron is the simplest spiking neuron. It is called the integrate-and-fire Integrate-and-fire A neuron model that accumulates input current in a membrane potential with a leak (time constant tau) and emits a spike when a threshold is crossed. The first internal state variable of a neuron, introduced by Lapicque in 1907. Source: Lapicque (1907) model, introduced by Louis Lapicque as early as 1907 (Lapicque, 1907). A neuron whose output depends on an internal variable evolving over time is a stateful neuron Stateful neuron A neuron whose output depends on an internal variable that evolves over time (membrane potential, adaptive threshold), and thus on its recent history. As opposed to a stateless neuron, whose output depends only on the instantaneous input. : unlike the stateless neuron of the foundations, its response depends on its recent history.

Play with coincidence detection

A glance at the theory does not replace your hand on the sliders. In the component below, two inputs of fixed charge arrive: the first early, the second shifted by the delay Δ you set. You watch the potential rise at the first, leak, then rise again at the second. If it crosses the threshold, the neuron fires.

Your mission: start from zero delay (both inputs together), watch it fire, then raise Δ step by step until the neuron falls silent. You have just measured its coincidence window. Then play with the retention: a membrane that holds its charge better forgives larger delays.

threshold = 0.90spikepotentialtime (steps)

A neuron that hears time

Peak potential reached : 1.20
The neuron fires
Fires as long as Δ does not exceed 1

Three things to observe while playing:

  • At zero delay, both charges land on the same step and add up: the potential makes a single jump to 2c2c. That is the easiest case to fire.
  • Raising the retention softens the leak slope and widens the coincidence window. The membrane’s memory sets the neuron’s temporal tolerance.
  • Raising the threshold demands a tighter coincidence. Threshold and retention are two independent ways of tuning the same thing: how close the two inputs must be.

The spike, a language in time

The stateful neuron no longer returns a continuous number like the sigmoid of the foundations. It returns a spike, a brief all-or-nothing event: it fires, or it does not. This spike is what a spiking network manipulates: everything is made of spikes spread out in time.

Hence a new question, one that made no sense for the stateless neuron: where does the information hide in a train of spikes? Two answers coexist. In rate coding, what matters is the number of spikes per second, their rate. In temporal coding Temporal coding A way of representing information in the precise instant when a spike is emitted, rather than in the number of spikes per second. The firing time then carries the message, letting a spiking network compute with very few spikes. Contrasts with rate coding. , what matters is the precise instant of each spike. The owl uses the second route: it is the arrival time, not the rate, that carries the position of the prey. Temporal coding lets you compute with very few spikes, hence very little energy. We will come back to it in detail in a dedicated chapter.

Stateless versus stateful: what each one sees

In one sentence

The foundations neuron is memoryless and therefore blind to time; giving it a membrane potential that integrates, leaks and fires turns it into a stateful neuron able to detect the coincidence of two signals, and thus to hear time.

On to chapter 2

We spoke of the membrane potential as a variable that rises and leaks, settling for a retention factor λ\lambda set by hand. A convenient caricature, but where does that leak actually come from? In a real neuron it has a physical cause: the cell membrane behaves like a small capacitor discharging through a resistor. Chapter 2 opens the cell to find the concrete origin of λ\lambda, before chapter 3 turns our recurrence into the differential equation of the full integrate-and-fire model.

Exercises

Take a sheet of paper and a pencil. The solutions are right below, to look at only after you have tried.

Exercise 1: integrate by hand

A stateful neuron has retention λ=0.5\lambda = 0.5 and threshold θ=0.9\theta = 0.9. Its potential starts at v=0v = 0. Two inputs of charge c=0.6c = 0.6 arrive. For each of the delays Δ=0\Delta = 0, Δ=1\Delta = 1 and Δ=2\Delta = 2 steps, compute the potential at the moment of the second input and say whether the neuron fires.

Exercise 2: a stateless neuron is blind to shift

Show that the stateless neuron yt=f(wxt+b)y_t = f(\mathbf{w} \cdot \mathbf{x}_t + b) cannot tell two inputs close in time apart from two inputs far apart, as long as the two inputs never land on the same step.

Exercise 3: the coincidence window

From the firing condition c(1+λΔ)θc\,(1 + \lambda^{\Delta}) \ge \theta, express the largest integer delay Δmax\Delta_{\max} that still triggers a spike, then compute it for λ=0.7\lambda = 0.7, c=0.6c = 0.6 and θ=0.9\theta = 0.9.

Sources

To go further

  • Gerstner, W., Kistler, W. M., Naud, R. & Paninski, L. (2014). Neuronal Dynamics. Cambridge University Press. Chapter 1 on the integrate-and-fire model. neuronaldynamics.epfl.ch
  • Carr, C. E. & Konishi, M. (1990). “A circuit for detection of interaural time differences in the brain stem of the barn owl.” Journal of Neuroscience 10(10), 3227-3246. DOI 10.1523/JNEUROSCI.10-10-03227.1990
Quiz
  1. 1. Why can the foundations neuron not measure a time gap between two inputs?

  2. 2. What is the membrane potential of a stateful neuron for?

  3. 3. In the recurrence v(t+1) = λ·v(t) + I(t), what happens if λ = 0?

  4. 4. What is coincidence detection?

  5. 5. What is the output of a spiking neuron?