Computational Neuroscience · Interactive Article · 2024

The Brain's GPS: How Grid Cells Build a Coordinate System That Gives Rise to Place Cells

An interactive explainer based on Hafting et al., 2005, Solstad et al., 2006 and subsequent literature
Published March 2024 · 6 interactive demonstrations
Abstract

In 1971, John O'Keefe discovered hippocampal neurons that fire only when an animal occupies a specific location — place cells. The mechanism behind these precise maps remained mysterious until 2005, when Edvard and May-Britt Moser found grid cells in the medial entorhinal cortex: neurons whose activity tiles the environment in perfect hexagonal lattices. This article walks through each step of the grid-to-place transformation — spacing, orientation, phase, modules, path integration, and remapping — with live, adjustable simulations at each stage.

Background

A Nobel-winning discovery about space

How does the brain know where you are? This deceptively simple question occupied neuroscientists for decades after O'Keefe and Dostrovsky[1] first recorded hippocampal neurons that fired selectively for location in 1971. The answer arrived in 2005 when Hafting, Fyhn, Molden and the Mosers[2] discovered a strikingly geometric class of neuron upstream, in the medial entorhinal cortex (MEC): the grid cell.

Together, grid cells and place cells form the mammalian brain's navigational system — a biological GPS that works without satellites, using only self-motion signals and sensory landmarks. Both discoverers shared the 2014 Nobel Prize in Physiology or Medicine.

1971
O'Keefe discovers place cells in the hippocampus
2005
Mosers discover grid cells in the entorhinal cortex
2014
Nobel Prize in Physiology or Medicine awarded
~4
Discrete grid modules per hemisphere (rat)

The spatial navigation circuit involves several cooperating cell types:

Grid Cells — MEC Place Cells — Hippocampus Head Direction Cells Border / Boundary Cells

1

Place cells: neurons that encode location

Each CA1 and CA3 hippocampal place cell fires vigorously only when the animal occupies a specific region of the environment called its place field. Outside this region the cell is largely silent. Most place cells have a single place field per environment, with peak firing rates of 20–100 Hz, falling off as a Gaussian function of distance from the field centre.

A key property is remapping: move the animal to an entirely different room and each place cell either falls silent or acquires a completely new, seemingly random field location. Two environments thus receive statistically independent population codes — a mechanism for storing distinct spatial memories.

Figure 1 — Place Cell Firing Field

Move the cursor over the arena to probe the firing rate. Adjust field width and peak rate with the sliders.

Firing rate:
0 Hz
60
80

Figure 1. Schematic of a hippocampal place cell's spatial firing rate (warmer colours = higher rate). The cell fires at a maximum of ~80 Hz at the centre of its place field and is silent elsewhere. Drag the sliders to explore how field width and peak rate vary across the place cell population.

Remapping. When a rat is placed in a new environment, place cells remap: each neuron picks an entirely new field location or goes silent. Grid cells, by contrast, maintain their spatial periodicity — only their phase shifts. This phase shift is the seed of remapping (see Section 6).

2

Grid cells: a hexagonal coordinate system

A grid cell fires at every vertex of a perfect equilateral triangular lattice tiling the environment[2]. The pattern repeats indefinitely — if the environment were large enough, you would see the same array of firing fields extending to the horizon. Three parameters fully specify a grid cell's pattern:

λ — spacing
Distance between adjacent firing-field centres. Ranges from ~25 cm (dorsal MEC) to >1 m (ventral MEC).
θ — orientation
Angle of the lattice axes relative to the environment. Shared among cells of the same module.
φ — phase
2-D spatial offset of the grid origin. Varies continuously across cells within a module.

Mathematically the firing-rate map of a grid cell can be written as a sum of three cosine waves at 60° offsets:

r(x) = cos(k₁·x) + cos(k₂·x) + cos(k₃·x)
where k₁, k₂, k₃ are wave vectors at 0°, 60°, 120° with magnitude 2π/λ

Figure 2 — Grid Cell Rate Map

Adjust spacing, orientation, and phase to see how each parameter deforms the hexagonal lattice.

80
15
0
0

Figure 2. Spatial firing rate map of a single grid cell (brighter = higher firing rate). Blue dots mark the lattice vertices (firing-field centres). Changing spacing stretches or compresses the grid; orientation rotates it; phase translates it without changing its shape.

Crucially, all grid cells in a local cortical column share the same spacing and orientation but have different phases — they tile the same environment with the same lattice, but offset from one another. This is exactly what is needed to encode position: together the active phases specify a unique 2-D location.


3

Grid modules: a nested ruler system

Grid cells are not a monolithic population. Stensola et al. (2012)[4] showed that they cluster into discrete modules along the dorsoventral axis of the MEC. Within a module, all cells share the same spacing and orientation; across modules, both can differ. The spacing ratio between adjacent modules is approximately √2 ≈ 1.42.

This creates a nested hierarchy of rulers, analogous to a Vernier scale. A fine grid provides precision over short distances; coarser grids extend the unambiguous range. When module spacings are co-prime, the population code can uniquely identify positions over a distance equal to the product of the spacings — an exponential gain from a polynomial number of cells, directly analogous to the Chinese Remainder Theorem.

Unique range ≈ λ₁ × λ₂ × λ₃ × … (for mutually co-prime spacings)

Figure 3 — Three Grid Modules

Left: three overlaid modules at different scales. Right: their combined activity — a far richer spatial signal.

Modules overlaid
Combined activity
Module 1 (fine) Module 2 (medium) Module 3 (coarse)
55
80
115

Figure 3. Three grid modules with increasing spacings (approximately in a √2 ratio). The combined map (right) contains unique location information that no single module provides alone — the spatial resolution of the fine grid with the large range of the coarse grid.


4

Path integration: the brain's dead reckoning

One of the most remarkable properties of grid cells is that they maintain their hexagonal firing patterns in complete darkness, with no visual landmarks. They track position purely from self-motion cues — the velocity and heading of the animal — integrating these signals step by step. This is called path integration, or dead reckoning: the same technique sailors used before GPS.

The underlying circuit mechanism is a continuous attractor network[7]. Neurons are connected in a topological torus. A localised "bump" of activity on this torus encodes current position. Head-direction and speed signals from other regions shift the bump as the animal moves, keeping the grid pattern aligned with the animal's actual location.

Path integration inevitably accumulates errors, analogous to drift in a ship's compass. Environmental landmarks and sensory feedback periodically recalibrate the grid, keeping it anchored to the true position[9].

Figure 4 — Simulated Path Integration

A simulated rat explores the arena. Grid-cell spikes (blue flashes) accumulate at the hexagonal lattice vertices.

3
Grid firing locations Trajectory Current position

Figure 4. The rat's path (white trail) samples the environment. Each time the rat crosses a vertex of the underlying hexagonal grid, the grid cell fires (blue flash). Over time, the firing pattern reveals the hidden lattice structure — built entirely from integrating self-motion signals.


5

From grid cells to place cells

How does the brain go from a repeating hexagonal code to a single, localised place field? The key insight of Solstad, Moser and Einevoll (2006)[3] is that a hippocampal neuron receiving convergent input from many grid cells at different scales automatically produces a single place field, with no additional machinery required.

The mechanism works in two steps. First, the periodic inputs sum linearly. Because they have different spacings and orientations, their peaks align only at a single location within any realistic environment — everywhere else the peaks destructively interfere. Second, a threshold nonlinearity in the hippocampal neuron amplifies the single coincident peak while suppressing the rest.

r_place(x) = ReLU[ Σᵢ wᵢ · r_grid_i(x) − θ ]

where wᵢ are synaptic weights, r_grid_i are grid-cell rates, θ is a threshold

Figure 5 — Grid Summation → Place Field Emergence

Left: summed grid inputs. Right: the resulting place field after thresholding. Add more grid inputs to watch the place field sharpen.

Grid inputs (summed)
Resulting place field
3
0.65

Figure 5. Left panel shows the sum of N grid-cell inputs with different spacings and phases. Right panel shows the place-cell output after applying a rectifying threshold. With a single grid (N=1) the repeating pattern is visible everywhere; as N increases, peaks cancel except at one location — a place field crystallises.

Different hippocampal neurons receive inputs from grid cells with different phase combinations. Each combination selects a different location as the coincidence peak. The full population of place cells therefore tiles the environment, with each neuron representing a distinct patch. The place map is, in this view, the decoded output of the grid-cell population code.


6

Remapping: unique maps for every room

When an animal enters a new environment, grid cells shift their phase while largely preserving their spacing and orientation[5]. Even a small phase shift propagates through the summation mechanism to produce a completely different coincidence pattern in the hippocampus — a wholly new set of place fields. This is complete remapping: no spatial relationship between fields in environment A predicts fields in environment B.

Monaco and Abbott (2011)[5] showed computationally that inter-module phase shifts are the primary driver of remapping, far more powerful than changes in orientation or scale. The grid system therefore provides an effectively unlimited memory capacity: each new phase configuration encodes a distinct environment.

Figure 6 — Remapping between Environments

Grid spacing is unchanged; only the inter-module phase shifts. Place fields reorganise completely.

Environment A
Environment B (remapped)
40
5

Figure 6. Each colour represents one place cell. In Environment A (left) cells have fixed fields; in Environment B (right) the grid-module phase shifts, and each cell's field moves to a completely new, unpredictable location. Increasing the phase shift amplifies remapping; setting it to zero collapses both maps to the same pattern.


7

Neuroanatomy of the spatial circuit

Grid cells are concentrated in layer II of the medial entorhinal cortex (MEC), which projects directly to the hippocampus via the perforant path. Spacing increases systematically from the dorsal to the ventral pole of the MEC, mirroring a parallel increase in hippocampal place-field size along the dorsoventral hippocampal axis.

MEDIAL ENTORHINAL CORTEX (MEC) Grid · Head Direction · Border cells dorsal (fine λ) ←→ ventral (coarse λ) layer II → perforant path HIPPOCAMPUS CA1 / CA3 / DG Place cells · Episodic memory dorsal (small fields) ←→ ventral (large)

Figure 7. Schematic of the entorhinal–hippocampal projection. Grid cells in MEC layer II project via the perforant path to hippocampal CA1 and CA3. The dorsoventral gradient in grid spacing (left) mirrors the gradient in place-field size (right).


8

Beyond physical space

If grid cells were merely a specialised navigation module, they would be a curiosity. But accumulating evidence suggests the grid code is a general-purpose representational format. Doeller, Barry and Burgess (2010)[6] showed using fMRI that the human entorhinal cortex exhibits the characteristic 6-fold rotational symmetry of a grid code during virtual navigation — the first evidence in humans.

More striking still: subsequent studies found the same 6-fold signal when people navigated abstract conceptual spaces — for instance, a 2-D space defined by the neck and leg lengths of birds, or a space of social dominance relationships. The grid signature appeared whenever subjects needed to compare entities along continuous dimensions.

Dong and Fiete's 2024 review[8] synthesises this literature, arguing that grid cells implement compressed sensing: a small population can uniquely represent a vast number of positions by exploiting the modular, multi-scale structure. This compressive property applies to any high-dimensional structured space — making the grid code a candidate for a universal cognitive map that underpins reasoning, memory and imagination well beyond spatial navigation.

Conjecture (Bellmund et al., 2018). The hippocampal–entorhinal system constructs "cognitive maps" of conceptual knowledge — abstract relationships, narratives, social hierarchies — using the same grid-and-place architecture that evolved for physical navigation. This would explain why hippocampal damage impairs not only spatial memory but also the learning of new relational concepts.

References

References

[1]
O'Keefe, J. & Dostrovsky, J. (1971). The hippocampus as a spatial map. Preliminary evidence from unit activity in the freely-moving rat. Brain Research, 34(1), 171–175.
[2]
Hafting, T., Fyhn, M., Molden, S., Moser, M.-B. & Moser, E.I. (2005). Microstructure of a spatial map in the entorhinal cortex. Nature, 436, 801–806. First description of grid cells and the hexagonal firing pattern.
[3]
Solstad, T., Moser, E.I. & Einevoll, G.T. (2006). From grid cells to place cells: A mathematical model. Hippocampus, 16(12), 1026–1031. Demonstrates how multi-scale grid summation plus threshold nonlinearity generates single place fields.
[4]
Stensola, H. et al. (2012). The entorhinal grid map is discretized. Nature, 492, 72–78. Identifies discrete grid modules with ~√2 spacing ratio between successive modules.
[5]
Monaco, J.D. & Abbott, L.F. (2011). Modular realignment of entorhinal grid cell activity as a basis for hippocampal remapping. PLOS Computational Biology, 7(10), e1002023.
[6]
Doeller, C.F., Barry, C. & Burgess, N. (2010). Evidence for grid cells in a human memory network. Nature, 463, 657–661. First fMRI evidence for hexagonally symmetric (grid-like) activity in the human entorhinal cortex.
[7]
Burak, Y. & Fiete, I.R. (2009). Accurate path integration in continuous attractor network models of grid cells. PLOS Computational Biology, 5(2), e1000291.
[8]
Dong, C. & Fiete, I.R. (2024). Grid cells: mechanisms and function. Annual Review of Neuroscience, 47, 345–368. Comprehensive review covering attractor models, coding theory, and the role of grid cells in cognition beyond navigation.
[9]
Taba, J.K. & Bhatt, D.L. (2022). Continuous attractor model for bidirectional coupling between place and grid cells. Scientific Reports, 12, doi:10.1038/s41598-022-25863-2. Path-integration error correction via place–grid feedback.
[10]
Gardner, R.J. et al. (2022). Toroidal topology of population activity in grid cells. Nature, 602, 123–128. Direct experimental confirmation that grid cell population activity lies on a toroidal manifold — the expected signature of a continuous attractor network.