SR-TTT: Surprisal-Aware Residual Test-Time Training

Swamynathan V P
2/26/2026
cs.LGcs.AIcs.CL

Official code: swamynathanvp/Surprisal-Aware-Residual-Test-Time-Training (1 star, MIT, last commit 2026-02-21).

Abstract

Test-Time Training (TTT) language models achieve theoretically infinite context windows with an O(1) memory footprint by replacing the standard exact-attention KV-cache with hidden state ``fast weights'' W_fast updated via self-supervised learning during inference. However, pure TTT architectures suffer catastrophic failures on exact-recall tasks (e.g., Needle-in-a-Haystack). Because the fast weights aggressively compress the context into an information bottleneck, highly surprising or unique tokens are rapidly overwritten and forgotten by subsequent token gradient updates. We introduce SR-TTT (Surprisal-Aware Residual Test-Time Training), which resolves this recall failure by augmenting the TTT backbone with a loss-gated sparse memory mechanism. By dynamically routing only incompressible, highly surprising tokens to a traditional exact-attention Residual Cache, SR-TTT preserves O(1) memory for low-entropy background context while utilizing exact attention exclusively for critical needles. Our complete implementation, training scripts, and pre-trained weights are open-source and available at: https://github.com/swamynathanvp/Surprisal-Aware-Residual-Test-Time-Training.

View on arXivView PDF

Code Implementations(1)

MIT
10PythonFeb 21, 20268 months agoMIT

Similar Papers

Cite this paper

@article{p2026srttt,
  title  = {SR-TTT: Surprisal-Aware Residual Test-Time Training},
  author = {Swamynathan V P},
  year   = {2026},
  eprint = {2603.06642},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2603.06642v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2603.06642.svg)](https://codeofpaper.com/paper/2603.06642)

Discussion