How Experience Becomes a Program: Episodic Memory as a Difference Engine

A child who has seen a few sums can add numbers of any length: finite experience has become a program, a procedure with memory that holds for inputs of every size. Networks learn procedures by passing errors backward through every step of a computation, over many examples, and what they learn on short inputs seldom holds on long ones. Brains keep something networks discard, the experiences themselves, and we propose that they keep them in order to compare them. When two remembered experiences differ in one place, the first answer at which they differ depended on that place. This method of difference finds the cause of an answer in one step, however long the computation in between, and finds causes that act jointly, each of which alone is invisible to statistics. We show that such comparisons write programs. Comparing an experience with one that differs in a single symbol shows what each answer depends on; in a memory that recalls the past by counting events, each dependence is a linear equation, and the stack, the queue and the counter of computer science are solutions of such equations. Comparing what follows two beginnings shows which states a program must keep, and comparing a question with the question one symbol shorter builds each answer from the one before. Where experience does not decide, nothing is guessed: the learner asks, or says that it does not know. A machine built on these principles, with no backpropagation and no search over programs, writes exact programs for thirteen of the fifteen tasks of a standard benchmark, each in under a minute, from a few hundred short strings and, for two of the tasks, questions of its own; eleven of the programs hold at a million symbols. It learns tasks withheld from its design, builds multiplication from its own addition, and in 5,680 runs announces no false program. The hippocampus has the form of such a difference engine: it stores whole episodes after one exposure, keeps similar ones apart, recalls a neighbour of the present and compares the two. In simulated circuits of neurons the programs run exactly, a replayed sweep finds where two episodes differ, and a local rule learns the gains with no backward pass. On this account, episodic memory is the brain's means of assigning credit by comparison.

Authors

Institutions

Publication Details

Journal
bioRxiv (Cold Spring Harbor Laboratory)
Published
2026-11-25
DOI
https://doi.org/10.64898/2026.11.16.767088
Primary Topic
Cognitive Computing and Networks
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

How Experience Becomes a Program: Episodic Memory as a Difference Engine

Yuhang He, SI WU
1 links
bioRxiv (Cold Spring Harbor Laboratory)
Cognitive Computing and Networks
preprint

How Experience Becomes a Program: Episodic Memory as a Difference Engine

Yuhang He, SI WU
preprint en

Abstract

A child who has seen a few sums can add numbers of any length: finite experience has become a program, a procedure with memory that holds for inputs of every size. Networks learn procedures by passing errors backward through every step of a computation, over many examples, and what they learn on short inputs seldom holds on long ones. Brains keep something networks discard, the experiences themselves, and we propose that they keep them in order to compare them. When two remembered experiences differ in one place, the first answer at which they differ depended on that place. This method of difference finds the cause of an answer in one step, however long the computation in between, and finds causes that act jointly, each of which alone is invisible to statistics. We show that such comparisons write programs. Comparing an experience with one that differs in a single symbol shows what each answer depends on; in a memory that recalls the past by counting events, each dependence is a linear equation, and the stack, the queue and the counter of computer science are solutions of such equations. Comparing what follows two beginnings shows which states a program must keep, and comparing a question with the question one symbol shorter builds each answer from the one before. Where experience does not decide, nothing is guessed: the learner asks, or says that it does not know. A machine built on these principles, with no backpropagation and no search over programs, writes exact programs for thirteen of the fifteen tasks of a standard benchmark, each in under a minute, from a few hundred short strings and, for two of the tasks, questions of its own; eleven of the programs hold at a million symbols. It learns tasks withheld from its design, builds multiplication from its own addition, and in 5,680 runs announces no false program. The hippocampus has the form of such a difference engine: it stores whole episodes after one exposure, keeps similar ones apart, recalls a neighbour of the present and compares the two. In simulated circuits of neurons the programs run exactly, a replayed sweep finds where two episodes differ, and a local rule learns the gains with no backward pass. On this account, episodic memory is the brain's means of assigning credit by comparison.

bioRxiv (Cold Spring Harbor Laboratory)
Peking University (CN)
Cognitive Computing and Networks
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon