Manuscript Offprint

arXiv:2610.05484

Universal Test-Time Training

Zefan Cai, Qinzhe Hu, Ziqiao Ma, Hao Tan, Junjie Hu

ABSTRACT

Recent Test-Time Training (TTT) architectures compress context into fast weights that are updated online and queried as memory. Existing TTT designs keep this memory private to each layer: it recurs only over time, and depth merely indexes L separate memories. We argue that memory ownership need not be tied to depth, and introduce Universal Test-Time Training (uTTT), in which all layers read and write one shared memory while retaining layer-specific backbone parameters. The shared memory thus recurs over two dimensions, time and depth, with chunks and layers as their units: a write by a deep layer in one chunk can be read by a shallow layer in the next. We instantiate this idea as uTTT-MoE and uTTT-Dense. uTTT-MoE routes each token head to a few experts in a pool shared by all layers; uTTT-Dense applies the whole shared memory at every layer without routing. In language modeling, uTTT-MoE reaches 15.5 and 27.9 RULER accuracy at 124M and 760M, 2.6 and 2.1 points above its layer-private counterpart at equal state and active compute, the highest among tested bounded-state models, with per-token loss matching or beating full attention. In novel view synthesis, sharing at fixed per-layer compute gains 0.92 dB in view-23 object PSNR in routed models and 0.76 dB in dense models.

Figure

Figure 1: Universal Test-Time Training. A block (middle) keeps its normalization, projections, and window attention private and sends q, k, v to a memory with state shared across the stack (left). The state (right) is a pool of E fast-weight experts under a top-K router (uTTT-MoE, top) or dense fast weights applied in full (uTTT-Dense, bottom). Blue arrows read (5); red arrows write (6).

∗^{*}Equal contribution.

1 INTRODUCTION

Long-context models trade explicit memory for compressed state. Attention keeps the full key-value history at growing cost (Vaswani et al., 2017), while recurrent networks, linear attention, and state-space models keep a bounded state (Hochreiter & Schmidhuber, 1997; Katharopoulos et al., 2020; Gu & Dao, 2024; Dao & Gu, 2024; Yang et al., 2024). Recent Test-Time Training (TTT) architectures store context in fast weights that are optimized online during the forward pass and queried as memory (Hinton & Plaut, 1987; Schmidhuber, 1992; Schlag et al., 2021; Sun et al., 2025; Behrouz et al., 2025); large-chunk TTT amortizes these updates to make nonlinear fast-weight memory practical at long context (Zhang et al., 2026).

Once fast weights serve as memory, a design question is who owns them. Layerwise KV-binding TTT (Sun et al., 2025) and LaCT (Zhang et al., 2026) give each layer its own state, written using its key-value pairs and read by its queries. TTT-E2E (Tandon et al., 2025) updates selected layers' MLP weights under one next-token prediction loss, but still keeps separate weight tensors across depth. In all of these designs, layer ℓ\ell's memory takes only layer ℓ\ell's writes, so it evolves along time alone and depth only multiplies memories: a layer can use only its own share of the budget, and no layer can read state written by another.

In this work, we call fast weights universal when all layers read from and write to one shared state or one shared pool of states. Universal Test-Time Training (uTTT) builds on such fast weights while keeping backbone parameters layer-specific (Figure 1). Its memory then evolves along both time and depth, measured in chunks along time and in layers along depth, and layer-private TTT is the special case that partitions it by layer. This opens two routes that layer-private TTT lacks: a shallow layer can directly read what a deep layer wrote in the previous chunk, a top-down route, and the outer task loss at that read backpropagates through the write, so the slow weights learn how layers at different depths build and use one memory (Sections 2 and 3.4). Unlike prior sharing across depth, uTTT shares a bounded fast-weight memory that every layer writes by test-time optimization within each sequence, and keeps these writes in the training graph.

uTTT comes in two forms. uTTT-MoE gives every layer a shared pool of E expert states, from which each token head selects K per read or write. Its control, TTT-MoE, uses the same router but restricts each layer to its own E/L experts, so sharing widens each layer's choices from E/L to E experts at equal total state and active experts. uTTT-Dense applies one dense shared state at every layer. Compared with TTT-Dense, the layer-private dense design of LaCT, it lets every layer apply the whole state at a fixed budget, raising fast-weight compute, or matches per-layer compute with only 1/L of the state. Because all layers write the same tensors, each chunk's updates also merge into one operation, which speeds up training.

Related work. TTT uses fast weights as a context-dependent memory state (Sun et al., 2023; 2025; von Oswald et al., 2026; Wang et al., 2026). MoM routes among linear memory states (Du et al., 2026); our TTT-MoE control adds routing to LaCT's nonlinear fast weights. Shared memory also appears in Feedback Transformers (Fan et al., 2020), block-recurrent models (Ju et al., 2022; Hutchins et al., 2022), and cross-layer key-value caches (Sun et al., 2024; Wu & Tu, 2024; Brandon et al., 2024). Universal Transformers, ALBERT and their MoE variants share slow parameters across depth (Dehghani et al., 2019; Lan et al., 2020; Tan et al., 2023; Csordás et al., 2024). UniPool and MoUE likewise share trained expert parameters (Huang et al., 2026; Chen et al., 2026); MoUE additionally shares an online-updated routing state. Appendix A gives the extended comparison.

References (66)