Zefan Cai

Blog / Paper note · December 2026

Universal Test-Time Training

In test-time training, every layer keeps a fast-weight memory of its own. Universal Test-Time Training (uTTT) lets all layers read and write one memory instead. At the same or smaller state, long-context retrieval and novel view synthesis both improve, and the trained models rely on what layers write for each other.

TL;DR

  • Who owns a fast-weight memory does not have to follow depth. In uTTT every layer reads and writes one shared memory and keeps its own backbone weights, so what a deep layer writes in one chunk of the sequence, a shallow layer can read in the next.
  • Sharing adds 2.6 and 2.1 RULER points to 124M and 760M language models, at equal state and active compute. The control is the same router with a private pool per layer; RULER measures long-context retrieval. uTTT-MoE reaches 15.5 and 27.9, the highest of the models we tested whose memory does not grow with the context, with per-token loss no worse than full attention.
  • In novel view synthesis, one shared pool beats eight private ones by 0.92 dB PSNR (routed) and 0.76 dB (dense) after 23 input views. A shared pool of only 8 experts beats eight private pools of 8 by 0.99 dB with an eighth of their state, so the gain comes from shared writes, not from a wider choice.
  • The trained models use the routes that sharing opens. In view synthesis, cutting layer 8's writes out of layer 3's reads costs 0.69 dB PSNR; no same-layer route costs more than 0.06 dB.
  • It trains faster. All layers' writes merge into one update per chunk boundary, 7 per step instead of 168 at 760M, and uTTT-MoE trains up to 1.39 times as fast as TTT-MoE.

Each TTT layer owns its memory; uTTT shares one

Attention keeps every key and value it has seen, so its memory grows with the context. Recurrent networks, linear attention and state-space models keep a state of fixed size instead.

Test-time training (TTT) is one way to fill that state. The state is a small network, its fast weights, and the model trains it on the context as it reads.

We build on LaCT (large-chunk test-time training), which makes nonlinear fast weights practical at long context by updating them only once per large chunk of tokens. Our language models use chunks of 4,096 tokens.

Inside a chunk, each token reads the memory by running its query through the fast-weight network. At the end of the chunk the memory is written: one gradient step on a loss that asks the network to map the chunk's keys to their values. Queries, keys and values come from each token through learned projections, as in attention. The next chunk reads the updated network.

The ordinary (slow) weights are trained as usual, across sequences. They learn what to write and how to read.

In LaCT, as in the TTT layers before it, each layer owns its fast weights. Layer ℓ writes only to its own memory and reads only from it, so depth just gives L separate memories, each evolving along time. A layer can use only its own share of the memory budget, and nothing a deep layer writes ever reaches a shallower one.

uTTT gives the memory to the whole stack. All layers read and write one shared state, or one shared pool of states, and keep their own projections, attention and feed-forward weights.

The memory now recurs along time and depth together: what layer 12 writes in chunk 3 is there for layer 1 to read in chunk 4. We call this a top-down route. In training, the loss at that shallow read backpropagates through the deep layer's write, so the slow weights learn how layers at different depths should fill one memory.

With a shared memory, one read can depend on every layer's earlier writes

A 12-layer model reading in chunk 8, the shape of our 124M language model. Choose the memory and which layer reads.

Memory
Reading layer

Rows are the layer that wrote, columns the chunk whose end the write came at; the circle is the read. In a layer-private model a shallower layer's write can still reach the read through the residual stream: that layer reads its own memory and passes the result up. A deeper layer's write never can. In a routed pool, a cell's direct path is open when writer and reader pick a common expert. A gradient probe on the trained 124M models finds all 77 deeper cells (11 deeper layers × 7 earlier chunks) reached in uTTT-MoE and none in TTT-MoE (panel a of the figure under Trained models depend on the routes between layers).

The idea comes in two forms. In uTTT-MoE the memory is a pool of small fast-weight experts. As in multi-head attention, each token's query, key and value are split into a few heads, and each of these token heads picks one expert for each read and each write (some view-synthesis runs pick more).

Its control, TTT-MoE, uses the same router but confines each layer to its own slice of the pool. Total state and active state per token are the same; only ownership differs.

In uTTT-Dense one dense fast-weight network is applied in full at every layer. Its control is TTT-Dense, LaCT's layer-private design. The method section has the details.

Language: sharing adds 2.6 and 2.1 RULER points at no cost in loss

We train autoregressive models of 124M and 760M parameters on 32K-token sequences, with LaCT's language-modeling protocol. Each layer runs 4,096-token sliding-window attention beside the memory, so anything older than the window has to come through the fast weights.

We report two numbers. Per-token loss (PTL) is the next-token loss at positions 30K and beyond in Books3 sequences. RULER is retrieval accuracy over 13 tasks, averaged over 4K, 8K, 16K and 32K. A model can lower its loss without retrieving any better, so we need both.

The four fast-weight models carry the same total state. TTT-Dense is LaCT's design trained in our setup; we also report LaCT's published code as is. TTT-MoE gives each layer 4 experts. uTTT-MoE pools them, 48 experts at 124M and 96 at 760M, and every token head still activates one.

Six baselines run their own mixer beside the same window: Transformer-SWA, DeltaNet, Gated DeltaNet, KDA (Kimi Delta Attention), Mamba-2 and MoM (a mixture of linear memories). Like the fast-weight models, their state does not grow with the context; the four fast-weight models and these six are the bounded-state models. The full-attention Transformer keeps its whole key–value cache, so we plot it but do not rank it.

uTTT-MoE retrieves the most of the bounded-state models, at a loss no higher than full attention's

32K context. One point per model; arrows run through the fast-weight models from LaCT to uTTT-MoE.

Model size
View

PTL is the mean next-token loss at positions ≥ 30K of 32K-token Books3 sequences; RULER is accuracy (%) over 13 tasks, averaged over 4K, 8K, 16K and 32K. The full-attention Transformer (hollow) keeps a cache that grows with the context. Hover or tap a point for its numbers. Source: the paper's Table 2.

At both sizes uTTT-MoE has the highest mean RULER of the bounded-state models: 15.46 and 27.85, against 12.82 and 25.73 for TTT-MoE, the same router with private pools.

It does not pay for this in loss. Its PTL is lower than TTT-MoE's at both sizes (3.0857 against 3.1062, and 2.5768 against 2.5815). Against the full-attention Transformer it is level at 124M (3.0869, within seed noise) and lower at 760M (2.5978).

Two baselines reach lower loss at 124M, KDA and Mamba-2, but they retrieve 3.3 and 2.5 points less. At 760M only KDA does, and it retrieves 5.0 points less.

By length, uTTT-MoE leads TTT-MoE at all four lengths at 124M. At 760M it leads at 4K and 8K, by 8.9 and 1.6 points, and trails by 1.8 at 16K and 0.1 at 32K.

Past 32K, the loss advantage holds and retrieval does not. We tested this on separately trained 124M models, read over 3,000 Books3 books of at least 256K tokens, so their numbers are not on the scale of the table above. Within 32K both expert-pool models sit about 0.035 nat below a Transformer with the same 4K sliding window, and they stay below it out to 128K.

At 64K, though, every bounded-state model we tested, uTTT-MoE included, scores 3.3 to 3.8 RULER, about what the window alone gives.

Balance the pool, not each layer

A router shared by many layers can collapse onto a few experts. Without load balancing, the busiest expert takes 5.9 times its even share of token heads at 124M and 9.6 times at 760M. With balancing it takes 1.4 and 1.8 times.

At 124M, dropping the balancing costs uTTT-MoE 4.6 RULER points and TTT-MoE 2.8, both to below TTT-Dense's 12.65.

At 760M the unbalanced run actually has the higher mean, 28.46 against 27.85. The lead comes from one easy needle task. The same run loses 8 to 9 points on five other tasks and reads mostly from 22 of its 96 experts.

We balance usage over the whole pool rather than per layer. Forcing every layer to use every expert evenly would undo what sharing is for: letting depth decide who uses what.

With pool-level balancing the layers do split the pool. Each layer of the 124M model draws on about half of the 48 experts, and each layer of the 760M model on 8 to 11 of the 96, yet at most 5% of the pool gets less than a quarter of its even share.

View synthesis: one shared pool beats eight private ones

Novel view synthesis gives the memory a cleaner job. Following LVSM, each posed input image becomes one chunk of 1,024 patch tokens with ray encodings, which reads the memory and then writes to it.

A target camera, encoded by its rays alone, forms a read-only chunk that renders the unseen view. Attention stays inside each view, so everything the model knows about the other views has to come through the fast weights.

The 8-layer models train on Objaverse and are tested on 1,019 held-out Google Scanned Objects at 256×256. They train with 11 written views and are tested with up to 23, more than they saw in training. "View 23" below means the rendering after 23 views have been written.

The memory is split into p pools over the 8 layers: p = 8 is layer-private and p = 1 is fully shared. A routed pool holds e experts, and each token head activates a of them. A dense pool has width w. One unit of width costs a layer as much compute as one active expert but stores eight experts' worth of state, so 64 experts hold as much state as width 8.

One held-out object, rendered by uTTT-MoE along the same camera path from the shared pool after 1, 4, 8 and 23 written views. More demos, including a scrubber that writes views one at a time, are on the project page.

First we merge the private pools while holding per-layer compute fixed. Routed models keep 64 experts in total and activate one per token head, so parameters, state and active compute stay the same; only ownership changes.

Dense models keep width 1 per pool, so merging eight pools into one also cuts the total state eightfold.

Merging pools helps at fixed compute; activating more experts helps at fixed state

PSNR on 1,019 Google Scanned Objects with 95% bootstrap intervals over objects.

Experiment
PSNR at

Merge pools holds per-layer compute fixed and goes from eight private pools to one. The hollow point is a shared pool of only 8 experts in total. Add compute holds total state fixed (64 experts, or width 8) and raises what each layer applies, from one unit to eight; for dense models that also merges pools (p × w = 8). Dashed lines are the references: a full-attention Transformer whose cache grows by 1,024 tokens per view, Gated DeltaNet and DeltaNet. Source: the paper's Table 3 and Table H1.

Full sharing is the best in both families: +0.92 dB at view 23 for routed models (25.48 against 24.56) and +0.76 dB for dense ones (25.25 against 24.49). The intervals for the mean over views do not overlap.

The curves separate as more views are written, and the gap persists past view 11, where training stopped. The dense gain needs neither routing nor more state; it comes with an eighth of the state.

Is the routed gain just a wider choice? Sharing also lets each layer route among 64 experts instead of 8. So we shrank the shared pool to 8 experts in total.

It still beats the eight private pools by 0.99 dB at view 23 (25.55 against 24.56), with an eighth of their state and the same eight candidates per token head. Growing the shared pool from 8 to 64 experts moves view-23 PSNR by at most 0.25 dB, with no trend. What helps is that the state a layer reads was written by every layer.

At fixed state, more active experts keep paying, up to full attention

The second experiment holds the total state fixed, at 64 experts or width 8, and raises per-layer compute instead. Routed models activate 1, 2, 4 and 8 experts per token head. View-23 PSNR rises at every step, from 25.48 to 26.55 (+1.07 dB).

At eight active experts the fixed-size memory matches the full-attention Transformer at view 23 (26.55 against 26.54), even though the Transformer's cache grows by 1,024 tokens with every view. Over all 23 views the mean is 25.56 against 25.36.

Dense models can only add compute by widening, and in this experiment widening comes with merging. They gain 1.29 dB: 0.76 from sharing and 0.53 from widening.

At every compute level the routed model is ahead of its dense partner, by 0.77 dB when both apply eight units (eight active experts against width 8). LPIPS falls from 0.185 for TTT-Dense to 0.158 for uTTT-MoE with eight active experts.

On DL3DV scenes the trend for routed models holds: going from one active expert to eight raises the mean PSNR from 16.12 to 16.66.

Trained models depend on the routes between layers

A shared memory makes cross-layer routes possible. It does not force a trained model to use them. We checked in three ways.

Cut one route at inference. We took the trained 64-expert shared pool for view synthesis and removed one (writer, reader) pair of layers at a time. The reader gets its own copy of the memory, built from every layer's writes except that writer's; every other route stays intact.

The largest drop against the unmodified model is a top-down route. Taking layer 8's writes away from layer 3's reads costs 0.69 dB, averaged over 1,019 objects. No same-layer route costs more than 0.06 dB.

Cut the gradient in training. We trained a second 124M uTTT-MoE, called Cut, whose forward pass is identical but whose backward pass stops each layer's read gradient from flowing through other layers' writes. Its memory still holds every layer's writes, but no layer is trained, through the memory, to write for another.

Then, at inference, we froze all writes, so the memory stays at its learned initial state. Freezing raises the loss of the normal model (Full) by 7.98 millinats (thousandths of a nat) and Cut's by only 1.13: Cut came to lean on its memory much less.

Restricting each layer to its own writes costs Full 0.57 millinats and Cut 0.10. On the same documents Full also ends with a lower tail loss than both Cut and TTT-MoE.

Look at what the router does. When two source views see the same surface point, the earlier token's write at one layer and the later token's write at a deeper layer land on the same shared expert 2.63% of the time. A control token from the same later view, at least one token spacing away from that surface point, gets 1.88%, and uniform routing would give 1.56%.

So the same surface lands together 1.40 times as often as the control, and the ratio is above 1 on every one of the 1,019 objects.

Cross-layer routes carry gradient, and taking them away costs loss and PSNR

(a) Gradient shares from a probe on the layer-1 read in chunk 8 (124M, 300 Books3 documents). Boxes mark the cells of deeper layers in earlier chunks; uTTT-MoE reaches all 77, TTT-MoE none. (b) Loss increase when all writes are frozen or each layer keeps only its own writes, for the normal model (Full), the model trained with the cross-layer gradient cut (Cut) and TTT-MoE; dots are tail loss on these 1,024 documents, each read on its own rather than packed with others, so not on the scale of the main results. (c) PSNR drop from removing one writer–reader route in the 64-expert shared pool, over 1,019 objects; the outlined cell is layer 8 to layer 3. Figure 4 of the paper.

One write per chunk boundary also trains faster

Sharing also makes training faster. uTTT-MoE is up to 1.39 times as fast as TTT-MoE, and it reaches TTT-Dense's final training loss in 1,540 H100 GPU-hours, 15% fewer than TTT-Dense and 27% fewer than TTT-MoE.

What changes is the number of writes. Every layer reads the state as it stood at the start of the chunk and computes its write gradient at that same state, so at the boundary all the gradients sum into one optimizer update per pool. A 760M step on 32K tokens performs 168 separate writes in TTT-Dense or TTT-MoE, 24 layers times 7 boundaries, and 7 in uTTT-MoE.

uTTT-MoE has the highest training throughput in every setting we measured

Thousands of training tokens per second per GPU; one node of eight GPUs, 32K context, batch 1 per GPU.

Values as printed in the paper's Figure 5a, rounded to one decimal.

Kernels are not the whole story. Both routed models run the same fused kernels, and with every fused kernel switched off, uTTT-MoE on one A100 is still 19% (124M) and 15% (760M) faster than TTT-MoE with them on.

It is not free. Peak training memory is 1.29 to 1.37 times TTT-Dense's in these runs. At inference (760M, one A100, batch 1), uTTT-MoE prefills as fast as TTT-Dense and 1.3 times as fast as TTT-MoE at 16K and 32K, but it decodes at TTT-MoE's speed, 0.72 to 0.74 times TTT-Dense's across 4K to 128K.

The method: one pool, one update per boundary

Each fast-weight module is a small SwiGLU network, fW(x) = W1[SiLU(W0x) ⊙ W2x]. A read evaluates it on a query, o = fW(q). A write takes a gradient step on −⟨fW(k), v⟩, which rewards the network for returning each key's value, with per-token step sizes predicted by the slow weights.

The language models update with momentum, Muon and row renormalization; the view-synthesis models drop momentum and Muon. Fast weights reset to a learned initial state at the start of every sequence.

uTTT splits the L layers into p contiguous groups and gives each group one state. p = L is layer-private TTT, and p = 1 is one state for the whole stack.

Within a chunk, every layer reads the state as it stood at the start of the chunk. At the boundary each layer's write gradient Gc,ℓ is computed at that same state, and the group's state takes one step on their sum, W(c) = Update(W(c−1), Σℓ Gc,ℓ). No layer ever reads a write from its own chunk, so the shared state stays causal.

In uTTT-MoE the state is a pool of E experts, each one SwiGLU triple (W0, W1, W2). Each token head routes its query (for a read) or its key (for a write) to the top K experts by inner product with learned expert addresses, weighted by the router's softmax. TTT-MoE is the same model at p = L.

In uTTT-Dense the state is one dense network with a block per head, applied in full at every layer. Sharing a dense state the size of one private layer's keeps per-token compute and cuts total state L-fold; widening it to L times that size keeps total state and multiplies compute by L.

The routed pair in our language models. Only ownership differs.
TTT-MoEuTTT-MoE
Who writes an expertone layerevery layer
Experts a layer can pick from448 (124M) / 96 (760M)
Experts active per token head11
Total fast-weight state4 L experts4 L experts
Writes per training step (760M)1687

Read as one computation, the shared state is a single recurrence over (chunk, layer) pairs, and layer-private TTT is the special case that cuts it into L independent chains. Training keeps every write in the graph, so the loss at a read reaches the writes of every earlier chunk at every depth; in a routed pool, through the experts that writer and reader both select.

Every block sends q, k, v to one memory shared by the whole stack

In the language models each block keeps its own normalization, projections and window attention, and sends q, k, v to a memory shared by the whole stack: a pool of fast-weight experts under a top-K router (uTTT-MoE, top right) or one dense fast-weight operator (uTTT-Dense, bottom right). Red arrows write, blue arrows read. The view-synthesis block orders its sublayers differently and gives the memory its own projections. Figure 1 of the paper.

What we do not know yet

  • Scale. Our largest language model has 760M parameters and saw 43B tokens. Whether the gain grows, holds or shrinks with scale is open.
  • Length. Sharing does not fix length generalization: past 32K, retrieval falls to the window's level for every bounded-state model we tested.
  • Scenes. We do not know why sharing barely moves PSNR on DL3DV, whether scenes need more data, a different split of the pool, or something else.
  • A dense shared memory for language. We trained it only at 124M. Two to six times as wide as one layer's state, so a sixth to a half of TTT-Dense's total, it retrieves as well as TTT-Dense (13.2 to 13.6 RULER against 12.7). At one layer's width, with the same per-token compute and a twelfth of the state, it falls to 10.6.
  • What layers pass to each other. The knockouts show which routes matter, layer 8 to layer 3 most of all. They do not show what travels along them.

Fast weights as memory go back to Schmidhuber, and Schlag, Irie and Schmidhuber read linear attention as fast-weight programming. TTT layers and Titans train that memory online. LaCT makes large nonlinear fast weights practical by updating once per large chunk, and TTT-E2E updates selected layers' MLP weights under the next-token loss. All of them keep separate fast weights per layer.

MoM routes among linear memory states inside a layer; our TTT-MoE control adds routing to LaCT's nonlinear fast weights.

Sharing across depth has a long history for slow weights: Universal Transformers, ALBERT and their MoE variants such as MoEUT tie trained parameters across layers. Shared memory also appears in the Feedback Transformer, in block-recurrent models and in cross-layer key–value caches such as YOCO and CLA.

uTTT differs in what is shared: a bounded fast-weight memory that every layer writes by test-time optimization within each sequence, with those writes kept in the training graph. The backbone weights stay per layer.

References

  1. Tianyuan Zhang, Sai Bi, Yicong Hong, Kai Zhang, Fujun Luan, Songlin Yang, Kalyan Sunkavalli, William T. Freeman, Hao Tan. Test-Time Training Done Right. ICLR 2026.
  2. Yu Sun, Xinhao Li, Karan Dalal, Jiarui Xu, Arjun Vikram, Genghan Zhang, Yann Dubois, Xinlei Chen, Xiaolong Wang, Sanmi Koyejo, Tatsunori Hashimoto, Carlos Guestrin. Learning to (Learn at Test Time): RNNs with Expressive Hidden States. ICML 2025.
  3. Ali Behrouz, Peilin Zhong, Vahab Mirrokni. Titans: Learning to Memorize at Test Time. NeurIPS 2025.
  4. Arnuv Tandon, Karan Dalal, Xinhao Li, Daniel Koceja, Marcel Rød, Sam Buchanan, Xiaolong Wang, Jure Leskovec, Sanmi Koyejo, Tatsunori Hashimoto, Carlos Guestrin, Jed McCaleb, Yejin Choi, Yu Sun. End-to-End Test-Time Training for Long Context. 2025.
  5. Jürgen Schmidhuber. Learning to Control Fast-Weight Memories: An Alternative to Dynamic Recurrent Networks. Neural Computation, 1992.
  6. Imanol Schlag, Kazuki Irie, Jürgen Schmidhuber. Linear Transformers Are Secretly Fast Weight Programmers. ICML 2021.
  7. Jusen Du, Weigao Sun, Disen Lan, Jiaxi Hu, Tao Zhang, Yu Cheng. MoM: Linear Sequence Modeling with Mixture-of-Memories. ICLR 2026.
  8. Mostafa Dehghani, Stephan Gouws, Oriol Vinyals, Jakob Uszkoreit, Łukasz Kaiser. Universal Transformers. ICLR 2019.
  9. Róbert Csordás, Kazuki Irie, Jürgen Schmidhuber, Christopher Potts, Christopher D. Manning. MoEUT: Mixture-of-Experts Universal Transformers. NeurIPS 2024.
  10. Angela Fan, Thibaut Lavril, Edouard Grave, Armand Joulin, Sainbayar Sukhbaatar. Addressing Some Limitations of Transformers with Feedback Memory. 2020.
  11. Yutao Sun, Li Dong, Yi Zhu, Shaohan Huang, Wenhui Wang, Shuming Ma, Quanlu Zhang, Jianyong Wang, Furu Wei. You Only Cache Once: Decoder-Decoder Architectures for Language Models. NeurIPS 2024.
  12. William Brandon, Mayank Mishra, Aniruddha Nrusimha, Rameswar Panda, Jonathan Ragan-Kelley. Reducing Transformer Key-Value Cache Size with Cross-Layer Attention. NeurIPS 2024.
  13. Haian Jin, Hanwen Jiang, Hao Tan, Kai Zhang, Sai Bi, Tianyuan Zhang, Fujun Luan, Noah Snavely, Zexiang Xu. LVSM: A Large View Synthesis Model with Minimal 3D Inductive Bias. ICLR 2025.

Citation

@misc{cai2026universaltesttimetraining,
  title={Universal Test-Time Training},
  author={Zefan Cai and Qinzhe Hu and Ziqiao Ma and Hao Tan and Junjie Hu},
  year={2026},
  eprint={2610.05484},
  archivePrefix={arXiv},
  primaryClass={cs.LG},
  url={https://arxiv.org/abs/2610.05484},
}