DeltaNet-PC: Test-Time Memory Without Backpropagation Through Time
Organizations: Computer Science, Columbia University New York, NY, USA
Abstract
Test-time memorization of sequential information is a foundational capability for any intelligent system that needs to rapidly store and retrieve data, as demonstrated by the attention mechanism in large language models. However, Transformers and linear attention variants are trained via backpropagation through time (BPTT), which has drawbacks such as its enormous memory requirements. Predictive coding (PC), an algorithm that optimizes a prediction-error energy function with local updates, offers a compelling solution but still lacks test-time memory for sequential data. We develop a solution to this problem by treating the per-step memory update as a latent variable, as opposed to a slow weight to be learned. By taking the log probability of a standard PC-based probabilistic model, we derive a PC-native solution for verbatim sequence memory, and relate our update rule to common choices in the linear attention literature (e.g., DeltaNet). We present an extensive set of empirical tests to probe our system's properties, including its scaling capacity, memory footprint, and ability to infer a context from evidence (e.g., bank (river) vs. bank (money)). We show how DeltaNet-PC can be used for storing single sequences of data, multiple sequences of data, and key-value associative memory pairs with perfect recall accuracy.
Figures & tables
| Training | Inference | Local | Local | Sequential | Trained | Test-time | ||
| Model | Write rule | memory | memory | in space | in time | data | keys, values | write |
| Transformer ( Vaswani et al., 2017 ) | append (KV cache) | ✓ | ✓ | ✓ | ||||
| Linear attention ( Katharopoulos et al., 2020 ) | outer product | ✓ | ✓ | ✓ | ||||
| DeltaNet ( Schlag et al., 2021 ; Yang et al., 2024b ) | delta rule (LMS/NLMS) | ✓ | ✓ | ✓ | ||||
| Mesa layer ( von Oswald et al., 2024 ; von Oswald et al., 2026 ) | RLS | ✓ | ✓ | ✓ | ||||
| Lin. assoc. memory ( Kohonen, 1972 ; Kohonen, 1974 ) | outer product / RLS | – | ✓ | – | ✓ |
| Write rule | Untrained | Trained |
|---|---|---|
| Outer product, ( Kohonen, 1972 ; Katharopoulos et al., 2020 ) | 0.13 0.00 | 0.66 0.03 |
| Delta rule (NLMS), ( Widrow & Hoff, 1960 ; Schlag et al., 2021 ) | 0.13 0.00 | 0.26 0.01 |
| Recursive least squares, Equation 7 ( Kohonen, 1974 ; von Oswald et al., 2024 ) | 0.29 0.01 | 1.00 0.00 |
| MQAR | Local in | Peak training memory at | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Model | Test acc. | Streams a | time | space | Params | State b | 512 | 65k | 131k |
| DeltaNet | 1.000 | 1,024 | 0.53 M c | 65 k | 0.7 GB | 55 GB | OOM | ||
| DeltaNet-PC (ours) | 1.000 | ✓ | ✓ | 0.20 M | 131 k | 0.25 GB | 0.25 GB | 0.25 GB | |
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
| Task | Event stream | Test scoring |
|---|---|---|
| Sequential recall | Observations and queries alternate: after each observation the learner poses its own query , to retrieve what was just written at its own position, against the memory as it stands. observations and queries per stream; online learning. | Ground truth compared to prediction decoded from for , the final memory frozen. |
| Official MQAR | The context observations (64 pairs), then the query section: at each labelled position the task’s query , the query key and its value, precedes the observation that writes the filler . Every position is written. | Ground truth compared to prediction decoded from for each containing a query. |
| Omniglot binding | Stream of observations, then the task’s queries: all queries have the form meaning they are queries at the final position . | Ground truth compared to prediction decoded from . |
| Task | Observation | , | Train / Val. / Test | Scored units per test set | ||
|---|---|---|---|---|---|---|
| Single-episode sequences | token | 256 | to at , at to , | 10 tokens | / / | relay tokens |
| Multi-episode sequences | token | 256 | ( ), | 10 tokens | / / | relay tokens |
| MQAR ( Arora et al., 2024 ) | token | 256 | , | tokens ( keys, values) | (or ) / / | labelled positions |
| Omniglot-MNIST binding | image | 784 | ( pairs), | 10 digits | / / | probes |
| Untrained | Trained (decoder) | |||
|---|---|---|---|---|
| Clean-up | Decoder | streams | streams | |
| RoPE off | ||||
| RoPE on | ||||
| Symbol | Name | Value | Description |
| Task | |||
| Sequence length | 256 | Positions per sequence (swept in Figure 3 ). | |
| Vocabulary size | 10 | Distinct tokens, each a fixed Gaussian code of dimension . 8,192 for MQAR. | |
| Observation dimension | 256 | Codebook row dimension (images: pixel count). | |
| Training sequences | 1024 | Unique training sequences. | |
| Test sequences | 128 | Held-out sequences. The validation split is the same size. | |
| Sequential | Multi-episode | MQAR | Omniglot | |
|---|---|---|---|---|
| Full recipe | ||||
| No activity clip | ||||
| No value orthogonality ( ) | ||||
| NLMS write (no interference term) | ||||
| Frozen RoPE | – |
| DeltaNet-PC | DeltaNet | |
|---|---|---|
| Training, operations | , GFLOP | , GFLOP |
| Test, operations | , ( ) GFLOP | , GFLOP |
| Training, time | ms | ms |
| Test, time | ( – ) ms | ms |
| To exact recall | observed streams, TFLOP, s | observed streams, PFLOP, s |
Neural Network Memorization
Neural network memorization studies how models store and retrieve training examples, how this differs from generalization, and how memory can be measured or controlled.
See all 64 papers