arXiv(opens in a new tab)cs.LGAug 2026Cited by 2 papers on PaperVantage

Manuscript Offprint

arXiv:2608.21308

Rethinking Expressivity and Efficiency in Test-Time Training

Zeyun Zhong, Joya Chen, Manuel Martin, Frederik Diederichs, Juergen Gall, Juergen Beyerer

Abstract

Test-Time Training (TTT) enables long-context processing via continuous weight updates during inference, but current methods struggle to balance the expressivity of per-token update dynamics with the hardware efficiency of chunk-wise approximations. We propose E2-TTT (Expressive and Efficient TTT) to bridge this gap. Under the standard approximation of taking gradients at the chunk-start weights, we derive a closed-form state transition that exactly reproduces the chunk-end fast-weight and momentum states of the per-token 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 E2-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×8\times the training context length. Meanwhile, E2-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.

1 Introduction

Many applications of large language models (LLMs), including long-horizon agentic tasks [16], require processing contexts that grow continually over time. Standard Transformers retain this history in a key–value (KV) cache [34] and repeatedly attend over it [56], causing memory and computation costs to grow with sequence length. External agent-memory systems mitigate this burden by organizing and selectively retrieving past experiences [60], but the retrieved memories must still be reintroduced into the model context and therefore do not change the underlying attention and KV-cache scaling. This motivates architectures that can incorporate incoming information online into a compact recurrent state [21, 31, 49, 51], rather than explicitly retaining every preceding token.

Compact-state models, including linear attention [31, 63], state-space models (SSMs) [13, 21], and recurrent components of hybrid architectures [32, 44], compress history into a fixed-size recurrent state for linear-time processing and parallel training. Gated delta-rule variants enable selective forgetting and targeted overwriting [61], but finite state capacity still causes memory collisions [10]. From a test-time regression perspective, Gated DeltaNet and test-time training (TTT) share an online-learning interpretation [57, 61]: the former updates a linear associative memory, whereas parametric TTT can use nonlinear learners such as MLPs and different online optimizers [51]. Both remain fixed-size states [51, 61], although deep nonlinear fast-weight memories have shown promise in language modeling and long-context retrieval [8, 7] and multimodal generation [12].

Along the update-granularity spectrum, token-wise TTT lies at the most expressive end [8, 51]: online gradient descent evaluates each token’s gradient at fast weights shaped by all preceding updates, yielding a larger effective search space than batch gradient descent [51], while replacing token-dependent learning-rate, momentum, and decay factors with chunk-shared values loses expressive power [8]. This fine-grained state dependence, however, makes the inner loop sequential [51, 53], and small update batches lead to poor parallelism and low hardware utilization [66]. LaCT adopts the opposite operating point, computing the gradient of a summed loss over a large chunk and performing one fast-weight update per chunk, thereby substantially improving GPU utilization [66]. However, all tokens within a chunk share the same fast weight and the TTT branch lacks per-token causality, which LaCT supplements with sliding-window attention [66].

Motivated by this trade-off, we introduce E2-TTT (Expressive and Efficient TTT), a chunk-parallel update that preserves per-token learning rate, momentum, and decay. Following prior mini-batch and chunk-wise TTT formulations [51, 66], we evaluate all per-token gradients at the chunk-start fast weights. Under this setting, we derive two closed-form scalar kernels that exactly reproduce the chunk-end fast-weight and momentum states of the corresponding token-wise recurrence. The kernels depend only on per-token scalars and are computed in parallel by log-space cumulative sums, then applied through two weighted gradient aggregations, eliminating the sequential fast-weight recurrence without materializing intermediate matrix states while retaining chunk-level hardware efficiency. We instantiate E2-TTT in a hybrid architecture in which sliding-window attention captures fine-grained local interactions and the TTT state compresses history across chunks.

We empirically validate E2-TTT by training models of up to 1.3B parameters from scratch on 15B tokens from the HuggingFace FineWeb-Edu dataset [43], comparing against strong linear attention and hybrid baselines. Our evaluation spans general language modeling, in-context retrieval, and length extrapolation, where the gains concentrate in the retrieval and extrapolation regimes. Notably, our model exhibits strong robustness in length extrapolation, maintaining >90%>90\% accuracy on passkey retrieval in the standard “Needle in a Haystack” test at 8×8\times the training context, a regime where prior chunk-based methods collapse. Finally, we explore the versatility of our approach through parameter-efficient adaptation for long-context video understanding, achieving performance comparable to full fine-tuning at the 2B-parameter scale on standard multimodal benchmarks. Overall, we demonstrate the benefit of expressive sequential updates while matching the training throughput of standard chunk-wise TTT, offering novel insights into the TTT paradigm.

References (56)