Experiments · E28

Does the fly rank alloys better when dopamine signals surprise rather than raw reward?

Yes. Teaching from outcome minus expectation raised its held-out rank correlation to 0.853, against 0.561 for the composition alone.

In the log: The fly beats the baseline once dopamine reports a prediction error

recordedDate 2026-09-12, as written in the loggenerator · fly brain0 predictions · 0 result paragraphsEXPERIMENTS.md lines 1330–1389
exp E28 diagram
What E28 did and how it came out, drawn from this record and the files it names (book/assets/diagrams/exp/E28.svg).

Results

No result paragraph for this entry was found in the log.

The full record

EXPERIMENTS.md · lines 1330–1389

E28 — The fly beats the baseline once dopamine reports a prediction error

Date 2026-09-12 · Question E27 left the circuit learning a quarter of what ridge regression on the composition gets. Is the representation weak, or the rule that reads it? · Provenance forager/mushroom.py, …/{fly_layers,apl_gain, fly_decompose,fly_learn2}.py

First, a self-inflicted fault. E27's "auto" input gain targeted the current arriving at the Kenyon cells, which drove the projection neurons to 100% saturation: every channel pinned at 1.0, so a 5% element and a 20% element arrived identical and the composition was destroyed at the first layer. The gain now targets the projection neurons' own operating range. Saturation 100% -> 4.9%, and the composition survives.

APL, measured. The inhibition is real and complete in the asset - 2 GABAergic cells, every Kenyon cell both driving APL and receiving it back. Silencing it triples the active fraction (5.5% -> 18.0% at normal intensity), matching the direction Lin et al. (2014) report. It does not confer intensity invariance: sparsity still rises 44-fold over a 16-fold intensity sweep, because a bounded inhibitor cannot keep pace with growing drive. Irrelevant to this application, where compositions always sum to one, but it means the sparsity here is set by a fitted threshold with APL assisting, not by divisive normalisation. Recorded rather than claimed away.

The decomposition that settled it. Fit a linear readout to each population and ask how much of the answer is present, which is the ceiling any rule on that pathway reaches:

readout on held-out Spearman
composition vector (the bar) 0.561
projection neurons 0.913
Kenyon cells 0.928
output neurons 0.852
the fly's own rule (E27) 0.273

The representation was never the problem. The sparse code carries substantially more about the free energy than the composition does - the expansion into 4,064 cells at 6% occupancy is doing real work. The plasticity rule was discarding two thirds of it.

The rule was wrong, and the anatomy says how. E27 taught from baseline - reward, a running average of past outcomes. A dopaminergic neuron does not report the outcome; it reports how far the outcome differed from what was expected. The expectation is available exactly where it is needed: all 97 output neurons project onto the dopaminergic cells, 2,589 measured edges. Teaching from that error instead, with both terms standardised against their own running statistics:

rule lr epochs held-out Spearman
reward baseline 1.0 6 0.387
reward baseline 1.0 20 -0.620
prediction error 1.0 6 0.812
prediction error 1.0 20 0.853

0.853 against the composition baseline's 0.561, and a ceiling of 0.928. The circuit now extracts 92% of what is in its own code, and beats the trivial baseline by half again. The reward-baseline rule does not merely underperform - it diverges with more training, which is the signature of a signal carrying no credit assignment.

Caveat. lr 3.0 collapses to -0.043: the rule is stable over roughly one order of magnitude in learning rate, not more. The standardisation of reward against score is an implementation choice made because the two are in unrelated units; it is a dynamic-range adjustment, and no claim is made that a fly performs precisely that arithmetic.

Related entries

Built with PRISMWebsite and visualizations made using Claude