NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Linearizing Vision Transformer with Test-Time Training

Yining Li, Dongchen Han, Zeyu Liu, Hanyi Wang, Yulin Wang, Gao Huang

The Quadratic Bottleneck in Vision Models

The "quadratic bottleneck" remains the Achilles' heel of modern Transformer architectures. In standard Softmax attention, computational costs quadruple every time the sequence length doubles, severely limiting applications at higher image resolutions. While "linear attention" alternatives exist, they face a massive adoption hurdle: they typically require training from scratch, which costs millions of dollars in compute.

Simply transferring weights from a pre-trained Softmax model to a linear model fails because their mathematical languages—or representational spaces—are fundamentally different. To address this challenge of weight inheritance, researchers have introduced T$^5$ (Transformer To Test-Time Training). By converting computationally expensive $O(N^2)$ Softmax attention into efficient $O(N)$ Test-Time Training (TTT) layers, T$^5$ enables the direct inheritance of pre-trained weights with minimal fine-tuning.

The T$^5$ Methodology

The T$^5$ approach bridges the gap between Softmax and linear attention through two primary pillars:

1. Architectural Alignment

A profound insight of this work is viewing Softmax attention not merely as a matrix multiplication, but as a dynamic two-layer Multi-Layer Perceptron (MLP) where the "weights" are the Keys and Values. Standard linear attention, being a single-layer transformation, lacks the capacity to hold Softmax's knowledge. TTT layers, however, utilize a hidden state that functions as the weights of a small internal neural network. This provides the necessary two-layer MLP capacity, making TTT the perfect architectural "container" for inheriting Softmax weights.

2. Representational Alignment

Even with structural alignment, the internal data behaves differently. The researchers identified two key discrepancies and introduced targeted fixes:

  • Key Shift-Invariance: Softmax is naturally "shift-invariant" (adding a constant to all keys doesn't alter the output), whereas TTT is not. The researchers discovered that pre-trained keys possess massive biases that cause TTT to explode during training. They resolved this by applying Instance Normalization to the keys, effectively centering them as a vital stabilizer.
  • Locality: Softmax naturally focuses on nearby pixels, while TTT tends to look globally. To re-inject this crucial local bias, the authors introduced Depthwise Convolutions (DWC) to the queries and keys.

Experimental Validation and Key Results

The researchers validated T$^5$ across major benchmarks, including ImageNet-1K (for DeiT and DiT-XL/2), a Flux-generated 1024x1024 dataset, and standard text-to-image benchmarks like DPG-Bench and GenEval.

  • Efficiency via Inheritance: By inheriting weights, the T$^5$ method bypasses 99% of typical training costs. For instance, the DiT-XL/2 model reached parity with its original counterpart using only 0.57% of the original training steps.
  • SD3.5-T$^5$: The team successfully linearized Stable Diffusion 3.5-Medium. The conversion required a mere 1 hour of training on 4x NVIDIA H20 GPUs. The resulting model achieved a 1.32x speedup at 1K resolution and a 1.47x speedup at 2K resolution.
  • Generation Quality: Remarkably, the linearized SD3.5-T$^5$ outperformed the original SD3.5-Medium on the DPG-Bench (84.43 vs. 83.83), demonstrating that the conversion preserves and can even slightly enhance generative performance. On ImageNet classification, the T$^5$-Tiny model achieved 71.19% accuracy, significantly outperforming alternative linearization methods like Hedgehog or CLEAR under identical training budgets.

Limitations and Future Directions

While highly effective, the current T$^5$ recipe is heavily optimized for Vision Transformers. Applying these specific representational alignments to Large Language Models (LLMs) may require further adaptation. Furthermore, while one hour of training is exceptionally fast, the process is not entirely zero-shot; some fine-tuning remains necessary to settle the new TTT-specific parameters. Finally, the speed benefits of linear complexity are most pronounced at higher resolutions (1K and above). For smaller images (e.g., 224x224), the overhead of the TTT inner-loop might outweigh the computational savings.

Ultimately, T$^5$ provides a highly promising pathway for scaling models to ultra-high resolutions (4K or 8K) that were previously blocked by the quadratic memory wall.

Summary updated

BibTeX
@inproceedings{li2026linearizing,
  author = {Yining Li and Dongchen Han and Zeyu Liu and Hanyi Wang and Yulin Wang and Gao Huang},
  title = {{Linearizing Vision Transformer with Test-Time Training}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=bBylXHoUTl},
}
Figure