I Gave a Simulated Connectome External Memory. Then I Killed the Brain.
DEV Community

I Gave a Simulated Connectome External Memory. Then I Killed the Brain.

The Experiment

In Post 1, I asked what happens if a connectome gets an external memory it never queries. Here I built a tiny honest version and ran it. The question in this post is deliberately narrow: can externally stored experience survive a full substrate reset and reinstate behavior in a brain that never learned it? That is the whole result. The stranger question, swapping two histories, is Part 3. I am not touching the 166,700-neuron connectome yet. I am using a small fixed recurrent network as a stand-in: sensory inputs, a hidden middle, descending motor outputs, wired once and never rewired. Beside it I attached Mycelium mechanics: salience-gated writes, similarity-based pattern completion, co-access strengthening, decay.

The task is a cue-response gauntlet. The agent sees one of a few cues and must produce one of a few actions. One action is correct for each cue. The mapping is fixed but unknown. Correct action is reward, wrong action is punishment. The fixed network has no mechanism for learning the mapping from experience. Every number below is accuracy on that task: the fraction of trials the agent picks the correct action, from 0 to 1. Chance is 0.33.

The Non-Negotiable Rule

The credibility of this experiment rests on a single, non-negotiable rule: the memory system cannot pick an action. It can only bias the state from which an action emerges. Here is the code that enforces it:

def observe_and_modulate(self, state):
    # Continuous recall. No query issued: similar states simply fire.
    s = state / (np.linalg.norm(state) + 1e-8)
    sims = self.keys @ s  # how strongly each memory resonates
    active = sims > self.sim_thresh
    if not active.any():
        return np.zeros(self.dim)
    w = (sims[active] * self.strength[active] * self.sign[active])[:, None]
    m = (w * self.traces[active]).sum(axis=0)
    return self.gain * m  # a bias CURRENT, never an action

def step(self, u, modulation=None):
    drive = self.W @ self.x + self.W_in @ u + self.b
    if modulation is not None:
        drive = drive + modulation  # memory enters HERE, as current
    self.x = (1 - self.alpha) * self.x + self.alpha * np.tanh(drive)

def motor(self):
    return self.W_out @ self.x  # reads network state ONLY. memory is absent here.

The memory cannot choose what happens. It can only change the state that choice comes out of. If it could pick the action, everything after this is a Doom bot with a fly stapled on.

Four Conditions

I ran four conditions. Read them for flat versus improving, not for raw accuracy.

Condition Architecture Accuracy
A connectome only ~0.70
B connectome + plasticity ~0.47
C connectome + external memory ~1.00
D plasticity + memory ~0.88

Accuracy is the fraction of trials the agent picks the correct action, 0 to 1. Chance is 0.33.

The fixed network happened to begin around 0.70 on this seed. That is not learning. Its behavior is static. It got some cue-action mappings right because the randomly initialized network already preferred the correct action for those cues. A fixed brain can be accidentally good. It can never get better.

What matters here is not which arm starts highest. It is whether experience changes future behavior. Plasticity alone was noisy, and here it hurt, landing near 0.47. External memory was the only arm that turned experience into steady improvement, reaching ~1.00. Both together came out at ~0.88, not 1.00: the two systems are not cleanly additive, and naive plasticity slightly interferes.

The Headline Test

This is where the architectural difference actually shows up. I taught one system, then destroyed the substrate: wiped the state and any plastic weight changes, back to birth.

  • plasticity: learn → destroy substrate → learned effect disappears
  • external memory: learn → destroy substrate → attach memory to a pristine, equivalent substrate → learned behavior reappears

The learned effect in the plasticity system died with the substrate. Performance fell from 0.44 to 0.20 after reset. What it learned lived in the weights, and I erased the weights.

The external memory survived. The original system scored 0.84. A fresh substrate given only its saved memory scored 0.86.

The plasticity learned and then forgot. The memory was never in the brain to begin with, so killing the brain could not kill it. The learned behavior did not survive in the brain. It survived outside it.

Caveats

This does not demonstrate a real fruit-fly connectome learning with Mycelium. The network is a small stand-in. The task is simple. Salience is engineered rather than derived from biological dopaminergic activity. I tested one architecture and one seed here. And I have not shown transfer into a different substrate class.

What I have shown is narrower: external associative state can preserve learned behavioral influence across destruction and replacement of the substrate that originally experienced it.

What Comes Next

Surviving your own reset is one thing. Here is the question that unsettled me: start two identical brains, give them different histories until they become different individuals, then swap the histories. Does the individual follow the brain, or the memory? I ran that experiment too. The result is why I stopped thinking about this as merely persistent storage. That's Part 3.

Clone it and break it:

git clone https://github.com/constant-itis/flymem && cd flymem && python3 flymem.py

What I Actually Ran

The command above. 6 cues, 3 actions, 600 training episodes, 300 evaluation trials, one fixed seed. Every number is accuracy on that task, where chance is 0.33.

⚠️ Where I Might Be Wrong

The honest caveat. This is a stand-in recurrent network, not the real fruit fly connectome. It is one simple cue task, not an embodied world. Salience is hand-wired from reward and novelty, not read from real dopaminergic activity. Every number here is a single seed. Clone it, change the seed, and tell me where it breaks.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.