MAXIM
Engrams
What a memory trace has to do, and how much of that Maxim actually does
Maxim has five kinds of memory trace, and I used to call all of them engrams. Then I wrote down what an engram has to do and scored each against the code instead of its design. One passes on every count without the language model: a fear learned from drowning that gets the agent out of the water before the pain arrives, and transfers to an agent that never felt it. The rest form honestly and stop somewhere short.
Contents
The Idea
The word is older than almost everything else in neuroscience. Richard Semon coined engram in 1904 for the lasting change an experience leaves in living tissue — the physical trace that a later cue can bring back [1]. For most of a century there was no way to test it. Karl Lashley spent decades cutting lesions into rat cortex looking for where a maze memory lived, and in 1950 summarised the search as “In Search of the Engram.” No single lesion removed the memory [2].
What changed it was a tool. In 2012, Xu Liu, Steve Ramirez and colleagues in Susumu Tonegawa's lab tagged the neurons in the hippocampus's dentate gyrus that were active while a mouse learned to fear a place, and later switched just those cells back on with light. The mouse froze in a different, safe box [3]. A year later the same group paired reactivation of a tagged ensemble with a shock and produced fear of a place where nothing bad had happened [4]. The trace was real, it was a population of cells, and it could be driven from outside.
The modern picture that grew from this work [5] is the one I build against: an engram is a sparse ensemble, allocated to a small fraction of the available neurons, that forms from a single experience and can be reactivated by a partial cue. Maxim has no neurons. It borrows the shape of the idea and then has to show the borrowed shape does the same job.
Four Things an Engram Has to Do
Stripped of the anatomy, the idea makes four claims about a trace. It forms from one experience. It stays specific: a different situation does not land on it. It is recalled from a partial cue. And recall changes behaviour. A trace that forms and is never read is a record, not an engram.
I score Maxim on those four instead of on its design for the reason in Reachability: a design document describes arrows, and whether each arrow has a caller is a separate fact it cannot tell you. So every cell below was read in the code, and “changes behaviour” needs an experiment through the real action path with the valence removed as a control.
| Trace | Forms | Specific | Recalled | Changes behaviour |
|---|---|---|---|---|
| Situation | yes | for big swings only | yes | yes, no LLM |
| Recognition | yes | may drift | text only | text, small nudge |
| Episodic | yes | yes | built, unused | prompt text only |
| Semantic | by name | — | by name | prompt text only |
| Motor | no caller | — | — | no |
What Each Piece Borrows
Six ideas from the literature do real work in the code. For each: the biology, what I built from it, and where the copy is looser than the original.
Separate or complete
Every input forces a choice: is this new and owed its own trace, or a fragment of something stored that the old trace should fill in? David Marr sketched a hippocampus that could do both [6]. Alessandro Treves and Edmund Rolls later argued that CA3 needs two input systems for the two jobs: strong, sparse inputs from the dentate gyrus to force a new pattern when storing, and a separate cue pathway that lets CA3's recurrent connections complete a stored pattern from a fragment when retrieving [7][8].
Maxim's entorhinal cortex makes that decision with one number. A sensor reading is embedded and compared by cosine against the stored nodes for its channel; at 0.85 or above it completes into the best match, otherwise it allocates a new node. Sensor nodes keep their first vector as a frozen prototype, so they cannot drift into their neighbours. There is no sparse code here, just a threshold, and its geometry turns out to be the main limit on the whole system.
Allocation
Which neurons join an engram is not random. In the amygdala, neurons with more of the transcription factor CREB than their neighbours at the moment of learning win the competition to join the fear memory [9]. The working account: eligible neurons compete, the more excitable win, and because excitability lingers it also decides which memories get linked [10]. In mice, two places learned five hours apart were encoded by overlapping hippocampal ensembles and became linked, so fear of one spread to the other; two places learned a week apart were not [11].
Maxim takes the linking half and keys it on place rather than time. Every episodic trace the survival loop captures records the situation it happened in (the cluster ids above) and is linked to the concepts for those clusters, so memories from the same situation can be cued together. Excitability and the time window are not modelled.
Conditioned fear
Fear conditioning is the best-mapped learning circuit in the brain. A neutral cue paired with something painful becomes a trigger for defensive behaviour, and Joseph LeDoux's work placed the learning and storage of that association in the amygdala [12].
Maxim's cluster fear attaches that idea to a situation node. When the body reports pain from running out of air or losing health, the world-situation node active on that tick takes on fear; the next time a reading completes into that node, the fear raises a threat need the action selector acts on. It lives in the nucleus-accumbens module rather than a separate amygdala, and it does not decay, by design: getting over a fear should be new learning. Nothing writes that new learning yet, so this fear cannot currently be extinguished.
Tagging a moment after the fact
Uwe Frey and Richard Morris showed that a weak stimulus at one synapse leaves a temporary tag, and that a strong stimulus elsewhere on the same neuron within a window can supply what the tag needs to become lasting [13]. The behavioural version is striking: a weak training session that would normally be forgotten is remembered if the animal explores a novel place close to it in time [14], and the effect holds across several different kinds of learning [15].
Maxim's retroactive tagging borrows only the shape: when a trace is strong, traces from the same situation in the seconds before it become harder to forget — the earlier seconds in the water before the drowning bites, not the walk to the shore. It is backward-only, seconds long, gated by nothing like dopamine, and opt-in. Its design document says up front that it is not a faithful model of behavioural tagging.
Two kinds of strength
Robert and Elizabeth Bjork's “new theory of disuse” separates how well something is learned (storage strength) from how easy it is to get at right now (retrieval strength). Retrieval strength can fall away while storage strength stays [16].
Maxim's forgetting model stamps each trace with a storage strength at encoding, larger when the moment was painful, surprising, novel or relieving. It is built and opt-in, and its base constant is a placeholder until an experiment calibrates it. The default path still forgets by recency and access count, which rewards whatever the language model happens to read.
Forward models
To move well you have to predict a movement's result before the senses report it. Daniel Wolpert and colleagues showed people estimate where their hand is as if running an internal model of it [17], Chris Miall and Wolpert laid out what such forward models are for [18], and the cerebellum is the leading candidate for where they live [19].
Maxim's Cerebellum keeps a small predictor for each combination of entity, action and parameter range, learned from prediction error, and trains it on real readings every session. What happens next is in the gaps below.
The One That Works
The situation engram is where those ideas meet, and the one I can defend on all four counts. The test is a pool on a live Minecraft server, and the pain is the game's own: stay under long enough and the air runs out.
In training the agent is held underwater until air hunger hurts. Its twin gets the same dives and the same pain, with the wire from pain to fear cut. Then both go back in the water, with each probe capped just short of the measured moment the pain would start, so no probe hurts. The question is whether the agent leaves on its own before then.
It learns
Five seeds per arm. After training, the agent with fear surfaced before the pain on every seed (median probability 1.0, from 0.0 before), a median 3.4 seconds early; its twin never tried. Exact permutation p = 1/252 ≈ 0.004, the floor for five versus five. Fear on shore stayed at zero.
It transfers
An independent agent imported the first one's signed export and left the water on its first submersion in 12 of 12 pairs, never having felt the pain; 0 of 24 isolated agents did (Fisher p = 8.0×10−10). The same donor with fear cut shipped the situation but not the fear, and 0 of 12 receivers moved.
It follows the water
Trained in one pool and tested in another at a different height and distance from spawn, the agent left in 12 of 12 trials (95% interval 0.76–1.00); with the fear zeroed on the same node, 0 of 3 moved. An offline replay predicted the match: cosine 0.9992.
Each result has a scope, and the scope is part of the result. In the first, the clean fear-only reading is the first probe per seed; after one escape, the escape action also carries a learned positive link. The transfer result does not claim the fear can be unlearned, scales, or reaches another pool. And the cross-pool result is narrower than it sounds: the world channel there has exactly one sensor that discriminates anything, a flag for “in water,” so what transferred is indifference to where the pool is, not recognition of a different situation.
Within that scope it passes all four tests. It forms from the game's own pain. It is specific: shore fear stays at zero. It comes back when a new reading completes into the old node. And it changes what the body does, with no language model in the path and a control that keeps the representation and removes only the fear.
Where the Biology Outruns the Code
The audit behind the scorecard found five places where the design says engram and the code says something less. Each has an issue, and together they are the “engram integrity” line of the 1.4 roadmap.
Cosine sees direction, not size
A situation is a sum of per-sensor vectors, compared by cosine, and cosine ignores length. A sensor at its neutral rest contributes nothing; a sensor at an extreme contributes fully, in a new direction. So two situations separate only when some sensor swings from neutral to an extreme, or across neutral. A sensor that moves a lot on one side barely rotates the sum, at any gain. That is why “dark means danger” failed and drowning worked: distance to the nearest hostile moved substantially and the two situations still sat at cosine 0.99, while “in water” flips from silent to full weight. For now I work around it by choosing cues that swing, which is design, not learning.
The fear misses before dawn
One world sensor is time of day, encoded as a straight line from 0 to 1, so the end of the day is as far as possible from its start. Near the wrap the pool stops reading as the pool: 0.847 at 95% of the day and 0.799 at 99%, against the 0.85 threshold. The drowning fear holds through midnight and misses only in the last twentieth of the cycle, just before dawn. Every experiment ran on a frozen day, which is what hid it.
Episodes that only reach the model as text
Episodic traces form honestly: each capture declares what it measured and records the situation it happened in. A new situation cue recalls the episodes from the current situation — and the agent loop calls it and discards the result, because the consumer that would act on it is not built yet. Today an episode reaches behaviour only as a few lines in the language model's prompt. That is recall, not yet an engram changing behaviour.
Motor engrams that are built and never called
The Embodiment essay described motor engrams as if they ran: formed on pain or surprise, decaying after about two days. The formation code exists and is unit-tested; nothing in production calls it, nothing reads it, and no decay code exists. I have corrected that essay. From the outside, a mechanism with no caller and one that ran and found nothing worth remembering look identical.
A forward model thrown away every session
The Cerebellum's forward model learns live from real readings, and then the session ends and it is gone. The loader reads one path; the saver reads a setting nothing sets, so the save is a silent no-op at all three places that call it (#908). An internal guideline even cited that save call as the proof the state persisted. Nothing consumes the predictions yet, so no behaviour changes — but a forward model that starts from zero every morning is not much of a model.
What I'm Building Next
The plan adds no new mechanism; each item fixes, documents, measures or routes something that exists. The first four gate the 1.4.0 release; the last three ride on work that already owns them.
- Save the Cerebellum where it loads from, with a test that reads the saved prediction back after a real session end and turns red if the path is removed.
- Say what runs and mark what doesn't. Correct the motor-engram docs, mark every unwired function dormant, and add a test that fails when one gains a caller.
- Delete a danger label that can never print. It fires below a value the code clamps at zero.
- Measure whether reward makes text memories drift, offline, before deciding whether to fix it.
- Encode the clock as a circle. This moves the geometry every drowning result stands on, so it fires re-runs of five experiments, after an offline replay and a design review.
- Let an episodic engram act, measured with recall removed and the situation fear held identical, in a world with more than the pool's two situations.
- Resurrect or retire motor engrams. If an audit finds the forward model can predict how far away pain is, its predictions get wired into the action path. If not, the docs move to an appendix titled “designed, never wired.”
The same sentence keeps showing up in this project because it keeps being true: a mechanism that does not run looks exactly like one that ran and found nothing. An engram is the strictest case, because its job is to be absent most of the time and present on cue. A fear that never fires might be unneeded, or never wired. The only way to tell is to decide in advance what the trace doing its job would look like, then look for it in the code path that actually runs. The drowning fear is where I have done that and it held. The next release is about earning the same for the others, or saying plainly that they haven't.
References
- Semon, R. (1904). Die Mneme als erhaltendes Prinzip im Wechsel des organischen Geschehens. Leipzig: Wilhelm Engelmann. English translation: The Mneme (L. Simon, trans., 1921). London: George Allen & Unwin. archive.org/details/cu31924100387210
- Lashley, K. S. (1950). In search of the engram. Symposia of the Society for Experimental Biology, 4, 454–482.
- Liu, X., Ramirez, S., Pang, P. T., Puryear, C. B., Govindarajan, A., Deisseroth, K., & Tonegawa, S. (2012). Optogenetic stimulation of a hippocampal engram activates fear memory recall. Nature, 484, 381–385. doi.org/10.1038/nature11028
- Ramirez, S., Liu, X., Lin, P.-A., Suh, J., Pignatelli, M., Redondo, R. L., Ryan, T. J., & Tonegawa, S. (2013). Creating a false memory in the hippocampus. Science, 341, 387–391. doi.org/10.1126/science.1239073
- Josselyn, S. A., & Tonegawa, S. (2020). Memory engrams: Recalling the past and imagining the future. Science, 367, eaaw4325. doi.org/10.1126/science.aaw4325
- Marr, D. (1971). Simple memory: a theory for archicortex. Philosophical Transactions of the Royal Society B, 262, 23–81. doi.org/10.1098/rstb.1971.0078
- Treves, A., & Rolls, E. T. (1992). Computational constraints suggest the need for two distinct input systems to the hippocampal CA3 network. Hippocampus, 2, 189–199. doi.org/10.1002/hipo.450020209
- Treves, A., & Rolls, E. T. (1994). Computational analysis of the role of the hippocampus in memory. Hippocampus, 4, 374–391. doi.org/10.1002/hipo.450040319
- Han, J.-H., Kushner, S. A., Yiu, A. P., Cole, C. J., Matynia, A., Brown, R. A., Neve, R. L., Guzowski, J. F., Silva, A. J., & Josselyn, S. A. (2007). Neuronal competition and selection during memory formation. Science, 316, 457–460. doi.org/10.1126/science.1139438
- Josselyn, S. A., & Frankland, P. W. (2018). Memory allocation: mechanisms and function. Annual Review of Neuroscience, 41, 389–413. doi.org/10.1146/annurev-neuro-080317-061956
- Cai, D. J., Aharoni, D., Shuman, T., et al. (2016). A shared neural ensemble links distinct contextual memories encoded close in time. Nature, 534, 115–118. doi.org/10.1038/nature17955
- LeDoux, J. E. (2000). Emotion circuits in the brain. Annual Review of Neuroscience, 23, 155–184. doi.org/10.1146/annurev.neuro.23.1.155
- Frey, U., & Morris, R. G. M. (1997). Synaptic tagging and long-term potentiation. Nature, 385, 533–536. doi.org/10.1038/385533a0
- Moncada, D., & Viola, H. (2007). Induction of long-term memory by exposure to novelty requires protein synthesis: evidence for a behavioral tagging. Journal of Neuroscience, 27, 7476–7481. doi.org/10.1523/JNEUROSCI.1083-07.2007
- Ballarini, F., Moncada, D., Martinez, M. C., Alen, N., & Viola, H. (2009). Behavioral tagging is a general mechanism of long-term memory formation. PNAS, 106, 14599–14604. doi.org/10.1073/pnas.0907078106
- Bjork, R. A., & Bjork, E. L. (1992). A new theory of disuse and an old theory of stimulus fluctuation. In A. F. Healy, S. M. Kosslyn & R. M. Shiffrin (Eds.), From Learning Processes to Cognitive Processes: Essays in Honor of William K. Estes (Vol. 2, pp. 35–67). Hillsdale, NJ: Erlbaum.
- Wolpert, D. M., Ghahramani, Z., & Jordan, M. I. (1995). An internal model for sensorimotor integration. Science, 269, 1880–1882. doi.org/10.1126/science.7569931
- Miall, R. C., & Wolpert, D. M. (1996). Forward models for physiological motor control. Neural Networks, 9, 1265–1279. doi.org/10.1016/S0893-6080(96)00035-4
- Wolpert, D. M., Miall, R. C., & Kawato, M. (1998). Internal models in the cerebellum. Trends in Cognitive Sciences, 2, 338–347. doi.org/10.1016/S1364-6613(98)01221-2
Maxim claims above come from the project's engram-formation tracker and fix plan, the cosine-separation note, and the Exp 60, 61 and 62 rows of the evidence ledger.
Reference on pymaxim.bio
This page is the design story. Install steps, CLI flags, configuration, and the current evidence live in the docs: