Project 05Explore · results platformPython · PyTorch · bounded Python judge

Flycodes: can a fixed fly brain learn to write code?

Load the whole connectome, all 165,122 traced neurons and 25,563,197 directed connections, keep its wiring fixed, and train only a readout on top of its dynamics. Then ask it to solve LeetCode-style problems: Two Sum, valid brackets, maximum subarray. The results platform shows every program it produced, what the judge said, and the activity of its neurons while it wrote them.

Network

165,122 neurons · 25,563,197 edges · no trainable synapses

Training (v2)

246 verified MBPP examples · 60 validation · 2 readout seeds

Fresh tasks

0 / 24 solved, both seeds, same as the no-recurrence control

Diagnosis

readout barely uses the recurrence; memory improves without rewiring

What you can do in the platform

The hosted platform is the saved view generated from the latest completed run: pick any problem, read the exact generated program for each model and seed, see its judge outcome case by case, switch to the "after mechanical syntax repair" interpretation, watch recorded neuron activity on the fly avatar, and read the training curves. Starting a new experiment needs the local server and the 500 MB mapped graph (./flycodes.sh serve).

The result

ModelFresh MBPP subsetUnseen constantsSeen trainingReadout params
Fly · seed 70 / 240 / 301 / 81,325,544
Fly · seed 190 / 240 / 300 / 81,325,544
No recurrence · seed 70 / 240 / 301 / 81,325,544
No recurrence · seed 190 / 240 / 300 / 81,325,544

Training loss fell from 6.6 to 0.03 while validation loss bottomed out at step 100 and then climbed: the readout memorised the corpus. The one passing program is a reproduction of a seen training example (return sum(nums) + 0). A post-run audit with stronger tests removed three false-positive transfer passes per seed-19 model that had used wrong constants; both the original and corrected scores are retained. Mechanical syntax repair made 25 outputs runnable and produced one more seen-training pass, no new-task success.

The earlier pilot (v1, 12 training exercises) scored 0/6 on the six original LeetCode-style problems, as did the no-recurrence control and a tiny Transformer. A pretrained LLM reference was planned and deferred; its blank score is not a zero.

Why, measured

Three panels: delayed-bit memory improves with stronger recurrence gain; next-token accuracy barely changes when recurrence is removed but drops when prompt context is shuffled; validation loss rises after step 100 while training loss keeps falling
docs/BACKTRACE_FIGURE.png. A model diagnosis, not a coding-performance improvement.

The proposes fixed-topology dynamics learning and staged primitive-to-program evaluations, with references. The current core has no trainable synaptic weights; whether a different fly-constrained architecture could learn broad algorithmic reasoning is an open question this study cannot settle.

How it was set up

Run it locally

cd projects/flycodes
python3.12 -m venv .venv && .venv/bin/pip install -r requirements.lock
./flycodes.sh prepare                 # maps the full graph from ../../data/flat-connectome (~500 MB)
./flycodes.sh prepare-curriculum && ./flycodes.sh train-curriculum
./flycodes.sh serve                   # http://127.0.0.1:8765, live platform
.venv/bin/python scripts/export_snapshot.py   # regenerates the self-contained flycodes.html