恒定内存检索:固定矩阵状态中的学习关联

arXiv cs.LG 论文

摘要

Pebble ML 的一篇论文提出了一种小型 DeltaNet 变体,它通过固定的 token 级键偏置,在一个固定的 32 KiB 循环矩阵状态中,为每条序列学习 32 个键值对关联。即使面对冗长的填充上下文,该模型仍能实现 99.95% 的检索准确率;而参数量相当的向量基线和 Transformer 基线均无法学会该任务。

arXiv:2610.00232v1 Announce Type: new Abstract: Fixed-size recurrent memory limits storage growth during inference, but successful recall depends on the task and training. We study a small DeltaNet variant with fixed token-specific key biases, trained to remember 32 new key-value pairings per sequence. With 32 KiB of recurrent matrix state, it achieves 99.95% mean accuracy across three training seeds when choosing among the sequence's values. Recall remains near perfect when filler extends the pre-query context to 1,798 tokens without adding pairings. Zeroing the first memory block removes this recall. An exploratory 48-pair test remains near chance after one quarter of the primary training budget and does not locate a capacity limit. Parameter-matched vector and Transformer baselines remain near chance, including the Transformer after additional training searches. This unresolved baseline failure prevents a memory-efficiency comparison.
查看原文
查看缓存全文

缓存时间: 2026/10/03 09:51

# 1 Introduction
Source: [https://arxiv.org/html/2610.00232](https://arxiv.org/html/2610.00232)
Constant\-Memory Recall

Learned Associations in a Fixed Matrix State

Samuel Larson

Pebble MLsamlarson@pebbleml\.com

###### Abstract

Fixed\-size recurrent memory limits storage growth during inference, but successful recall depends on the task and training\. We study a small DeltaNet variant with fixed token\-specific key biases, trained to remember 32 new key–value pairings per sequence\. With 32 KiB of recurrent matrix state, it achieves 99\.95% mean accuracy across three training seeds when choosing among the sequence’s values\. Recall remains near perfect when filler extends the pre\-query context to 1,798 tokens without adding pairings\. Zeroing the first memory block removes this recall\. An exploratory 48\-pair test remains near chance after one quarter of the primary training budget and does not locate a capacity limit\. Parameter\-matched vector and Transformer baselines remain near chance, including the Transformer after additional training searches\. This unresolved baseline failure prevents a memory\-efficiency comparison\.

A Transformer’s key–value cache grows with context length\([Vaswani et al\., 2017](https://arxiv.org/html/2610.00232#bib.bib12)\); a fast\-weight model instead updates a fixed\-size memory as tokens arrive\([Schlag et al\., 2021](https://arxiv.org/html/2610.00232#bib.bib9)\)\. This can bound the memory used during inference, but retaining a fixed set of facts for longer is different from storing more facts or following a chain of associations\.

Learned associative recall with fast weights is established\([Schmidhuber, 1992](https://arxiv.org/html/2610.00232#bib.bib10);[Ba et al\., 2016](https://arxiv.org/html/2610.00232#bib.bib2);[Schlag et al\., 2021](https://arxiv.org/html/2610.00232#bib.bib9)\), including successful multi\-query recall with DeltaNet\([Yang et al\., 2024b](https://arxiv.org/html/2610.00232#bib.bib15)\)\. We examine retrieval and filler retention in one small DeltaNet variant, with an exploratory check at higher load\. State interventions and linear probes test how the learned model uses its memory\.

The comparisons use models of approximately 14 million parameters, trained from scratch on the same synthetic episodes\. The matrix model learns the primary task; the vector and Transformer baselines do not\. The vector control also has less memory and a different write operation\. Because the Transformer fails even with its full cache, the comparison cannot establish a memory\-efficiency advantage over attention\. We report the trained model’s behavior and the unsuccessful controls, without attributing their difference to matrix structure alone\.

## 2 Experimental setup

### 2\.1 Recall task and scoring

Each episode samplesK=32K=32distinct entity tokens from a GPT\-2 token pool\([Radford et al\., 2019](https://arxiv.org/html/2610.00232#bib.bib8)\)and links them in a random cycle\. Each entity is a key whose value is its successor, so keys and values share the same entity set\. Each pairing occupies seven tokens, giving a 224\-token binding sequence\. Entities and the cycle are redrawn for every episode\. A six\-token query names a key and asks for its successor\.

Scoring\.At the answer position, we take the highest\-scoring LM\-head output among the episode’sKKvalues\. This*episode\-restricted accuracy*has chance level1/K=0\.031251/K=0\.03125; the pre\-registered recall threshold is3/K=0\.093753/K=0\.09375\. It measures discrete retrieval, not full\-vocabulary generation, state rank, or exact recovery of continuous value vectors\.

### 2\.2 Models and training setup

Matrix fast\-weight model\.A two\-block decoder\-style model holds a64×6464\\times 64state per block, with the DeltaNet update\([Schlag et al\., 2021](https://arxiv.org/html/2610.00232#bib.bib9);[Yang et al\., 2024b](https://arxiv.org/html/2610.00232#bib.bib15)\)

St=St−1​\(I−βt​kt​kt⊤\)\+βt​vt​kt⊤,ot=St​qt\.S\_\{t\}=S\_\{t\-1\}\(I\-\\beta\_\{t\}k\_\{t\}k\_\{t\}^\{\\top\}\)\+\\beta\_\{t\}v\_\{t\}k\_\{t\}^\{\\top\},\\qquad o\_\{t\}=S\_\{t\}q\_\{t\}\.Keys blend their learned projections with fixed random token\-specific vectors:kt=normalize⁡\(0\.42​ktraw\+0\.58​bxt\)k\_\{t\}=\\operatorname\{normalize\}\(0\.42\\,k\_\{t\}^\{\\rm raw\}\+0\.58\\,b\_\{x\_\{t\}\}\)\. The two fp32 matrix states occupy 32,768 bytes, independent of context length\. This counts the fast\-weight matrices, excluding model weights, the fixed bias tables, convolution history, and temporary activations\. The two fixed tables occupy an additional 24\.54 MiB and are excluded from the parameter counts below\.

Vector recurrence\.The embedding table, output head, and feed\-forward blocks are unchanged\. The recurrence isst=st−1⊙gt\+vts\_\{t\}=s\_\{t\-1\}\\odot g\_\{t\}\+v\_\{t\}, with readoutot=st⊙qto\_\{t\}=s\_\{t\}\\odot q\_\{t\}and state width 64\. Mixer width is adjusted to match total parameters\. Its state occupies 512 bytes,64×64\\timesless than the matrix model, and its update lacks a key\-dependent outer product\. Thus this control changes both memory size and write operation; no memory\-matched, key\-conditioned vector control was tested\.

Transformer\.A two\-layer GPT\-2\-style causal decoder uses the same tokenizer and width\. Evaluation uses either its full KV cache or attention\-sink\-plus\-FIFO eviction\([Xiao et al\., 2023](https://arxiv.org/html/2610.00232#bib.bib13)\), with total cache limits ofM×32,768M\\times 32\{,\}768bytes forM∈\{1,2,4,8,16,32\}M\\in\\\{1,2,4,8,16,32\\\}\.

The matrix, vector, and Transformer models have 14,049,408, 14,048,384, and 14,440,448 trainable parameters, respectively, a maximum difference of 2\.8%\. The primary runs train for 20,000 steps at learning rate3×10−43\\times 10^\{\-4\}with the same optimizer, batch schedule, and episode stream, with eight query continuations per training episode\. The objective sums next\-token cross\-entropy, answer\-token cross\-entropy, and a target\-vector cosine loss weighted by 2\.0\. Paired seeds receive identical episodes\.

### 2\.3 Analysis

Three training seeds are evaluated on the same 4,096 held\-out queries over 128 episodes; query keys are sampled with replacement\. The pre\-registered primary comparison requires matrix recall above3/K3/Kand a paired\-seed 95%tt\-interval on the matrix\-minus\-vector accuracy difference whose lower bound exceeds 0\.30\. These intervals measure training\-seed variation on a fixed query set \(df=2\\mathrm\{df\}=2\), not independent variation across 4,096 samples\. Other comparisons are descriptive, with no multiple\-comparison correction\. An additional test with hidden hop counts is documented separately in Appendix[E](https://arxiv.org/html/2610.00232#A5)\. Cache limits are interpreted as a memory\-efficiency test only if the full\-cache Transformer first learns recall\.

## 3 Results

### 3\.1 Single\-step recall

Table 1:Recall of 32 pairings after 20,000 training steps, by training seed\. Accuracy is restricted to the episode’s values; chance is 0\.031 and the recall threshold is 0\.094\. The matrix model learns the task in all three seeds; both parameter\-matched baselines remain near chance\.The matrix model reaches mean accuracy 0\.9995\. Its paired advantage over the vector recurrence is 0\.9656 \(95% interval 0\.9582–0\.9729\), exceeding the primary comparison’s 0\.30 margin\. The descriptive difference against the Transformer is 0\.9712 \(0\.9685–0\.9738\)\. These are outcomes under a shared training recipe; neither baseline learns recall despite falling training loss \(Appendix[C](https://arxiv.org/html/2610.00232#A3)\)\.

A separate Transformer search tested eleven configurations with three seeds each, varying capacity, learning rate, and training length up to 44\.6 million parameters and 60,000 steps\. No evaluated seed exceeded the recall threshold; configuration means ranged from 0\.0283 to 0\.0346\. Appendix[D](https://arxiv.org/html/2610.00232#A4)gives the full search design\. The cause of this failure remains unresolved, and the search does not exhaust possible training recipes\.

### 3\.2 Recall over longer sequences

Figure 1:Recall after extending the pre\-query context with filler, keeping 32 pairings fixed\. Panel \(a\) shows the full accuracy range; \(b\) enlarges the baseline scores\. The matrix model retains accuracy≥0\.998\\geq 0\.998with 32 KiB of matrix state across three seeds\. Full\-cache \(dashed\) and capped\-cache \(crosses,M∈\{2,4,8,16,32\}M\\in\\\{2,4,8,16,32\\\}\) Transformers remain near chance\. Reference lines mark the recall threshold and chance\. The protocol excludesM=1M=1from this plot; its scores are reported in Table[3](https://arxiv.org/html/2610.00232#A1.T3)\.We evaluate frozen checkpoints with pre\-query contexts of 454, 902, and 1,798 tokens, appending repeated buffer tokens after the 224\-token binding sequence\. The six query tokens follow this context\. No new pairings are added\. The matrix model scores 0\.9995, 0\.9983, and 0\.9990 by seed at every tested length, using the same 32,768\-byte state\. Transformer scores remain near chance with either a full or capped cache \(Figure[1](https://arxiv.org/html/2610.00232#S3.F1); Appendix Table[3](https://arxiv.org/html/2610.00232#A1.T3)\)\. These tests show retention through filler, not resistance to new interfering associations or an advantage over a successful attention baseline\.

### 3\.3 State interventions and readout probes

Figure 2:Zeroing a memory block before the query, using 4,096 fixed queries per seed\. RemovingS0S\_\{0\}reduces matrix\-model accuracy below the 0\.094 recall threshold; removingS1S\_\{1\}leaves it nearly unchanged\. Chance is1/321/32\. Seed markers are offset vertically for readability\.Zeroing the first block’s stateS0S\_\{0\}after the binding sequence reduces accuracy to 0\.0339, 0\.0012, and 0\.0002 across seeds\. ZeroingS1S\_\{1\}gives 0\.9995, 0\.9949, and 0\.9990, with 21 fewer correct answers out of 4,096 in seed 1\. The query is evaluated from the saved matrix states and new query tokens, without replaying the binding sequence\.

Ridge probes fitted on 24,576 fresh examples fail to recover target value vectors from any tested raw\-state/query readout above cosine 0\.9\. For the matrix model’s hidden state before the LM head, the probe reaches mean cosine 0\.894 and threshold pass fraction 0\.674 on a separate 20,000\-step seed\-0 calibration checkpoint \(Appendix Table[4](https://arxiv.org/html/2610.00232#A2.T4)\)\. Regularization was selected on the same evaluation set, so these are descriptive results\. Failure of these probes establishes neither that all linear readouts fail nor that storage itself is nonlinear\.

### 3\.4 Exploratory higher\-load test

Table 2:Recall with 48 pairings: one 5,000\-step run per model, versus 20,000 steps for the primary 32\-pair comparison\. All scores are near chance \(0\.021\)\. The shorter training budget prevents attributing the failure to memory load alone\.The 48\-pair check uses the same state width but only one quarter of the primary training budget\. Its near\-chance scores \(Table[2](https://arxiv.org/html/2610.00232#S3.T2)\) therefore establish neither a capacity boundary nor failure at a matched training budget\.

## 4 Related work

Fast\-weight memory has long been used for temporary associations\([Schmidhuber, 1992](https://arxiv.org/html/2610.00232#bib.bib10);[Ba et al\., 2016](https://arxiv.org/html/2610.00232#bib.bib2)\)\.[Schlag et al\. \(2021\)](https://arxiv.org/html/2610.00232#bib.bib9)connect it to linear attention\([Katharopoulos et al\., 2020](https://arxiv.org/html/2610.00232#bib.bib4)\), introduce the delta\-rule update, and test retrieval, overwriting, and memory load\. DeltaNet subsequently achieved perfect accuracy on its hardest tested multi\-query recall setting\([Yang et al\., 2024b](https://arxiv.org/html/2610.00232#bib.bib15)\)\. Gated DeltaNet distinguishes repeated filler from interfering natural text\([Yang et al\., 2024a](https://arxiv.org/html/2610.00232#bib.bib14)\)\. These establish the mechanism and recall capability studied here\.

Zoology\([Arora et al\., 2023](https://arxiv.org/html/2610.00232#bib.bib1)\)finds attention stronger than the recurrent alternatives it tests;[Okpekpe & Orvieto \(2025\)](https://arxiv.org/html/2610.00232#bib.bib6)show that optimization and model dimensions affect recall comparisons\. Our terminal query and restricted candidate set differ from multi\-query recall\. Comparisons that match both parameters and recurrent\-state size\([Hatamizadeh et al\., 2026](https://arxiv.org/html/2610.00232#bib.bib3)\)also control a confound present in our vector baseline\. Vector representations can support key\-dependent binding\([Plate, 1995](https://arxiv.org/html/2610.00232#bib.bib7);[Smolensky, 1990](https://arxiv.org/html/2610.00232#bib.bib11)\); our elementwise control does not test those alternatives\.

Cache\-reduction methods\([Xiao et al\., 2023](https://arxiv.org/html/2610.00232#bib.bib13);[Zhang et al\., 2023](https://arxiv.org/html/2610.00232#bib.bib16)\)ask how much cache preserves a working model’s behavior\. Our unsuccessful full\-cache baseline prevents that comparison\. Capacity results for associations stored in trained parameters\([Nichani et al\., 2025](https://arxiv.org/html/2610.00232#bib.bib5)\)address a different setting from fresh pairings stored in recurrent state\.

## 5 Limitations

These experiments test one small fast\-weight architecture trained from scratch on synthetic episodes\. They do not establish performance on pretrained models, natural text, or deployment\-length contexts\. Longer sequences contain filler rather than new bindings\. Only three training seeds and one fixed query set support the primary result\. The higher\-load check has a shorter training budget, and a separate hidden\-hop test cannot measure multi\-hop ability \(Appendix[E](https://arxiv.org/html/2610.00232#A5)\)\. The failed Transformer and smaller\-memory vector control prevent an architectural\-efficiency claim\. Independently tuned baselines and a memory\-matched vector control would be needed to explain the observed difference\.

## 6 Conclusion

A small DeltaNet variant learns to retrieve 32 new pairings from a fixed 32 KiB matrix state and retains them through the tested filler sequences\. Its first memory block is necessary for recall\. The experiments do not establish how this result extends to higher loads, queries with specified hop counts, or natural text\. These results document this operating point and its limits; they establish neither a general capacity law nor a memory\-efficiency advantage over attention\.

## References

- Arora et al\. \(2023\)Simran Arora, Sabri Eyuboglu, Aman Timalsina, Isys Johnson, Michael Poli, James Zou, Atri Rudra, and Christopher Ré\.Zoology: Measuring and improving recall in efficient language models\.*arXiv preprint arXiv:2312\.04927*, 2023\.
- Ba et al\. \(2016\)Jimmy Ba, Geoffrey Hinton, Volodymyr Mnih, Joel Z\. Leibo, and Catalin Ionescu\.Using fast weights to attend to the recent past\.*arXiv preprint arXiv:1610\.06258*, 2016\.
- Hatamizadeh et al\. \(2026\)Ali Hatamizadeh, Yejin Choi, and Jan Kautz\.Gated DeltaNet\-2: Decoupling erase and write in linear attention\.*arXiv preprint arXiv:2605\.22791*, 2026\.
- Katharopoulos et al\. \(2020\)Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and François Fleuret\.Transformers are RNNs: Fast autoregressive transformers with linear attention\.*arXiv preprint arXiv:2006\.16236*, 2020\.
- Nichani et al\. \(2025\)Eshaan Nichani, Jason D\. Lee, and Alberto Bietti\.Understanding factual recall in transformers via associative memories\.In*International Conference on Learning Representations \(ICLR\)*, 2025\.
- Okpekpe & Orvieto \(2025\)Destiny Okpekpe and Antonio Orvieto\.Revisiting associative recall in modern recurrent models\.*arXiv preprint arXiv:2508\.19029*, 2025\.
- Plate \(1995\)Tony A\. Plate\.Holographic reduced representations\.*IEEE Transactions on Neural Networks*, 6\(3\):623–641, 1995\.doi:10\.1109/72\.377968\.
- Radford et al\. \(2019\)Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever\.Language models are unsupervised multitask learners\.Technical report, OpenAI, 2019\.
- Schlag et al\. \(2021\)Imanol Schlag, Kazuki Irie, and Jürgen Schmidhuber\.Linear transformers are secretly fast weight programmers\.*arXiv preprint arXiv:2102\.11174*, 2021\.
- Schmidhuber \(1992\)Jürgen Schmidhuber\.Learning to control fast\-weight memories: An alternative to dynamic recurrent networks\.*Neural Computation*, 4\(1\):131–139, 1992\.doi:10\.1162/neco\.1992\.4\.1\.131\.
- Smolensky \(1990\)Paul Smolensky\.Tensor product variable binding and the representation of symbolic structures in connectionist systems\.*Artificial Intelligence*, 46\(1\-2\):159–216, 1990\.doi:10\.1016/0004\-3702\(90\)90007\-M\.
- Vaswani et al\. \(2017\)Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N\. Gomez, Lukasz Kaiser, and Illia Polosukhin\.Attention is all you need\.*arXiv preprint arXiv:1706\.03762*, 2017\.
- Xiao et al\. \(2023\)Guangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han, and Mike Lewis\.Efficient streaming language models with attention sinks\.*arXiv preprint arXiv:2309\.17453*, 2023\.
- Yang et al\. \(2024a\)Songlin Yang, Jan Kautz, and Ali Hatamizadeh\.Gated delta networks: Improving Mamba2 with delta rule\.*arXiv preprint arXiv:2412\.06464*, 2024a\.
- Yang et al\. \(2024b\)Songlin Yang, Bailin Wang, Yu Zhang, Yikang Shen, and Yoon Kim\.Parallelizing linear transformers with the delta rule over sequence length\.*arXiv preprint arXiv:2406\.06484*, 2024b\.
- Zhang et al\. \(2023\)Zhenyu Zhang, Ying Sheng, Tianyi Zhou, Tianlong Chen, Lianmin Zheng, Ruisi Cai, Zhao Song, Yuandong Tian, Christopher Ré, Clark Barrett, Zhangyang Wang, and Beidi Chen\.H2o: Heavy\-hitter oracle for efficient generative inference of large language models\.*arXiv preprint arXiv:2306\.14048*, 2023\.

## Appendix ARecall across cache sizes

Table 3:Mean recall across three seeds at pre\-query context lengthsTT\. The matrix state is fixed at 32,768 bytes; Transformer cache caps areMMtimes that size\. Chance is 0\.031 and the recall threshold is 0\.094\. The protocol excluded theM=1M=1eight\-token cap because it is below the registered floor of 13 tokens \(query plus one binding clause\)\. Its descriptive scores, 0\.021–0\.030, are also near chance\.
## Appendix BLinear readout results

Table 4:Ridge\-probe recovery of target value vectors on separate 20,000\-step seed\-0 calibration checkpoints\. Probes fit 24,576 examples and evaluate 4,096 queries; regularization was selected on that evaluation set\. “rf@0\.9” is the fraction above cosine 0\.9; “gap” subtracts a shuffled\-fit control\. Only the matrix model’s pre\-LM\-head hidden state supports substantial recovery\. These are descriptive probe results\.“Shallow query” applies the second block’s query pathway to query\-token embeddings\. “Bind\-path query” uses the first block’s pathway\. “True query” is the second block’s query during full continuation\. Across the three primary training seeds, pre\-LM\-head probe pass fractions are 0\.686, 0\.771, and 0\.951\.

## Appendix CTraining loss

Figure 3:Training loss for the primary task, seed 0\. After 20,000 steps, loss is 1\.38 for the matrix model, 7\.69 for the vector recurrence, and 7\.51 for the Transformer\. The baselines’ decreasing loss does not produce recall\. These runs use the shared settings of Section[2](https://arxiv.org/html/2610.00232#S2)\.
## Appendix DTransformer search and reproducibility

The Transformer search considers two layers at width 256 \(14,440,448 parameters\), four at width 256 \(16,014,336\), and six at width 512 with eight heads \(44,613,632\)\. Learning rates are10−310^\{\-3\}and3×10−43\\times 10^\{\-4\}; training lengths are 20,000 and 60,000 steps\. Eleven configurations have three seeds each: 27 new runs and six reused runs\. The six\-layer,3×10−43\\times 10^\{\-4\}, 60,000\-step configuration was not run under the registered stopping rule\. No evaluated seed exceeds the 0\.09375 recall threshold\.

The figure script reads archived evaluation artifacts and verifies their checksums\. The accompanying evidence map records input paths and maps reported measurements to their source artifacts\.

## Appendix EDiagnostic with an unspecified hop count

An additional experiment selects targets one or two steps along the episode’s cycle without telling the model which\. The archived code uses hop count to select the target but omits it from the input\. These ambiguous\-target results \(Table[5](https://arxiv.org/html/2610.00232#A5.T5)\) cannot establish either multi\-hop capability or a failure to learn it\.

Table 5:Recorded accuracy under ambiguous hop supervision, nine seeds per model\. Bold values exceed the original 0\.094 threshold\. The numbers are retained for documentation; crossing that threshold is not evidence of following a requested hop count, which was absent from the input\.

相似文章

Δ-Mem:大型语言模型的高效在线记忆

Hacker News Top

提出 delta-Mem,一种轻量级在线记忆机制,利用紧凑状态矩阵并通过增量规则学习进行更新,以提升冻结大型语言模型的长上下文性能,无需全量微调或上下文扩展。

基于门控关联检索的通用三重潜在压缩

arXiv cs.CL

本文介绍了通用三重潜在循环模型,该模型将令牌对交互压缩为潜在状态,并提出一种改进精确召回的门控关联检索变体。该混合模型在字节级WikiText-2和分词语言基准上优于Transformer,实现了高达41.9%的关联召回率(对比25%)。

变分线性注意力:用于长上下文 Transformer 的稳定联想记忆

arXiv cs.LG

本文介绍了变分线性注意力(VLA),这是一种用于稳定长上下文 Transformer 中线性注意力机制记忆状态的方法。VLA 将记忆更新重构为在线正则化最小二乘问题,证明了状态范数的有界性,并展示了相较于标准线性注意力和 DeltaNet 显著的速度提升以及更高的检索准确性。

多头循环记忆代理

arXiv cs.LG

本文指出记忆保留是长上下文场景下循环记忆代理的瓶颈,并提出多头循环记忆(MHM),这是一种无需训练的框架,通过“先选择后更新”策略将记忆划分为独立的头。轻量级实例化版本 MHM-LRU 显著提升了 100K 至 1M token 范围内的记忆保留率和端到端准确率,在 896K token 的 RULER-HQA 上,将记忆保留率从低于 30% 提升至 73.96%。