Test-Time Training with KV Binding Is Secretly Linear Attention
Authors: Junchen Liu, Sven Elflein, Or Litany, Zan Gojcic, Ruilong Li
Organizations: NVIDIA, Toronto, Ontario, Canada · University of Toronto, Toronto, Ontario, Canada · Vector Institute, Toronto, Ontario, Canada · Technion – Israel Institute of Technology, Haifa, Israel
Test-time training (TTT) with KV binding as sequence modeling layer is commonly interpreted as a form of online meta-learning that memorizes a key-value mapping at test time. However, our analysis reveals multiple phenomena that contradict this memorization-based interpretation. Motivated by these findings, we revisit the formulation of TTT and show that a broad class of TTT architectures can be expressed as a form of learned linear attention operator. Beyond explaining previously puzzling model behaviors, this perspective yields multiple practical benefits: it enables principled architectural simplifications, admits fully parallel formulations that preserve performance while improving efficiency, and provides a systematic reduction of diverse TTT variants to a standard linear attention form. Overall, our results reframe TTT not as test-time memorization, but as learned linear attention with enhanced representational capacity. Project page: https://research.nvidia.com/labs/sil/projects/tttla/.
Figures & tables
Figure 1: Inner-Loop Optimization vs. Performance . Increasing inner-loop iterations improves inner-loop loss but degrades task performance, contradicting the memorization-based interpretation of TTT. Experiments are based on LaCT ( Zhang et al., 2025 ) .
Model
Perplexity ↓ (LaCT-LLM)
PSNR ↑ (LaCT-NVS)
Top-1 Acc ↑ (ViTTT)
Baseline
16.43
25.94
79.34
Gradient Ascent
16.19
25.85
79.61
Replace Q with K
16.18
25.95
79.18
Table 1: Observations Contradicting the Storage-and-Retrieval Interpretation of TTT. Replacing gradient descent with ascent breaks the storage interpretation, and replacing queries with keys breaks the retrieval interpretation, yet task performance remains mostly unchanged. Experiments are base on LaCT ( Zhang et al., 2025 ) and ViTTT ( Han et al., 2025 ) .
Figure 2: Distributional Asymmetry Between Q and K . t-SNE visualizations of (Q,K) and (V,O) features in a pretrained LaCT ( Zhang et al., 2025 ) model on the NVS task, showing that the TTT inner loop is evaluated out of distribution and thus does not perform reliable retrieval.
Alias
Description of TTT Inner-loop Designs
Perplexity ↓ (LaCT-LLM)
PSNR ↑ (LaCT-NVS)
Top-1 Acc ↑ (ViTTT)
Tokens Per Sec ↑ (Recurrent Impl.)
Tokens Per Sec ↑ (Parallel Impl.)
Baseline
LaCT ( Zhang et al., 2025 ) / ViTTT ( Han et al., 2025 )
16.43
25.94
79.34%
4.30M
N/A
Variant 1
Baseline w/ only update the last layer parameters
15.93
25.97
79.63%
10.60M
N/A
Variant 2
Variant 1 w/ remove weight normalization
16.31
25.93
79.63% †
11.02M
30.18M
Variant 3
Variant 2 w/ multi-layer MLP → singel linear layer
16.23
25.71
79.39%
12.95M
49.69M
Variant 4
Variant 3 w/ remove per-token learnable lr
16.12
25.70
79.39% †
13.31M
53.99M
Variant 5
Variant 4 w/ remove momentum in SGD
15.97
25.70 †
79.39% †
14.40M
57.28M
Table 2: Ablation Trajectory Reducing TTT to Standard Linear Attention. By progressively simplifying complex TTT formulations into standard linear attention (Variant 6), we quantify the contribution of each design component in TTT. Variant 1 achieves the best performance across all three tasks. Variants 2–6 admit parallel implementations. We additionally report the inference throughput of each variant’s TTT layer on the LLM task. † denotes ablations that do not apply, in which case performance matches the preceding variant. * indicates that ViTTT does not use gradient orthogonalization, so we ablate gradient normalization instead.
Figure 3: Perplexity Metric for Ablation on LaCT-LLM. Evaluated on 2.5B tokens from the Book-3 dataset.
Figure 4: Training loss vs. wall-clock time on LaCT-LLM. We compare the original LaCT-TTT with both parallel and recurrent form of Variant 2. The parallel form achieves a 1.19× end-to-end speedup while maintaining comparable convergence.
Test-time training adapts model parameters or memory during deployment using each input or stream to improve performance under changing tasks and data.
Test-time training (TTT) views sequence modeling as an online learning problem in which fast weights are updated by an internal learning rule. Despite the growing number of TTT variants, existing approaches typically hard-code each variant separately, which makes it difficult to design new TTT methods and to isolate the role of each component. To address this, we propose Modular TTT, a framework that represents the inner learner as a directed acyclic graph and exposes the fast-weight network, loss function, learning rate, weight decay, and normalization as explicit design dimensions. Modular TTT automatically composes primitive-level train-view forward, train-view backward, and causal query-view rules into the full graph-level TTT computation, including the fast-weight state transition. Using Modular TTT, we systematically ablate the components of TTT and find that small learning-rate initialization, weight decay, and a single-layer nonlinearity improve performance, while MSE and inner-product losses perform similarly. Deeper fast-weight networks and normalization tend to hurt performance because they induce excessively large activations, while residual connections and gating provide little measurable benefit. Guided by these findings, we train the best resulting variant as 410M- and 1.45B-parameter models on 100B tokens, and observe training loss and benchmark performance comparable to Gated DeltaNet.
Bohao Tang, Zhen Qin, Yuqi Pan +3
Shanghai Jiao Tong University · Shanghai Innovation Institute · ByteDance Seed
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.
Zefan Cai, Qinzhe Hu, Ziqiao Ma +2
University of Wisconsin–Madison · University of Michigan–Ann Arbor · Adobe
While linear-complexity attention mechanisms offer a promising alternative to Softmax attention for overcoming the quadratic bottleneck, training such models from scratch remains prohibitively expensive. Inheriting weights from pretrained Transformers provides an appealing shortcut, yet the fundamental representational gap between Softmax and linear attention prevents effective weight transfer. In this work, we address this conversion challenge from two perspectives: architectural alignment and representational alignment. We identify Test-Time Training (TTT) as a linear-complexity architecture whose two-layer dynamic formulation is structurally aligned with Softmax attention, enabling direct inheritance of pretrained attention weights. To further align representational properties, including key shift-invariance and locality, we introduce key instance normalization and a lightweight locality enhancement module. We validate our approach by linearizing Stable Diffusion 3.5 and introduce SD3.5-T5 (Transformer To Test Time Training). With only 1 hour of fine-tuning on 4×H20 GPUs, SD3.5-T5 achieves comparable text-to-image quality to the fine-tuned Softmax model, while accelerating inference by 1.32× and 1.47× at 1K and 2K resolutions. Code is available at https://github.com/LeapLabTHU/Transformer-to-TTT.