Neural coding: how cells turn the world into spikes
A simplified summary of Wikipedia's Neural coding article, cross-referenced with the same three library items. It is a companion to the Bursting post.
The short version
Neural coding is the "language" question. How does a pattern of spikes stand for a sight, a taste, a movement or a memory?
Spikes (action potentials) are near-identical, all-or-nothing events about 1 ms long. The message can't be in the size of a spike, so it has to be in how many spikes there are, when they come, and which cells fire them.
The problem runs in two directions:
- Encoding goes from stimulus to spikes. The aim is to predict how cells will respond.
- Decoding goes from spikes back to stimulus. The aim is to read back what the cells were "seeing". Researchers now decode hippocampal activity in real time while memories are being formed and recalled.
Not every neuron spikes. Some retinal cells use graded potentials, where the output rises and falls smoothly with the input. These carry more information per second, but they fade quickly. That means they only work over short distances in tightly packed tissue.
The three main theories
| Code |
Where the message lives |
Strength |
Weakness |
| Rate |
How many spikes per unit of time |
Robust to jitter in timing |
Slow, and throws away timing detail |
| Temporal |
Exactly when the spikes fall |
Fast and rich |
Sensitive to noise inside the cell |
| Population |
The pattern across many cells |
Cancels noise, fast, can carry several features at once |
Needs many cells |
Whether the brain uses rate codes or temporal codes is still argued over. Wikipedia notes that neither term even has a clear definition. The brain most likely uses both.
Rate coding: count the spikes
- The founding experiment. Adrian & Zotterman (1926) hung weights from a muscle. Heavier weights produced more spikes in the sensory nerve. They concluded that every spike is the same size and that the frequency of spikes carries the signal.
- Counting window. Researchers typically count spikes over 100 or 500 ms. That works for steady stimuli but is too slow for real life, where the eyes jump to a new position (a saccade) every few hundred milliseconds.
- The lab shortcut. Researchers repeat the same stimulus many times and average the responses. The result is a peri-stimulus time histogram (PSTH), a chart of spikes counted in 1-to-few-ms time slots after each repeat. The brain can't replay the same moment, so it presumably averages across many neurons receiving the same input instead.
Temporal coding: the timing is the message
Spike timing can be precise to the millisecond.
- Same count, different message. The patterns
000111000111 and 001100110011 each contain six spikes but are arranged differently.
- First spike. The retina may encode visual information in how soon the first spike arrives. In monkey primary visual cortex (V1), first-spike timing carried more information than the gaps between spikes. The drawback is that it is vulnerable to the cell's own internal noise.
- Smell. In the mouse olfactory bulb (the mitral and tufted cells), the timing of the first spike relative to each sniff carries much of the odour information.
- Taste. The firing rate signals the taste category (for example, bitter). The timing pattern tells you which bitter, such as quinine versus denatonium.
- Silence. Purkinje cells may encode information in the timing of their pauses (see the Bursting post).
- Phase of firing. Each spike is labelled by where it falls within an ongoing brain rhythm. At low frequencies, about four phase positions may be enough. The idea grew out of hippocampal place cells: as an animal crosses a place cell's patch, the cell fires at earlier and earlier points in each theta cycle (phase precession). In visual cortex, fast gamma cycles carry firing sequences lasting up to about 15 ms.
- The speed argument. Locating a sound and telling two images apart can both happen within milliseconds. That is too fast for a code based on counting spikes.
- Learning. A temporal code can be learned by adjusting delays according to activity. This is a special case of spike-timing-dependent plasticity (STDP), where the order and gap between two cells' spikes decides whether their connection strengthens or weakens.
- A caveat. A fast-changing stimulus produces precisely timed spikes anyway. Precise timing on its own doesn't prove the brain is using a timing code.
Population coding: read the whole choir
- Direction of motion. In area MT, a motion-sensing region of the visual cortex, each neuron prefers one direction. Add up each cell's preferred direction, weighted by how hard it is firing, and the total (the population vector) points the way the object is actually moving.
- Precision grows with numbers. For cells with a single preferred value, precision grows in step with the number of cells. For cells with many peaks, such as grid cells, it can grow exponentially.
- Hidden shapes. Plotted together, population activity falls onto simple geometric shapes. Head-direction cells trace a ring and grid cells trace a doughnut (a torus). These shapes shift with the brain's state, for example when the eyes close or with breathing.
- Firing together as a signal. When cells fire together can add information. In marmoset auditory cortex, a pure tone increased synchronised spikes without changing the average rate. The synchrony itself was the message.
Sparse coding: few cells, clear signal
- Each item switches on a small, distinct set of neurons. That saves energy and reduces overlap between items, so more memories can be stored.
- Built with spares. Human V1 is estimated to have about 500 times more neurons than strictly needed. A 14×14-pixel patch (196 values) may be coded by roughly 100,000 neurons. The spare capacity makes the code smooth and resistant to noise.
- Applying sparse coding to natural images produces edge-detecting filters very like the receptive fields of V1's "simple cells".
- Fruit fly. In the fly's odour-processing centre (the mushroom body), the odour code in Kenyon cells stays sparse thanks to GABA feedback from the APL neuron (anterior paired lateral, a single large inhibitory cell in each brain hemisphere). If that feedback loop is broken, odour codes overlap and the fly confuses similar smells.
- Locust. Combining sparse coding with temporal coding increases how much the code can hold.
Testing it: optogenetics
Channelrhodopsin is a light-sensitive channel that, when added to a cell, makes it fire when hit with blue light. That lets researchers fire cells at exactly chosen times. They can hold the firing rate constant while changing only the timing, which tests whether timing matters. Wikipedia lists depression, schizophrenia and Parkinson's disease as possible treatment targets, describing the approach as more precise than drugs given through the bloodstream.
Where bursting fits
The neural coding article barely mentions bursting. It lists "precisely timed groups of spikes" among the candidate timing codes, and that is effectively what a burst is. Read alongside the Bursting article:
- A burst and a single spike are two different "letters" in a cell's alphabet.
- A burst's shape is steadier than single-spike timing, which makes it a sturdier code.
- The silence between bursts may carry information too, as with the Purkinje cell pauses above.
Connections to the library files
1. Are neurons the only cells that "fire"? (Part 2): Google AI Mode chat, 23/11/2026
Rate codes outside the brain.
- The heart's pacemaker (the sinoatrial node) fires on its own. The autonomic nerves don't trigger each beat; they only speed it up or slow it down, which is a pure rate signal.
- Skeletal-muscle force depends on how many motor units are called up. That is a population and rate code, and it is the reason you can lift a heavy weight or gently pick up an egg.
- Adrian & Zotterman's weights-on-a-muscle experiment measured the sensory side of exactly this system.
A slower code. Hormone-releasing cells signal over minutes to hours, compared with milliseconds for neurons.
Sleep as a giant phase code. The chat describes three rhythms nested inside each other:
- A slow-wave Up state in the cortex triggers
- a sleep spindle from the thalamus, and
- inside the spindle, a hippocampal sharp-wave ripple replays a compressed snapshot of the day's experience.
That is phase-of-firing coding on a grand scale: a timed sequence delivered at a precise point in a rhythm. The place cells behind Wikipedia's phase-precession example are the same cells whose firing sequences get replayed during sleep ripples.
Caveat: this file is an AI-generated answer, not a reviewed source. Check specific claims before relying on them.
2. Brain Cells Chat, Even Without a Synapse: Science news, 29 Oct 2009
- Neurogliaform cells spray GABA (the brain's main calming transmitter) into the space between cells. Only 11 of the 50 release sites examined were actual synapses. One stimulated cell can quieten neighbours it isn't wired to.
- In coding terms, this is a broadcast rather than an addressed message. It can't deliver precise timing to any one partner, but it can turn down a whole neighbourhood at once. (My inference.)
- Parallel with the fruit fly (my inference). In the fly, one APL neuron's blanket of GABA keeps the odour code sparse. A neurogliaform cell's GABA cloud is a plausible mammal-brain version of the same one-cell-quietens-many design.
- The receptors that pick up this low-level GABA are also sensitive to neurosteroids (brain-made molecules linked to stress, anxiety, the menstrual cycle and pregnancy). So the body's chemical state could shift how many cells join a code. (My inference from the article's point about neurosteroid sensitivity.)
3. Oligodendroglia are emerging players in several forms of learning and memory: Munyeshyaka & Fields, Communications Biology, 2022
This paper has its own section titled "Spike rate and temporal coding". Its argument is that both kinds of code are limited by four things: the firing threshold, the firing rate, the refractory period (the cell's recovery time after a spike) and conduction speed. Oligodendroglia influence all four.
- Myelin as an adjustable delay line.
- Wikipedia says temporal codes can be learned by changing delays according to activity, and that is the paper's central argument.
- Myelin sets how long a spike takes to arrive. Changing the myelin can move an input into the roughly 20 ms window where connections strengthen, or out of it.
- Keeping phase codes readable.
- On the theta rhythm, a shift of about 75 ms flips a connection from strengthening to weakening.
- At gamma frequencies (30–90 Hz) the margin is much tighter. That matches Wikipedia's 15 ms gamma firing sequences.
- Without well-tuned myelin, a phase code sent from a distant region would arrive at the wrong point in the cycle.
- Synchrony. Mice with thinner myelin showed less synchronised firing during motor learning. If synchrony is itself a message, as in the marmoset tone result, then glia help write it.
- Rate codes are adjustable too. The axon initial segment (AIS), the first stretch of axon just past the hillock, sets the firing threshold and firing frequency. It reshapes itself with activity.
- Bandwidth. In humans, an MRI measure that partly reflects myelin (fractional anisotropy) increased in step with hours of working-memory training. The authors suggest such white-matter changes could raise processing speed, firing frequency and bandwidth, which is coding capacity in plain terms.
Where coding sits on the neuron diagram
| Diagram label |
Coding connection |
| Dendrites |
Collect thousands of incoming codes. Decoding starts here |
| Axon hillock |
Where the outgoing code is written. The firing threshold and firing frequency (the rate code) are set here |
| Myelin sheath / Node of Ranvier |
Controls delivery time, which timing and phase codes depend on. In the brain the myelin comes from oligodendrocytes, not Schwann cells |
| Synapse |
Where codes are read and learned: spike-timing-dependent plasticity works here |
Retinal cells that use graded potentials instead of spikes aren't shown on the diagram. They are the exception to "the spike is the unit".
Bottom line
Every spike looks the same, so the meaning must be in the count, the timing and which cells take part. The brain probably uses all three. Coding isn't only the neuron's job either. Glia set the delivery times that timing codes depend on, and inhibitory cells that broadcast GABA help decide how many cells join in.
Sources