20fly8

A fruit fly’s mushroom body learns to play 2048

Score0
Game1
Largest tile—
Best score0

 

Nobody tells this fly the rules. Its moves come from the mushroom body, the part of the brain flies learn smells with, wired cell by cell from the FlyWire connectome. Merging tiles is its sugar; when a move turns out better or worse than expected, dopamine adjusts the synapses that judged it. Press Turbo to let it play a few hundred games and watch panel d.

bFour possible boards, one choice

Before each move the fly smells the board every arrow would make and goes for the one its mushroom body likes most.

cInside the mushroom body

 

The mushroom bodies (gold) among all 138,639 neurons of the FlyWire brain.

dLearning

 

How it works

Flies learn which smells mean food in their mushroom bodies. A smell switches on a few of the ~50 kinds of projection neurons; each Kenyon cell listens to a handful of them and fires only when enough agree, so every smell gets its own sparse pattern of Kenyon cells. Those cells talk to a few dozen output neurons that push the fly towards a smell or away from it. Dopamine neurons decide which of those synapses to weaken.

Here the smell is a 2048 board. Each cell and tile size has its own projection neuron, and the wiring from there on is the real FlyWire v783 connectome: 27,502 connections onto 5,177 Kenyon cells, 62,261 onto 96 output neurons. Before every move the fly smells the four boards it could make and picks the one it likes most. When the move pays off better than that smell promised, the reward neurons (PAM) fire and weaken the synapses onto avoidance neurons; when it goes worse, the punishment neurons (PPL1) weaken the synapses onto approach neurons. Merging tiles is the sugar. That is all it learns from.

PartStatus
Who connects to whom, synapse countsFlyWire v783, unchanged
Which compartment gets reward or punishment dopamineread from the DAN → output-neuron synapses
Dopamine weakens the synapses of active Kenyon cellsmeasured in flies (Hige et al. 2015); bidirectional here
Board → projection neurons, the reward-prediction error, picking a movehand-made interfaces
Neuron dynamicsfiring-rate model with APL-style sparse coding, not spikes

Connectome: Dorkenwald et al. 2024, Schlegel et al. 2024 (CC BY-NC 4.0). Mushroom-body compartments: Aso et al. 2014; Li et al. 2020. Code: MIT.

20fly8
Wiring a mushroom body from the FlyWire connectome
…