Linear Transformers Are Secretly Fast Weight Programmers
Citation. Imanol Schlag, Kazuki Irie and Jürgen Schmidhuber, all at the Swiss AI Lab IDSIA, USI and SUPSI. Schlag and Irie are equal contributors. "Linear Transformers Are Secretly Fast Weight Programmers". Proceedings of the 38th International Conference on Machine Learning (ICML 2021), PMLR 139. arXiv 2102.11174: v1 22 February 2021, v3 9 June 2021. Paper. The paper gives its code at github.com/ischlag/fast-weight-transformers. We did not open that repository. An ERC Advanced grant (742870, AlgoRNN) and a Swiss National Science Foundation grant (200021 192356, NEUSYM) funded part of the work. NVIDIA and IBM donated machines. The paper gives no statement about tools or help from an LLM. The venue on the PDF and the arXiv dates agree.
Status. Planned. #4782 would use it in its strand on weight-space programming and fast weights, and #5144 asks the question that it bears on most. No code, skill or protocol in this repo depends on it. The maintainer designs any campaign to fix a model, so this page reports evidence and records questions only.
Read. We read the arXiv v3 PDF on 2026-11-19. We extracted its text with pdftotext and read all of it: Sections 1 to 7, Tables 1 to 6, Listing 1 and Appendices A to F. The model that wrote this page read the text itself, with no subagent. We did not see the figures as images. So the results of Figures 2 to 5 are here only as the body text and the captions give them. Some equations came out of the extraction with their layout broken. We read them against the text around them. We did not read v1 or v2.
Summary
Claim. Self-attention without a softmax, or with a kernel in place of the softmax, is a fast weight programmer of the early 1990s. It writes a weight matrix as a sum of outer products of values and keys, and it reads that matrix with the query. A finite matrix can hold only as many associations as its key dimension without crosstalk. So the authors replace the purely additive write with a write like the delta rule, which can change a stored association. They also propose a new kernel feature map, DPFP.
Method.
- The equivalence (Section 3). Remove the softmax, and output i is W⁽ⁱ⁾q⁽ⁱ⁾, with W⁽ⁱ⁾ = W⁽ⁱ⁻¹⁾ + v⁽ⁱ⁾ ⊗ k⁽ⁱ⁾. With a kernel φ, the write is v ⊗ φ(k) and the read is W φ(q), divided by a normaliser z · φ(q). Training sets the slow weights W_k, W_v and W_q. The sequence builds the fast weight W⁽ⁱ⁾ at each step. The paper says that the two forms are equal "apart from normalisation".
- Capacity (Section 4.1). The read is a matrix product. If the keys are not orthogonal, a query returns a mix of values. In a space of dimension d_dot, at most d_dot keys can be orthogonal. So a sequence longer than d_dot can put the model in an "overcapacity regime". The authors link this to the crosstalk results for tensor product representations (Smolensky 1990).
- The delta update (Section 4.2). The model reads the value v̄ that the memory now holds for the key k. Then it writes W⁽ⁱ⁾ = W⁽ⁱ⁻¹⁾ + β⁽ⁱ⁾(v⁽ⁱ⁾ − v̄⁽ⁱ⁾) ⊗ φ(k⁽ⁱ⁾). The write strength β is a sigmoid of the input, so the model learns its own learning rate at each step. The model divides keys and queries by the sum of their components ("sum normalisation").
- The comparison with a gated update (Appendix B). Peng et al. (2021) write W' = (1 − β)W + βv ⊗ φ(k). With two orthonormal keys k₁ and k₂, a new write to k₂ scales the value of k₁ by (1 − β). The delta update leaves the value of k₁ unchanged.
- Kernels (Section 5). Three feature maps: elu + 1 (Katharopoulos et al. 2020), FAVOR+ with m random features (Choromanski et al. 2021) and the new DPFP. DPFP multiplies pairs of rectified components, so that different input regions map to orthogonal outputs. Its dimension is 2·d_key·ν.
- Tasks.
- A synthetic lookup task: a sequence of random key–value pairs, then a query, scored by squared error. Setting 1 has d_key = 64 and 20 to 600 unique keys. Setting 2 samples keys with replacement, so a key can take a new value.
- WMT14 English to German translation with the "big" Transformer, about 4 days on three V100 GPUs per model, with no tuning for each model.
- WikiText-103 word-level language modelling with 16 layers and 8 heads. The small form has D = 128 and context 256 (40 M parameters). The medium form has D = 256 and context 384 (90 M parameters). The authors say that both forms are in overcapacity.
- Metrics. Final loss for the synthetic tasks, BLEU for translation and perplexity for language modelling.
Findings, as the source reports them.
| Setting | Result |
|---|---|
| Setting 1, d_key = 64, sum update (Figure 2, from the text) | Linear attention "begins to accumulate errors with 60 or more associations". DPFP-1, 2 and 3 fail as they come near 128, 256 and 384. FAVOR+ fails to reach a loss of 0 in any run. Softmax does best, but "struggles to fully converge with more than 500 keys" |
| Setting 2, length 40, 20 keys (Figure 3, from the text) | The delta update "outperforms all other variants". The sum update fails. Appendix D.2 says the same for 20 to 200 keys |
| WMT14 BLEU, valid and test, d_dot = 64 (Table 1) | Standard 26.6 and 27.7. Linear 25.5 and 26.8. Performer 24.2 and 24.4 |
| WMT14 BLEU, d_dot = 256 | Performer 24.9 and 25.3. DPFP 26.2 and 26.9 |
| WMT14 BLEU, d_dot = 512 | Performer 26.7 and 27.7. DPFP 26.2 and 27.1 |
| WikiText-103 small, valid and test perplexity (Table 2) | Transformer 33.0 and 34.1. Linear, sum 37.1 and 38.3. Linear, delta 34.1 and 35.5. Performer, sum 39.0 and 39.6. Performer, delta 36.1 and 37.2 |
| WikiText-103 medium (Table 2) | Transformer 27.9 and 29.6. Linear, sum 31.1 and 33.0. Linear, delta 29.7 and 31.5. Performer, sum 32.2 and 33.8. Performer, delta 30.0 and 31.8 |
| Delta network, medium, ablation of position encoding and attention normalisation (Table 3) | Both on: 30.4 and 32.1. Neither: 28.1 and 31.1 |
| Context not cut, medium, state 0.13 M (Table 4) | Linear above 260 and above 260. Delta network 27.8 and 29.4. Transformer-XL 65.7 and 65.5 |
| Transformer-XL, larger states (Table 4) | 1.05 M: 29.3 and 30.1. 2.10 M: 26.4 and 27.4. 6.29 M: 24.6 and 25.5 |
| Linear, context not cut, no attention normalisation | Perplexity above 1,600 |
| Small model, d_dot = 256, not in overcapacity (Table 5) | Performer, sum 38.0 and 38.8, delta 36.0 and 37.0. DPFP, sum 37.7 and 38.8, delta 33.9 and 35.0 |
| Speed and memory, small model | Linear with the delta update 63 K words/s and 14 GB. Without it, 66 K and 13 GB. The PyTorch Transformer 33 K and 17 GB |
Where the claims go beyond the evidence
- The capacity argument has no test on language. The capacity limit shows only in the synthetic task. Appendix D.3 says that language modelling "might be less affected by the capacity issue". Doubling d_dot "was not beneficial" there. The delta update also helps in Table 5, where the model is not in overcapacity. So the language results show that the delta update helps, but not that capacity is the reason.
- The guarantee of Appendix B needs orthonormal keys. The delta update leaves k₁'s value alone only because k₁ and k₃ are orthogonal. With keys that overlap, the case that Section 4.1 motivates, a write changes other values in proportion to the overlap. The paper does not analyse that case.
- One run per cell, with no spread. No table gives seeds, intervals or repeats. Some gaps are small, for example 31.5 against 31.1 test perplexity in Table 3, or 26.8 against 27.1 BLEU in Table 1.
- The Table 4 baseline at equal state is not a fair fight. Transformer-XL trained with memory and target lengths of 384. The 0.13 M row runs it with a memory of 15 and a target of 1, a setting that it never trained on. The delta network trained with its state carried across segments.
- The state-size formula disagrees with the table. Appendix F says that the Transformer-XL state is memory length × target length × 512 for each layer. The reported sizes match the sum of the two lengths. For example, (64 + 64) × 512 × 16 layers = 1,048,576, which is the 1.05 M in Table 4. The product would give 33.5 M.
- The delta network does not reach softmax. In Table 2 the softmax Transformer stays better in both forms, for example 29.6 against 31.5 test perplexity for the medium form. The title's equivalence also covers linear attention only. The paper calls the softmax memory one that "stores immutable pairs" and grows with the sequence.
- No interpretability content. The paper reads no fast weight matrix and explains no unit. Its claims are about memory capacity and update rules, measured by loss.
The authors state several limits themselves. They say that the delta network does not match Transformer-XL with a large state, and that softmax beats every kernel in Setting 1. They report the negative results for a larger d_dot and the failure of FAVOR+ with their update.
Use in this repo
- It answers the question that
fast-weight-memories.mdleft open, and the answer is "only for linear attention". That page asks whether attention is a fast weight in Schmidhuber's sense. This paper shows it for linear attention, as an equality of the two forms. The four configured models (pyproject.toml) use softmax attention. The paper treats softmax as a memory of all past keys and values that grows with the text, not as a finite matrix. In both cases, activations write the fast weight during a forward pass. - So the paper supports the ceiling that #5144 asks to count. The slow weights W_k, W_v and W_q are all that a weight-only reading can see. Which associations the head holds at token i depends on the text before i.
fast-weights-recent-past.mdgives the same argument for RNNs. This paper extends it to attention. A weight-only check, such as ROTATE (#3446), can test a token-set rule but not a rule that needs context. That is an inference from the paper's equations, not a result that the paper measures. - The repo's evidence agrees with the limit.
docs/analyses/weight-kurtosis.mdtests ROTATE's weight-only kurtosis on 518 test poles. It does not predict VERIFIED, and every interval includes 0.5.docs/analyses/copy-suppression-l4h1.mdfinds that Pythia-70m's L4/H1 scores 42.0% on the OV test from weights. On ordinary text, copy suppression explains only 1.8% of the head's effect. A weight reading can suggest an explanation. The verdict still needs forward passes. - The MLP has the same key–value form, with weights that stay fixed. In
ffn-key-value-memories.md, a neuron's input weights are a key and its output weights a value. That is the slow-weight form of the paper's Equation 9, with a nonlinearity between the read and the write. Training writes these weights, not the text. So the paper's argument against a weight-only reading applies to attention, not to an MLP neuron's token-set rule. - The capacity argument is the interference question of #4782 in a small space. With more associations than dimensions, keys overlap, and a read returns a mix of values.
toy-models-of-superposition.mddescribes the same geometry for features in one layer. The superposition entity inopeninterpretability/explain_groups.pyis a direction over many neurons, which is that case in the repo. The paper measures crosstalk only in a synthetic task, so it gives no number for a trained language model. - Appendix B is evidence on edits, not a plan for a fix. A write of (v − v̄) along a key leaves orthogonal keys alone. A gated write scales every stored value. This is the condition that a narrow edit needs.
fast-model-editing.mdreviews an editor whose updates have rank 1, so the same condition applies to it. With overlapping keys, the guarantee fails, as noted above. The maintainer designs the campaign to fix models (#4784), so we record this as evidence only. - Weight-space programming (#3381, #4471). Here gradient descent trains a slow net that writes weights at run time, and nobody reads the written weights. #4471 has an agent write weights as code, to be read. The paper's DPFP map is a hand-designed feature map that makes keys orthogonal by giving each input region its own component. That is a readable, sparse code of the kind that #4471's hand-programmed blocks would need. The paper does not test whether anyone can read it.
- A model with these layers is a possible case, but not now. The paper names its model the "Delta Network".
models-rewrite-own-weights.mdreports that Qwen3.5 mixes Gated DeltaNet linear attention with full attention. #3331 proposes a Qwen3.5-0.8B fine-tune. The name matches, but we did not read the Gated DeltaNet paper to check the line of descent. In such a layer, the head harness (openinterpretability/harness/heads.py) would find no N×N attention pattern. The registry adds no new model before every model meets its coverage target, so this is not work for now. - No single-neuron content. The paper gives no unit explanations, no probes and no null. Nothing in it bears on any pole's verdict.
- No new follow-up. #5144 already asks for the count that this paper's argument bears on. The paper is evidence for that issue, not a reason for a new one.
- Question for the maintainer. Could a weight-only reading ever contest a token-set claim with no forward pass? That would change the decision rule, so it would need a
PROTOCOL_VERSIONbump (docs/PROTOCOL.md§6). We record it as a question only.