FLY
PONG

The top paddle belongs to 1,370 neurons from a real fruit-fly brain. The ball lights up the fly's object-detecting eye cells, the fly's own wiring turns that into steering commands, and the steering moves its paddle. Nothing about its play is scripted, and you can train it.

,  ·   ·   ·   ·  ,  ·   · 

YOU 00 : 00 FLY
THE FLY PRACTISES ON A WALL1× REAL TIME
touch here to play

Click the arena or press ← → to take the bottom paddle and play against the fly.

Turn your phone upright for a bigger arena.

Brain, seen from the front as you face the fly · live spikes 0 neurons firing
· LC10a receptive fields
its right eye
its left eye

ball 0° to its right · 2° wide

Model output ·
spikes/s← its rightits left →
DNa02
DNa01
R 0steer   0L 0

The fly

120 spikes/s

Courting males turn up the gain of LC10a to chase a female. Low gain makes a sluggish, easily beaten fly.

Train it

heat
sugar
–
fly returns, last 20 balls
0
of 10,866 eye-neuron connections changed
Fly's returns per 10 balls

How the fly plays

Each paddle movement is the end of a chain of spikes through real wiring. The chain below is the fly's visual pursuit pathway, the one males use to chase a moving female during courtship.

The game gives the fly one thing: the ball. Every 10 ms it works out, from the fly's paddle, how far the ball is to the fly's left or right and how big it looks, and sets how fast each eye neuron fires from how close the ball is to that neuron's patch of view. The fly can't see your paddle, the walls or the score. Sugar and heat never reach it as spikes; they change the strength of its synapses directly. What comes out is just as narrow: the game reads four steering neurons, and their right-minus-left firing sets the paddle's speed. The game reads none of the other 1,366 neurons, including 178 other descending neurons; they move the paddle only through what they do to those four.

Watch how it plays. While the ball is roughly in front, the fly holds still. Once the ball drifts more than about 40° to one side, which happens late in its approach, the fly swings toward it. That style comes straight out of the wiring. The peripheral relay, AOTU025, excites the steering neuron on its own side. The central relay, AOTU019, uses the inhibitory transmitter GABA and holds down the steering neuron on the opposite side, so a ball in front keeps both steering neurons quiet.

1 · EYES LC10a 234

Visual projection neurons that respond to small moving objects. The ball excites the ones whose receptive fields it falls in, more of them as it gets closer and bigger.

2 · RELAY AOTU019 · AOTU025 4

Two pursuit relays in the anterior optic tubercle. AOTU025 (periphery) excites the steering neuron on its side; AOTU019 (centre of view) inhibits the one on the other side.

3 · NETWORK everything in reach 1,128

Every other neuron this input can make fire, excitatory and inhibitory, simulated spike by spike.

4 · STEERING DNa02 · DNa01 4

Descending neurons whose right-minus-left difference predicts turning in walking flies.

5 · PADDLE turn → speed 0.045

Paddle speed in field widths per second, per spike/s of right-minus-left steering. Nothing else moves it.

Taken from the data

  • Which neuron connects to which, and with how many synapses (FlyWire release 783).
  • Whether each connection excites or inhibits, from predicted neurotransmitters.
  • The cell types and the pursuit pathway LC10a → AOTU019/AOTU025 → DNa02.
  • Where each LC10a looks. Its input neurons place it on the eye's map, and its preference for AOTU019 (central view) over AOTU025 (periphery) orients that map. The two agree at r = 0.90 (right eye) and 0.93 (left eye).

Our modelling choices

  • Every neuron is the same leaky integrate-and-fire unit, with the parameters of Shiu et al. 2024.
  • The ball drives LC10a through Gaussian receptive fields 16° wide. Each eye is assumed to see from 15° across the midline to 150° to its side.
  • The steering readout: DNa01 counted at half the weight of DNa02, the steering-to-paddle gain and the 25 ms smoothing of steering rates.
  • The learning rule and which connections may change.
  • Arousal is an input gain. In courting males, P1 neurons raise LC10a gain, but P1 is male-specific and this is a female brain.

How training works

The 10,866 connections that LC10a neurons make onto the rest of the circuit can change. Each keeps an eligibility trace, a fading record (time constant 0.8 s) of moments when the neurons on both sides of it fired together. Dopamine turns that record into change: sugar strengthens recently active connections and heat weakens them, up to three times or down to zero their wired strength. This three-factor rule is how the fly's mushroom body learns. Applying it to the pursuit pathway is our assumption.

Rally reward sounds like the obvious way to teach Pong, and it barely works. A miss is usually a turn that came too late, and weakening the synapses that were active makes the next turn weaker still. The coach gives feedback every 10 ms instead, the way heat was applied in the classic flight-simulator experiments where tethered flies learned to steer. In our tests, two minutes of coaching took a naive fly from 36% of balls returned to 84%, as good as a courting fly (80%). We measured each over three five-minute runs, with learning switched off for the trained fly.

Checks we ran

  • Simulator vs the published model. Stimulating sugar-sensing neurons, our firing rates match the original Brian2 model at r = 0.999, mean difference 0.6 spikes/s. To get there we had to copy one Brian2 detail: input that arrives during a neuron's 2.2 ms refractory period is discarded.
  • Sub-circuit vs the whole brain. On six random ball trajectories with random synapse strengths, the 1,370-neuron circuit in this page produced spike trains in the steering neurons identical to a simulation of all 138,639 neurons.
  • Pursuit is in the wiring. Within about 30° of straight ahead, the ball drives the central relay AOTU019 while the steering neurons stay nearly silent (under 16 spikes/s). Further out, the peripheral relay AOTU025 joins in and that side's DNa02 fires, reaching 60–110 spikes/s at 90°. The opposite side's DNa02 stayed silent in every condition we tested.

Sources