The 3D view needs WebGPU or WebGL2.

input neuronsneurons read out

September 26, 2026 · Navigation

The fly brain’s compass holds a heading in the dark

With its wiring exactly as in the FlyWire map, the fruit fly’s head-direction ring keeps a heading in darkness once the timing of 28 of its cell types is tuned.

A fruit fly knows which way it is facing, even in the dark. In a ring-shaped structure at the centre of its brain, the ellipsoid body, compass neurons carry a single bump of activity that moves around the ring as the fly turns, like a compass needle. In darkness the bump keeps following the fly’s turns, and it stays put while the fly holds still (Seelig & Jayaraman, 2015).

The complete wiring of this circuit is now known. The FlyWire consortium mapped every neuron in the brain of one adult fly (Dorkenwald et al., 2024; cell types: Schlegel et al., 2024), including the 47 compass neurons, called EPG cells, and the cells that loop back onto them. That raises a simple question: is the wiring enough to hold a heading?

Wiring alone is not enough

We run the complete FlyWire brain in software, 138,639 neurons connected exactly as mapped. When we place a bump on the compass ring and switch off every input, it does not stay. Wherever we put it, it slides back to one fixed position: after 100 steps only 2 of 16 bumps are still near where we put them, which is chance. The map records which cells connect to which. It does not record how quickly each cell responds.

untrained180°0°−180°0100200300time stepstuned180°0°−180°0100200300time steps
Figure 1. The 47 compass neurons, sorted by their place on the ring, over time; the ring closes, so the top and bottom edges are neighbours. A bump is written for 10 steps (bright band), then the lights go out; the dotted line marks where it was written, the blue dots where it is. Untrained, the bump snaps back to one resting place; tuned, it stays. Shown is one of the 16 test directions.

Tuning the cells’ timing

We kept every connection as it is. Only the ring’s own cell types, 28 of them with 459 neurons, were allowed to adapt: how strongly they respond, how active they are at rest, how quickly they forget and the rhythm of their activity. We tuned them on one task, holding a bump wherever it is placed, and then tested on 16 directions the ring had never been tuned on. A direction counts as held if the bump is still within 30 degrees of where we put it; by luck alone, about 3 of 16 would be.

The ring now held 15 or 16 of the 16 new directions for 100 steps, in each of three independent runs, and 11 to 15 after 300 steps. Without the rhythm the ring did not learn: in a control run with it fixed at zero, only 3 of 16 held.

Of 16 new directions, bumps still where they were placed
051015100200300400500600time steps in darknessdirections held
trained, run 1trained, run 2trained, run 3untrainedrhythm fixed at zero (one run)
Figure 2. Of 16 new directions, how many bumps are still within 30 degrees of where they were placed. Three tuned rings (orange), the untrained ring (dark) and one ring tuned with the rhythm fixed at zero (grey). The dashed line is chance, about 3.

Which cells hold the memory

We then switched off one cell type at a time, as neuroscientists do in real flies with genetic silencing. The ring was never tuned for this test. Without Δ7 or PEN cells it held at most 6 of 16 after 100 steps in every run, near chance for Δ7 and PEN2; without PEG cells it held 2, 8 and 5. Several ring-neuron types, most clearly ER2, ER4m and ER6, were not needed for 100 steps but were for 300: without any of them, holding fell to chance.

In flying flies, a bump placed with light is kept by the circuit, and a network with local excitation and global inhibition keeps it single and persistent (Kim et al., 2017). In our model, tuning made the loop of compass, PEN, PEG and Δ7 cells respond about 1.4 to 1.6 times more strongly and forget more slowly.

Directions held with one cell type switched off (of 16, mean of three runs)
051015intactΔ7PEN1PEN2PEGER2ER4mER6directions held
after 100 stepsafter 300 steps
Figure 3. Directions held with one cell type switched off, mean of three tuned rings, after 100 steps (orange) and 300 steps (dark). Without Δ7, PEN or PEG cells the memory is gone at once; without the ring neurons ER2, ER4m or ER6 it lasts 100 steps but not 300. The dashed line is chance. PEN1 and PEN2 are named PEN_a and PEN_b in FlyWire.

A prediction for real flies

In the fly, PEN cells move the bump when the fly turns (Green et al., 2017), and blocking their output in walking flies weakens the bump and makes it jump (Turner-Evans et al., 2017). Our model predicts that the bump also fails to hold when the fly stands still in the dark. To our knowledge that has not been tested on its own.

What comes next

Next, the compass turns with the body and holds its heading for longer.

The fly’s wiring diagram, unchanged, held a heading in the dark once 28 of its cell types were given the right timing.

We thank the FlyWire consortium for the wiring diagram and its cell-type annotation.

References

  1. Seelig, J. D. & Jayaraman, V. (2015). Neural dynamics for landmark orientation and angular path integration. Nature 521, 186–191. doi:10.1038/nature14446
  2. Kim, S. S., Rouault, H., Druckmann, S. & Jayaraman, V. (2017). Ring attractor dynamics in the Drosophila central brain. Science 356, 849–853. doi:10.1126/science.aal4835
  3. Green, J. et al. (2017). A neural circuit architecture for angular integration in Drosophila. Nature 546, 101–106. doi:10.1038/nature22343
  4. Turner-Evans, D. et al. (2017). Angular velocity integration in a fly heading circuit. eLife 6, e23496. doi:10.7554/eLife.23496
  5. Dorkenwald, S. et al. (2024). Neuronal wiring diagram of an adult brain. Nature 634, 124–138. doi:10.1038/s41586-024-07558-y
  6. Schlegel, P. et al. (2024). Whole-brain annotation and multi-connectome cell typing of Drosophila. Nature 634, 139–152. doi:10.1038/s41586-024-07686-5