Open Interpretability Models Contributors Research Posts About

Learning to (Learn at Test Time): RNNs with Expressive Hidden States

Source

Citation. Yu Sun (Stanford University), Xinhao Li (UC San Diego) and Karan Dalal (UC Berkeley) are the core contributors. The other authors are Jiarui Xu (UC San Diego), Arjun Vikram, Genghan Zhang and Yann Dubois (Stanford). The advisers are Xinlei Chen (Meta AI), Xiaolong Wang (UC San Diego), Sanmi Koyejo, Tatsunori Hashimoto and Carlos Guestrin (Stanford). "Learning to (Learn at Test Time): RNNs with Expressive Hidden States". arXiv 2407.04620 [cs.LG]. v1 is from 5 July 2024, v2 from 11 August 2024, v3 from 3 April 2025 and v4 from 31 August 2025. We read v4. Paper. Code: JAX and PyTorch. The data is the Pile and its Books3 subset. Preprint, no venue given: neither the arXiv page nor the PDF names one. The v4 comment says that v4 changes only the related work and the limitations, and that the authors ran all experiments for v1. Compute came in part from the Google TPU Research Cloud and Hyperbolic Labs. The authors also name grants from Amazon, Cisco, Qualcomm, NSF, NIFA, the Sloan Foundation, Google, Sony, Panasonic, AFOSR, Stanford HAI and IBM.

Status. Planned. #4782 would use it in its synthesis on weight-space programming, as evidence for the ceiling that #5144 counts. Its Theorem 2 shows softmax attention as a learner that stores the tokens and has no weights to read. The paper has no method for a transformer's units, and the page proposes no new issue.

Read. We read the arXiv v4 PDF on 2026-11-19, as text that pdftotext took from it. We have the source's own text for the abstract, §1 to §5, the author contributions, the acknowledgements and the references. We also have Appendix A (the dual form), Appendix B (the Nadaraya–Watson estimator) and Appendix C (experiment details). Tables 1 and 3 came through as text. We also read the arXiv abstract page for the version history. We did not see the figures as images. Figures 2, 4, 7, 10 to 12 and 14 to 16 are plots, and only their axis ticks came through. So the page gives no number read from a plot, only what the text and captions say. A model (Claude Opus 5.5) did the reading.

Summary

Claim. A sequence layer can keep its hidden state as the weights of a small model. Its update rule is then one gradient step of a self-supervised loss on each token. These "Test-Time Training" (TTT) layers have linear cost in the length of the text. In the paper's runs, they keep reducing perplexity up to 32k tokens, while Mamba stops after 16k.

Method.

Findings, as the source reports them.

Setting Result
Table 1, 125M, linear attention as in Katharopoulos et al. Perplexity 15.91
Table 1, linear attention improved, and its TTT equivalent 15.23 and 15.23
Table 1, then learnable W_0 15.27 (+0.04). The rows after it "cannot train stably without it"
Table 1, then LayerNorm and residual in f 14.05 (−1.22)
Table 1, then mini-batch TTT (b = 2048 → 16) 12.35 (−1.70), the largest single gain
Table 1, then learnable η 11.99 (−0.36)
Table 1, then Mamba backbone (this is TTT-Linear) 11.09 (−0.90)
Pile, 2k context (Figure 10, from the text) TTT-Linear (M), Mamba and Transformer are "comparable". TTT-MLP (M) is "slightly worse" at large FLOP budgets
Pile, 8k context (Figure 10, from the text) Both TTT layers (M) are "significantly better" than Mamba
Books, 32k context (Figure 11, from the text) Both TTT layers (M) are better than Mamba. At 2k, Mamba is "slightly better" than TTT-Linear
Books, by model size (Figure 16 caption) For every method trained from scratch, perplexity gets worse once the context is too long
Training time, 2k context, v5e-256 TPU pod (§3.3) Transformer 0.30 s per iteration, TTT-Linear 0.27 s
Dual form against primal form, JAX (§2.5) Training is "more than 5× faster"
Inference FLOPs in Figure 2, right (Appendix C) TF finetune has 2.8× the inference FLOPs of the TTT layers and Mamba
Inner loss over 2,048 tokens, 125M (Figures 4 and 14, from the captions) The gap between ℓ(W_0; x_t) and ℓ(W_t; x_t) grows with t, in all 12 layers

Where the claims go beyond the evidence

The authors state several limits themselves: the wall-clock cost, the shared recipe, the missing linear fit, the backbone effect and the small scale.

Use in this repo