AnyLearn
All lessons
Scienceintermediate

Circuits and Codes: How Populations of Neurons Represent the World

How wiring motifs like lateral inhibition and recurrence turn single neurons into computing circuits, and how those circuits encode the world. Covers receptive fields and the visual hierarchy, rate, timing and population codes, place and grid cells, attractor networks, and what connectomes can and cannot tell us.

Updated · AI-authored, review-gated · how lessons are made

Progress1 / 10

From cells to circuits

The earlier lessons in this path covered the single neuron: spikes, synapses, and plasticity. Computation in the brain, though, is done by circuits, and a small set of wiring patterns, or motifs, recurs across species and brain regions.

MotifWiringWhat it computes
Feedforward excitationA excites B excites CRelaying and transforming signals in sequence
Feedforward inhibitionInput excites a target and an interneuron that then inhibits the targetA narrow time window: only the earliest input counts
Feedback inhibitionA target excites an interneuron that inhibits it backGain control, keeping activity in range
Lateral inhibitionNeighbours inhibit each otherContrast enhancement, winner-take-all choice
Recurrent excitationCells excite each other in loopsSustained activity, memory, pattern completion
DisinhibitionAn inhibitory cell inhibits another inhibitory cellGating: opening a pathway on demand

Most real circuits combine several. Reading a circuit diagram is largely a matter of spotting which motifs are present and asking what each contributes.

Sign in free to save your progress and earn certificates.

Full lesson text

All 10 steps on one page, for reading, reference, and search.

Show

1. From cells to circuits

The earlier lessons in this path covered the single neuron: spikes, synapses, and plasticity. Computation in the brain, though, is done by circuits, and a small set of wiring patterns, or motifs, recurs across species and brain regions.

MotifWiringWhat it computes
Feedforward excitationA excites B excites CRelaying and transforming signals in sequence
Feedforward inhibitionInput excites a target and an interneuron that then inhibits the targetA narrow time window: only the earliest input counts
Feedback inhibitionA target excites an interneuron that inhibits it backGain control, keeping activity in range
Lateral inhibitionNeighbours inhibit each otherContrast enhancement, winner-take-all choice
Recurrent excitationCells excite each other in loopsSustained activity, memory, pattern completion
DisinhibitionAn inhibitory cell inhibits another inhibitory cellGating: opening a pathway on demand

Most real circuits combine several. Reading a circuit diagram is largely a matter of spotting which motifs are present and asking what each contributes.

2. Inhibition: a minority that runs the show

In the neocortex, inhibitory interneurons are a minority: reviews such as Markram and colleagues (2004, Nature Reviews Neuroscience) place GABA-releasing interneurons at roughly 10 to 20 percent of cortical neurons. Yet they shape almost everything the excitatory majority does.

They are also diverse. Three broad classes, distinguished by molecular markers, do different jobs:

  • Parvalbumin (PV) cells fire fast and target the cell body and axon start of excitatory neurons, controlling whether and when they fire.
  • Somatostatin (SST) cells target dendrites, controlling which inputs get integrated.
  • VIP cells mostly inhibit other interneurons, especially SST cells, producing disinhibition.

In an active cortex, excitation and inhibition tend to rise and fall together, a state called E/I balance. Balance keeps neurons near threshold, so they respond quickly to small changes in input rather than saturating.

Gotcha: "Inhibitory" does not mean "suppresses behaviour". Inhibiting an inhibitory neuron is excitation by another route, and much of cortical gating is exactly that.

3. Lateral inhibition sharpens edges

Haldan Keffer Hartline's recordings from the eye of the horseshoe crab Limulus showed that each photoreceptor unit is inhibited by its neighbours, part of the work behind his share of the 1967 Nobel Prize in Physiology or Medicine. The consequence is that uniform regions are damped and edges are exaggerated.

A toy one-dimensional version, a dim region next to a bright one, with each cell subtracting a fraction of its two neighbours' input:

import numpy as np

stimulus = np.array([1, 1, 1, 1, 1, 5, 5, 5, 5, 5], dtype=float)
k = 0.2   # inhibition received from each neighbour

# interior cells: own input minus k times each neighbour; rates cannot go negative
response = np.maximum(stimulus[1:-1] - k * (stimulus[:-2] + stimulus[2:]), 0)
print(response)
# [0.6 0.6 0.6 0.  3.8 3.  3.  3. ]

The cell just on the dark side of the edge drops to 0, below its dim neighbours, and the cell just on the bright side jumps to 3.8, above its bright neighbours. The flat regions differ by a factor of 5 in the stimulus, yet the circuit's output emphasises the boundary. This is one explanation for Mach bands, the illusory light and dark stripes people see beside a luminance edge.

4. Receptive fields and the visual hierarchy

A neuron's receptive field is the region of sensory space, and the pattern within it, that changes its firing. Stephen Kuffler (1953) found that cat retinal ganglion cells have centre-surround fields: light in the centre excites, light in the ring around it inhibits, which is lateral inhibition built into a cell's input.

David Hubel and Torsten Wiesel, recording in cat primary visual cortex (V1) from the late 1950s, found cells tuned to oriented edges. They described two kinds:

  • Simple cells respond to an edge at a specific orientation and position.
  • Complex cells respond to the same orientation anywhere within a larger region, a first step toward position invariance.

The work earned them a share of the 1981 Nobel Prize in Physiology or Medicine. Further along the ventral visual stream, receptive fields grow larger and preferences more complex, up to neurons in inferotemporal cortex that respond to whole objects and faces.

In practice: This hierarchy inspired Fukushima's neocognitron (1980) and, through it, convolutional neural networks. Yamins and colleagues (2014, PNAS) found that networks trained to recognise objects predicted inferotemporal responses better than earlier models, though such models still differ from the brain in many ways.

5. The primate visual pathway, simplified

Visual information leaves the eye, relays through the thalamus, and splits into two broad cortical streams: a ventral stream for identifying what something is, and a dorsal stream for where it is and how to act on it. Real connectivity includes many feedback and cross-stream connections that this sketch omits.

flowchart LR
  A["Retina: centre-surround cells"] --> B["LGN (thalamus)"]
  B --> C["V1: oriented edges"]
  C --> D["V2: contours, textures"]
  D --> E["V4: shape, colour"]
  E --> F["IT cortex: objects, faces"]
  C --> G["MT: motion"]
  G --> H["Parietal cortex: space, action"]

6. Three ways to encode information in spikes

Given that neurons communicate with spikes, which properties of the spike trains carry information? The answer differs by system, and the main candidates are not mutually exclusive.

CodeInformation lives inClassic evidence
Rate codeSpikes per unit timeEdgar Adrian's 1920s recordings: stronger stimulus, higher firing rate
Temporal codePrecise spike times or orderFirst-spike latency in touch and hearing, phase relative to brain rhythms
Population codeThe joint pattern across many cellsGeorgopoulos and colleagues (1986, Science), motor cortex

Georgopoulos's group found that each motor cortex neuron fires most for one preferred reach direction, but broadly. The arm's direction was predicted well by a population vector, each cell voting for its preferred direction ci\mathbf{c}_i in proportion to its firing rate rir_i:

P=∑iri ci\mathbf{P} = \sum_i r_i \, \mathbf{c}_i

Key idea: Broad tuning is not sloppiness. Many broadly tuned cells together give a precise, noise-tolerant estimate, and losing a few cells degrades the estimate gracefully instead of failing outright.

7. A coordinate system for space

Some of the clearest examples of neural coding are in navigation.

  • Place cells. John O'Keefe and Jonathan Dostrovsky (1971) found hippocampal neurons in rats that fire when the animal is in one particular location, each cell with its own place field.
  • Grid cells. Hafting and colleagues in the lab of May-Britt and Edvard Moser (2005, Nature) found neurons in the neighbouring entorhinal cortex that fire at many locations, arranged as the vertices of a regular triangular lattice tiling the environment.

O'Keefe and the Mosers shared the 2014 Nobel Prize in Physiology or Medicine for these discoveries.

Grid cells are organised into modules with different lattice spacings, growing larger along the length of the entorhinal cortex. Combining a few modules with different spacings can represent a large range of positions uniquely, in the same way that a few digits in different place values represent a large number.

Other cell types complete the kit: head-direction cells act like a compass, border cells fire near walls. Together they form an internal map that keeps working in darkness, updated by self-motion.

8. Recurrent circuits: holding a state

Feedforward circuits transform inputs. Recurrent circuits, where outputs loop back as inputs, can hold a state after the input is gone, which is what memory over seconds requires.

The classic theoretical model is the attractor network. John Hopfield (1982, PNAS) showed that a network of symmetrically connected units with Hebbian weights settles into stored patterns, so a partial cue completes to a whole memory. Each stored pattern is a valley, or attractor, in the network's energy landscape.

The idea has a striking experimental confirmation. Seelig and Jayaraman (2015, Nature) imaged the fruit fly's central complex and found a bump of activity arranged around a ring of neurons that tracks the fly's heading, moving as the fly turns and persisting in darkness, the signature of a ring attractor.

Gotcha: How working memory is held in mammals is debated. Persistent firing of prefrontal neurons during delays, recorded since the 1970s, supports attractor-like accounts. An alternative view argues some memories are held "activity-silently" in short-term synaptic changes, reawakened when needed. Evidence exists for both, possibly in different tasks.

Rhythm-generating spinal circuits are another recurrent family; our path on central pattern generators covers them.

9. Connectomes: the wiring diagram and its limits

A connectome is a complete map of neurons and their synapses. Building one means imaging tissue with electron microscopy and tracing every cell, and it has been done for whole nervous systems of small animals:

OrganismNeurons mappedSource
C. elegans (nematode)302White and colleagues, 1986
Adult fruit fly brainabout 139,000, with about 50 million synapsesDorkenwald and colleagues (FlyWire), 2024, Nature
Human brainabout 86 billion neurons, no complete mapAzevedo and colleagues, 2009 (count only)
Predict first

If you knew every neuron and synapse in a small circuit, could you predict its output?

Connectomes are still transformative: they rule hypotheses out, reveal motifs, and give models a scaffold to be tested against.

10. What is settled and what is debated

Circuit neuroscience combines very solid findings with live controversies, and it helps to keep them apart.

Well established:

  • Receptive fields, orientation tuning in V1, and the broad hierarchy of the ventral visual stream.
  • Place cells, grid cells, and head-direction cells, replicated across many labs and species.
  • Population coding of movement direction in motor cortex, now used in brain-computer interfaces that decode intended movement.
  • The ring attractor for heading in the fly, seen directly in neural activity.

Actively debated:

  • How much information precise spike timing adds beyond rates, which seems to differ by brain region.
  • Whether working memory relies on persistent firing, short-term synaptic traces, or both.
  • How far deep network models of the visual system count as explanations rather than good predictors.
  • How well results from rodents, the most studied mammals, transfer to the much larger primate cortex.

Key idea: The circuit level is where single-cell biophysics becomes computation. The final lesson in this path asks what that computation is for: prediction, reward, and doing it all on a tight energy budget.

Check your understanding

The lesson ends with a 5-question quiz. Take it in the player above to see your score.

  1. In the lateral inhibition example, why does the cell just on the bright side of the edge respond more strongly than cells deeper in the bright region?
    • It receives a larger stimulus than its bright neighbours
    • It has a lower firing threshold than other cells
    • One of its neighbours is dim, so it receives less inhibition
    • It is excited by the dim cells rather than inhibited
  2. What distinguishes a complex cell from a simple cell in primary visual cortex?
    • Complex cells respond to a preferred orientation across a range of positions
    • Complex cells respond only to colour, not orientation
    • Complex cells are inhibitory while simple cells are excitatory
    • Complex cells respond only to moving faces
  3. In a population vector code like the one Georgopoulos and colleagues described, how is reach direction read out?
    • From the single most active neuron only
    • From the total number of spikes regardless of which cells fire
    • From the precise time of the first spike in the population
    • By summing each cell's preferred direction weighted by its firing rate
  4. What did Seelig and Jayaraman observe in the fruit fly that supports the ring attractor idea?
    • Grid-like firing fields across the arena
    • A bump of activity around a ring of neurons that tracks heading and persists in darkness
    • Neurons that fire only when the fly sees a face
    • A complete wiring diagram of the fly brain
  5. What does work on the crab stomatogastric ganglion imply about connectomes?
    • A complete wiring diagram fully determines a circuit's output
    • Small circuits have no consistent wiring between individuals
    • The same wiring can produce different outputs under neuromodulation, so wiring alone is not enough
    • Connectomes are only useful for invertebrates

Related lessons