Two flowers: learn which one pays

With no learning inside the circuit, can echoes of the last visit and its reward be enough to follow the richer flower?

Trained readout on fixed wiringFruit fly multisensory circuit (FlyWire)Train it yourself →Benchmark scores →
Loading 3D view…
Fly ·
livein your browser

What we measured

Real wiring, held out
0.57 reward per visit
Rewired, same degrees, held out
0.50 reward per visit
Random wiring, held out
0.50 reward per visit
Circuit silenced, held out
0.50 reward per visit
Measured with
scripts/gym-benchmark.ts: 12 generations of 16, same seed and budget for every circuit
Train it yourself
/train/gym-bandit

What happens

Each trial the fly picks a flower. On the chosen flower it sees which side it is on (LPLC1 of that side) and, if the flower paid, tastes sugar (the sugar receptor neurons). Then the next choice comes quickly.

Beating chance needs the rule win stay, lose shift, which needs a memory of the last visit and its result. The circuit cannot learn; any memory has to be activity still echoing in the network. Expect a result near chance: that is the honest answer for a circuit without plasticity.

The score is the expected reward of the chosen flowers (0.5 is chance, 0.8 is the best possible).

What you see is the readout the benchmark trained on the real circuit, playing the held out setting. Switch the circuit to a rewired one to watch the same readout on wiring it was not trained for, or train your own in the training lab.

Inspired by: Two armed bandit tasks in flies and mice; Rajagopalan et al. (2023) on reward learning in the fly mushroom body.

How the brain is wired to the world

The mapping is part of the experiment design. Everything between senses and motor output is the connectome.

Senses → neurons
  • Choice time → LC16
  • On the left or right flower → LPLC1 of that side
  • Reward → sugar receptor neurons
Neurons → movement
  • Trained readout of 21 output neurons → right flower (+) or left (−)

Dataset: Subcircuit of FlyWire v783: inputs HSE, HSN, HSS, LPLC1, LC4, LPLC2, LC16, ORN_DM1, ORN_DA2, sugar/water, bitter; outputs DNa01, DNa02, DNa03, DNb05, DNa11, DNp01, MDN, DNp09, DNg13, DNp03, CB0701; paths with at least 40 synapses per step. About this dataset

Run it locally

Every experiment can also use the local runner, which simulates the brain on your own computer. It is required for connectomes too large for a browser.

git clone https://github.com/berkeyc/connectome-lab.git
cd connectome-lab
pip install -r local/requirements.txt
python local/runner.py            # listens on ws://localhost:8765

Then choose “Local runner” in the player controls and press Restart. Your browser may ask for permission to connect to a local device.