ChessFly
The complete FlyWire connectome of an adult fruit fly, trained to play chess. 138,639 neurons and 15,091,983 connections, wired exactly as the reconstruction has them.
The anatomy is frozen: every connection sits where FlyWire puts it, with the sign (excitatory or inhibitory) the authors assigned. What learns is an encoder from the board into the 10,855 visual sensory neurons, one positive gain per connection but never its sign, a homeostatic gain and threshold per neuron and step, and a decoder reading the central brain and descending neurons into a 1968-move policy and a 64-bin win probability. Activity settles over 5 steps of h <- (1 - a) h + a relu(gamma (W h + u - mu) / sigma + beta), with W_ij = sign_ij * exp(theta_ij).
It recovers Stockfish's top move 30.4% of the time with a value MAE of 0.081, trained on 4.4M annotated Lichess positions. A random legal move scores 3%, and always playing the most common legal move, which is what a dead network learns, scores 13%.
Demo: Play it in your browser with the ChessFly Space.
Usage
from safetensors.torch import load_file
w = load_file("flynet.safetensors") # encoder, log_gain (one per connection), scale, shift, decoder, heads
Each move is one forward pass over the whole brain:
- Pack the FlyWire release into a CSR graph. It is not redistributed here;
connectome_meta.jsonlists the source files with their hashes. - Mirror black-to-move positions so the fly always plays White, then encode the 780 board features into currents on the input neurons.
- Run the 5 steps, read the 41,692 central brain and descending neurons into 1968 move logits and 64 value bins, and mask the logits to the legal moves.
The Space stacks a depth-3 search on top, where a whole tree level is one batched forward pass through the brain.
Connectome and neurotransmitter signs from Shiu et al., Nature 634 (2024), on the FlyWire FAFB reconstruction (Dorkenwald et al., Nature 2024); cell classes and positions from Schlegel et al., Nature 634 (2024); labels from Lichess/chess-position-evaluations (CC0). FlyWire's non-commercial terms apply to anything derived from the graph.