Rethinking Expressivity and Efficiency in Test-Time Training

Zeyun Zhong, Joya Chen, Manuel Martin, Frederik Diederichs, Juergen Gall, Jürgen BeyererNeurIPS 2026

TL;DR

Standard Transformers remember context by hoarding every past token in a massive cache, whereas Test-Time Training (TTT) compresses history directly into the weights of a tiny neural network on the fly. Until now, TTT forced a painful choice: update weights token-by-token (smart, but agonizingly slow on GPUs) or mash tokens into large chunks (fast, but forgetful of fine-grained timing). $\text{E}^2\text{-TTT}$ uses a clever mathematical shortcut to compute exact per-token learning dynamics across entire chunks in parallel—giving us GPU-friendly speeds and rock-solid memory even at $8\times$ the training context length.

What Problem Does This Paper Address?

Imagine reading a mystery novel. A standard Transformer keeps every page spread out on the floor (the KV cache) and glances back at all of them after every new word. That gets expensive fast.

Test-Time Training (TTT) offers a sleeker alternative: instead of storing raw tokens, it uses a small inner neural network (like a two-layer MLP) as its "memory." As tokens stream in, TTT treats inference like a mini-training session, running gradient descent on a self-supervised objective to update these "fast weights" continuously.

Figure 1: Token-wise TTT. At each step, the pair (kt, vt) defines a self-supervised loss whose gradient step (the “training” stage) updates Wt−1 to Wt. The query qt then reads from Wt to produce ot.

Here is the catch: GPUs hate waiting in line. Updating weights sequentially, token by token, leaves your expensive accelerator twiddling its thumbs (often under 5% FLOPs utilization). To fix this, recent methods like LaCT group sequences into big chunks (say, 512 tokens), evaluate gradients all at once, and average the optimizer settings—like momentum—across the whole chunk.

It’s fast, sure. But flattening 512 tokens into a single average erases when things happened inside that chunk. As sequences grow longer than what the model saw during training, this coarse approximation causes the model's memory to completely fall apart. How do we get chunk-level GPU parallelism without lobotomizing the optimizer's sense of time?

Methods

Enter $\text{E}^2\text{-TTT}$ (Expressive and Efficient TTT). The authors adopt the standard chunk-wise setup where all token gradients within a chunk of size $C$ are computed in parallel using the frozen weights from the start of the chunk ($\mathbf{W}_0$).

What’s new is how those gradients get combined:

  • Unrolling the Scalar Recurrence: Rather than averaging optimizer dynamics across the chunk, every token $t$ predicts its own scalar learning rate ($\eta_t$), momentum ($\beta_t$), and weight decay ($\gamma_t$). Because these are cheap scalars rather than bulky matrices, the authors unroll the sequential update equations mathematically from $t=1$ to $C$.
  • Two Closed-Form Scalar Kernels: Using parallel log-space cumulative sums, they compress the exact survival history of every token's gradient into two scalar coefficients—one for the final weights ($\mathcal{K}_t^W$) and one for the final momentum ($\mathcal{K}_t^M$). This "teleports" the model from the start of the chunk to the exact end state of a sequential recurrence in a single parallel step, without ever materializing intermediate weight matrices.
  • Single-Backward Trick: Naively, computing two different weighted gradient sums would double the backward-pass work. The authors notice both kernels share the exact same per-token activation gradients, requiring just one extra lightweight matrix contraction over standard chunk-TTT.

Because a chunk-wise TTT branch only updates its weights between chunks—leaving tokens blind to earlier tokens inside the same chunk—the authors pair $\text{E}^2\text{-TTT}$ in parallel with standard Sliding Window Attention (SWA) inside a Llama-style architecture, fusing their outputs with a learned gate.

Figure 2: E2-TTT token mixing block. SWA and E2-TTT run in parallel over shared Q, K, V and are fused by a data-dependent gate. The TTT up- date is modulated by input-dependent α, η, β.

Datasets

No new benchmarks are introduced; the authors rely on established datasets across language and vision:

  • Pre-training: 15B tokens from HuggingFace FineWeb-Edu (for 340M and 1.3B parameter models).
  • General LM & Reasoning: WikiText, LAMBADA, PIQA, HellaSwag, WinoGrande, ARC-easy, and ARC-challenge.
  • In-Context Retrieval & Extrapolation: Real-world recall tasks (SWDE, SQuAD, FDA), synthetic passkey retrieval (Single-Needle in a Haystack / S-NIAH), per-token loss extrapolation (GovReport, QMSum, NarrativeQA, Qasper, CodeParrot, PG19), and the 14-task LongBench suite.
  • Multimodal Adaptation: A 43K-sample subset of LLaVA-Video-178K for training, evaluated on VideoMMMU and LongVideoBench.

Key Insights and Ideas

  • Matrices are heavy; scalars are practically free. You don't need sequential matrix math to preserve sequential dynamics. By isolating token-level momentum and decay into scalar prefix/suffix products, you get exact token-wise temporal weighting at chunk-wise speeds.
  • Standard perplexity hides memory rot. In a surgical ablation, collapsing $\text{E}^2\text{-TTT}$’s per-token momentum and decay into chunk averages barely changed standard language modeling perplexity—in fact, the collapsed model looked slightly better on LAMBADA! Yet on 8K-token passkey retrieval, accuracy plummeted from 95.4% down to 6.8%. Next-token prediction on short texts won't warn you that your long-range memory is broken.
  • Gated fast weights love retrieval. Using a SwiGLU MLP as the inner fast-weight learner noticeably outperformed a standard GELU MLP on tough associative recall and extrapolation tasks, suggesting gating helps fast weights route and extract precise facts.

Key Results

  • Language Modeling & Recall: At 1.3B parameters, $\text{E}^2\text{-TTT}$ achieves the lowest perplexity on WikiText (19.5) and LAMBADA (15.3), while beating hybrid linear-attention (HQLT: 35.5%) and chunk-TTT (LaCT: 36.7%) baselines on real-world retrieval (43.6% average accuracy), narrowing the gap to full quadratic attention (53.3%).
  • Extreme Length Extrapolation: Trained on just 2K-token sequences, $\text{E}^2\text{-TTT}_{\text{SwiGLU}}$ maintains 93.6% accuracy on S-NIAH-1 at 16K tokens ($8\times$ training length), whereas LaCT collapses to 3.0% and HQLT fades to 25%. Similarly, per-token language modeling loss stays flat up to 8K tokens while LaCT diverges immediately past 2K.
Figure 4: Zero-shot accuracy on S-NIAH-1 and S-NIAH-2 for 1.3B models. All methods use sliding window attention with a 512-token window. E2-TTT maintains robust retrieval well beyond the training context, while LaCT collapses past 4K and HQLT degrades steadily across both tasks.
  • LongBench & Video: $\text{E}^2\text{-TTT}$ leads all tested sub-quadratic baselines on LongBench (14.1% vs. 12.1% for HQLT and 7.7% for LaCT). When bolted onto a frozen Qwen3VL-2B backbone for video understanding, training only the $\text{E}^2\text{-TTT}$ branch matches full supervised fine-tuning of the entire model (43.9 vs. 43.5 on VideoMMMU; 59.0 vs. 58.3 on LongVideoBench).

Limitations and Future Work

  • Intra-chunk blindness: Because all gradients in a chunk are evaluated at the chunk-start weights $\mathbf{W}_0$, the TTT module itself cannot pass information between tokens inside the same 512-token chunk, making the local Sliding Window Attention branch mandatory rather than optional.
  • Gap to Full Attention: On dense, exact-recall benchmarks within the training window, full quadratic Transformers still hold a clear lead (53.3% vs. 43.6%), reminding us that compressing everything into fixed-size weights—even nonlinear ones—still loses some resolution.
  • Harder Retrieval Degradation: While S-NIAH-1 stays above 90% out to 16K tokens, accuracy on the tougher S-NIAH-2 variant still drops off at extreme lengths (40.6% at 8K, and near-zero at 16K), leaving room for richer inner-loop architectures and larger-scale training runs.

Summary updated

Abstract

Test-Time Training (TTT) enables long-context processing via continuous weight updates during inference, but current methods struggle to balance the hardware efficiency of chunk-wise approximations with the expressivity of per-token update dynamics such as learning rate and momentum. We propose E$^2$-TTT (Expressive and Efficient TTT) to bridge this gap. Following prior chunk-wise TTT methods, we compute all gradients within a chunk at the chunk-start weights. Under this setting, we derive a closed-form chunk update that retains these per-token dynamics and exactly reproduces the chunk-end state of the corresponding token-wise recurrence. This enables fully parallelized chunk-level training while preserving the temporal structure of the update rule that prior chunk-wise methods discard. We validate E$^2$-TTT by training models up to 1.3B parameters from scratch. It performs on par with previous TTT and hybrid attention baselines in language modeling while outperforming them on in-context retrieval. Its advantage is most pronounced in length extrapolation: on the standard ``Needle in a Haystack'' passkey test, it retains over 90\% accuracy at $8\times$ the training context length. Meanwhile, E$^2$-TTT can match the training throughput of efficient chunk-wise methods, demonstrating that it effectively reconciles expressivity with efficiency. The code is available at https://github.com/zeyun-zhong/E2-TTT.
BibTeX
@inproceedings{zhong2026rethinking,
  author = {Zeyun Zhong and Joya Chen and Manuel Martin and Frederik Diederichs and Juergen Gall and Jürgen Beyerer},
  title = {{Rethinking Expressivity and Efficiency in Test-Time Training}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=s9Npo5C1Sz},
}
Figure