The fly plays poker
Can a fixed fly circuit, read by a simple readout, learn when to bet, call and fold, and how close does it get to the best possible play?
Learning curve
press TrainInside the circuit
live, current readoutSaved runs
tick runs to overlay their held out curvesNo saved runs yet. Train the real circuit and a control, save both, and compare their curves here.
What is being trained
Kuhn poker has three cards (jack, queen, king), one card for each player, an ante of one chip and one round of betting. It is small enough to be solved exactly, so every strategy has a known expected value.
The fly sees its card: the jack drives its LC4 neurons, the queen its LPLC2 neurons and the king its LPLC1 neurons. If the opponent has bet, the fly smells odour A (ORN DM1); if the opponent has checked, odour B (ORN DA2). This encoding is arbitrary; what matters is that it is fixed and that everything between senses and output is the real wiring.
A readout of 21 output neurons decides: positive means bet or call, negative means check or fold. Each episode asks the fly for its decision in all 12 situations (3 cards times 4 betting spots) and scores the exact expected chips per hand.
Training plays against two exploitable opponents, a bluffer and a calling station. The held out test is a third style the fly never met, a maniac who bets and calls almost everything. The benchmark also plays the equilibrium player, who cannot be beaten on average: 0 chips per hand is the best anyone can do against it, and betting only with the king already gets there.
Inspired by: Kuhn (1950), A simplified two-person poker; Libratus and Pluribus for the poker AI that followed.
How to read the result
Fixed: the wiring, the synapse counts, the transmitter signs and the neuron model (Shiu et al. 2024). Learned: 22 readout numbers.
A rising curve alone proves little: a trained readout can often make use of any network. The evidence is in the comparison. Train the real circuit, save it, train a rewired control, and overlay the two held out curves. If the real wiring learns faster or generalises better, the specific map carries information the controls lack.
Senses: Jack → LC4; Queen → LPLC2; King → LPLC1; Opponent bet → odour A (ORN DM1); Opponent checked → odour B (ORN DA2). Readout neurons: DNa01 left, DNa01 right, DNa02 left, DNa02 right, DNa03 left, DNa03 right, DNb05 left, DNb05 right, DNa11 left, DNa11 right, DNp01 left, DNp01 right, MDN left, MDN right, DNp09 left, DNp09 right, DNg13 left, DNg13 right, DNp03 left, DNp03 right, MN9 (proboscis).
Training uses a 0.25 ms simulation step (the lab uses 0.1 ms); firing rates in these circuits differ by about 2 percent. 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