All models

TTT-Linear-760M-Base-Pile-8k (RetentionLabs)

A language model built from test-time training layers whose hidden state is a linear model.

Language · 9,134 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

This diagram has 9,134 operations (5.6 MB) and is drawn when you ask.

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
733.6M
Operations
9,134
Framework
PyTorch
Recurrent
Yes
Published
2024
Cited by
390 (as of 22 November 2026)
Authors
Yu Sun, Xinhao Li, Karan Dalal and others
Name in source
RetentionLabs:TTT-Linear-760M-Base-Pile-8k
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m2601
Graph hash
44f1e28768aac329e86d96e46c501f54e4470e85c33cae72d29c019aa87ab014
Skeleton hash
71fa3bd2e343b7c5f4f2886411ac8f77b6456479b80670c431e22759684601b4
Architecture hash
ae26077fa7b5cf7a75d2e5879f7f39c4f194e271af5b2823c18bf88a5dd4eab7
Diagram SHA-256
966b92e19d91167d2ad493e813a69eb6793ca180b101385dcf920e068d4e71b7
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

This model is the 760M size of TTT-Linear, published as RetentionLabs/TTT-Linear-760M-Base-Pile-8k; the paper evaluates four model sizes, 125M, 350M, 760M and 1.3B parameters.

About this model's family

TTT-Linear is a language model built from Test-Time Training (TTT) layers, sequence modeling layers whose hidden state is itself a machine learning model. Its paper starts from a trade-off: self-attention performs well in long context but has quadratic complexity, while existing RNN layers have linear complexity but are limited in long context by the expressive power of their hidden states.

In a TTT layer the hidden state is the weights of a model f, and the update rule is a step of gradient descent on a self-supervised loss. Because the hidden state is updated by training even on test sequences, the authors call these layers Test-Time Training layers. One choice of loss the paper describes is reconstructing the input token from a corrupted version of it. In TTT-Linear the hidden state is a linear model, and in the companion TTT-MLP it is a two-layer MLP. Both use the Mamba backbone, which contains temporal convolutions before the RNN layers, unless the paper notes otherwise.

The paper evaluates both at the scale of 125M to 1.3B parameters against a Transformer and Mamba. It reports that, similar to Transformer, TTT-Linear and TTT-MLP can keep reducing perplexity by conditioning on more tokens, while Mamba cannot after 16k context. The authors do not recommend training with the PyTorch implementation, because it is written in pure PyTorch without any systems optimization.

Key idea. The paper makes the hidden state of a sequence layer a machine learning model and its update rule a step of self-supervised learning, giving linear-complexity layers with expressive hidden states.

  • TTT-Linear
  • Test-Time Training layers
  • TTT layers
  • Learning to (Learn at Test Time)
  • RNNs with Expressive Hidden States
  • test-time training
  • language model
  • long context
  • ttt-lm-pytorch

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{sun2025learninglearntesttime,
      title={Learning to (Learn at Test Time): RNNs with Expressive Hidden States}, 
      author={Yu Sun and Xinhao Li and Karan Dalal and Jiarui Xu and Arjun Vikram and Genghan Zhang and Yann Dubois and Xinlei Chen and Xiaolong Wang and Sanmi Koyejo and Tatsunori Hashimoto and Carlos Guestrin},
      year={2025},
      eprint={2407.04620},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2407.04620}, 
}