Native Scalable Memory Models with Transformers

Ziyang Xu, Lucia Cascone, Aniello Castiglione, Michele Nappi, Wenyu Liu, Xinggang WangarXiv 2026

TL;DR

Vision Transformers (ViTs) are phenomenal at analyzing static images, but watching a continuous video requires remembering the past without letting compute costs explode. This paper introduces the Memory Transformer (MeT), which weaves lightweight, recurrent memory directly into a ViT’s spatial hierarchy. Crucially, it decouples memory capacity from model size, giving engineers a brand-new knob to dial up video understanding accuracy with virtually zero extra latency per frame.

What Problem Does This Paper Address?

Imagine trying to tell if someone is pretending to turn a cup upside down versus actually doing it, but you are only allowed to look at one freeze-frame at a time with total amnesia in between. That is a framewise ViT.

To give ViTs a sense of time, researchers usually choose between two compromises:

  1. Spatiotemporal attention or activation caching: Look at all frames at once or hoard past activations. This works great for short clips, but memory and compute grow alongside the video length—bad news for continuous streaming.
  2. External memory heads: Slap a recurrent module onto the very end of a frozen image encoder. This keeps memory bounded, but the visual backbone itself remains temporally blind while forming its features.

The authors ask: How can we build persistent, bounded memory directly into the spatial backbone of a ViT—and scale that memory independently without making the whole network wider or deeper?

Methods

MeT takes a standard ViT backbone (pretrained on ImageNet-1K) and interleaves Native Memory Blocks after specific spatial Transformer blocks—every third block by default (e.g., after blocks 3, 6, 9, and 12 in Small/Base models).

While the spatial ViT blocks do their usual job mixing patches within the current frame, the memory blocks maintain a distinct recurrent hidden state for every spatial patch position and the global classification (CLS) token across time:

  • PreLN-GRU Core: After testing modern linear recurrences (RG-LRU), sliding-window attention, and slot-based memory, the humble Gated Recurrent Unit (GRU) with LayerNorm won out.
  • Independent Memory Width ($H$): If the ViT’s spatial feature width is $D$, the memory module normalizes the token, projects it into a GRU of hidden width $H$, and projects the normalized readout back to $D$ via a zero-initialized residual connection. Because $H$ is decoupled from $D$, you can widen the memory without touching the spatial backbone.
  • Shared Weights, Distinct States: Within a given layer, all token positions share the exact same GRU parameters, keeping parameter counts low while allowing every patch location to track its own history. At the very final block, only the CLS token updates its memory before prediction.

Because updates only depend on the current frame and the immediately preceding hidden state, inference is strictly causal (online-ready) and memory stays strictly bounded no matter how long the video runs.

Datasets

No new benchmarks are introduced; the authors evaluate on two classic, complementary video datasets (initialized from ImageNet-1K weights):

  • THUMOS14: Used for causal online action recognition (predicting what action is happening right now at 4Hz using only current and past frames across 20 classes).
  • Something-Something v2 (SSv2): A 174-class clip-classification benchmark famous for testing fine-grained temporal common sense (e.g., "moving two things closer" vs. "colliding").

Key Insights and Ideas

  • A New Scaling Law for Vision: Scaling up memory width ($H$) at a fixed ViT backbone reliably boosts accuracy across Small, Base, and Large models. Better yet, because GPU operations for wider token-level GRUs parallelize cleanly, per-frame latency stays practically flat (varying by just ~0.03 ms/frame within each model size!).
  • Where You Remember Matters: Only giving memory to the CLS token starves the model of fine spatial motion. Updating both patch and CLS tokens at intermediate layers lets spatial self-attention in subsequent blocks mix historical clues across different parts of the image. Conversely, putting memory after every single ViT block bloats state size by over $3\times$ without beating a spaced 4-stage layout on THUMOS14.
  • Classic Gating Beats Fancy Alternatives: Despite the recent hype around linear state-space models and slot attention, non-linear gating via a PreLN-GRU outperformed RG-LRU, Window Attention, and Slot Memory by at least 1.30 mAP on THUMOS14 and 1.69% Top-1 on SSv2.

Key Results

  • Punching Way Above Its Weight: MeT-Small beats a standard ViT-Large on both THUMOS14 (44.93 vs. 42.53 mAP) and SSv2 (55.66% vs. 31.57% Top-1) while using less than one-tenth of the parameters (25.8M vs. 303.3M) and per-frame FLOPs.
  • Crushing the State-of-the-Art: Compared to the recurrent vision transformer TRecViT-Large, MeT-Large improves accuracy by +2.28 mAP on THUMOS14 (reaching 49.22) and +4.17% Top-1 on SSv2 (reaching 58.48%), while using 92.7% less persistent state (5.66 MB vs. 77.46 MB per video stream) and running ~3.0$\times$ faster during causal framewise inference (6.18 ms vs. 18.46 ms per frame).
  • Qualitative Nuance: MeT cleanly separates action intervals from background noise in untrimmed videos and resolves visually tricky temporal dynamics, like distinguishing approaching objects from actual collisions.

Limitations and Future Work

Not discussed in the paper. (The authors do not include a dedicated limitations or future work section in the main text, though one apparent architectural trait from their tables is that retaining token-level states requires slightly more memory per stream—0.91 to 5.66 MB—than ultra-minimalist head-only recurrent models like MiniROAD at 0.004 MB, trading a few megabytes of VRAM for substantially higher accuracy).

Summary updated

BibTeX
@misc{xu2026native,
  author = {Ziyang Xu and Lucia Cascone and Aniello Castiglione and Michele Nappi and Wenyu Liu and Xinggang Wang},
  title = {{Native Scalable Memory Models with Transformers}},
  year = {2026},
  eprint = {2611.37432},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.37432},
}
Figure