Titans: Learning to Memorize at Test Time
Summary
Treats attention as short-term memory and a deep MLP as long-term memory updated by surprise (gradient of associative ||M(k)-v||^2) with momentum and adaptive forget/weight-decay, plus persistent task tokens. Three hybrids: MAC, MAG, MAL. 760M MAG Wiki ppl 18.61 vs Transformer++ 25.21 and Gated DeltaNet-H2 19.88; MAC best on long-context NIAH. BABILong MAC beats GPT-4 and Llama3.1-8B+RAG at far fewer params. Claims >2M context. Code "available soon" on abs.
- Venue
- arXiv / Google
- Purpose
- Learn a neural long-term memory at test time and fold it into attention as context, gate, or layer
- Scale
- 170M/340M/400M on 15B FineWeb-Edu tokens; 760M on 30B; S-NIAH 2k–16k; BABILong few-shot and FT; DNA GenomicsBenchmarks; ETT/ECL/Traffic/Weather
- Time period
- 2024-12-31 (arXiv 2501.00663 v1). HF paper publishedAt 2024-12-31.
- Added
- Oct 1, 2026
- Research status
- done
From the source
- Published
- Dec 31, 2024
- arXiv categories
- cs.LG, cs.AI, cs.CL
- Citations
- 361 (42 influential)
- References
- 135
- Published in
- Neural Information Processing Systems
Abstract (from arXiv)
Over more than a decade there has been an extensive research effort on how to effectively utilize recurrent models and attention. While recurrent models aim to compress the data into a fixed-size memory (called hidden state), attention allows attending to the entire context window, capturing the direct dependencies of all tokens. This more accurate modeling of dependencies, however, comes with a quadratic cost, limiting the model to a fixed-length context. We present a new neural long-term memory module that learns to memorize historical context and helps attention to attend to the current context while utilizing long past information. We show that this neural memory has the advantage of fast parallelizable training while maintaining a fast inference. From a memory perspective, we argue that attention due to its limited context but accurate dependency modeling performs as a short-term memory, while neural memory due to its ability to memorize the data, acts as a long-term, more persistent, memory. Based on these two modules, we introduce a new family of architectures, called Titans, and present three variants to address how one can effectively incorporate memory into this architecture. Our experimental results on language modeling, common-sense reasoning, genomics, and time series tasks show that Titans are more effective than Transformers and recent modern linear recurrent models. They further can effectively scale to larger than 2M context window size with higher accuracy in needle-in-haystack tasks compared to baselines.
Tags
Topics
long-context memory, test-time training, hybrid architectures
Research notes
- Primary: arxiv abs (cs.LG; also cs.AI, cs.CL). License not stated on abs/HTML at check. Google Research; correspondence {alibehrouz, peilinz, mirrokni}@google.com. No official code on abs (authors say coming soon). HF paper page 31 upvotes; 4 unofficial linked models and 2 unofficial datasets not copied into hf_* fields and not substantial, so no datasets_local row. Trains on FineWeb-Edu / Pile slices rather than releasing a new corpus. Discord posted abs.
Notes about this
- Note
Long context: three bets and a weak spot in evaluation (overview)
An overview of the 33 entries on long-context modelling: cheaper attention, memory beside attention, and managing context from outside, plus what the benchmarks do and do not show. Written by Claude Opus 5.5.
Cites, within this collection
Cited by, within this collection
- Memory Caching: RNNs with Growing Memory
- Metis: Memory Foundation Model
- Language Models Need Sleep: Learning to Self-Modify and Consolidate Memories
- Parallax: Parameterized Local Linear Attention for Language Modeling
- Infinite-Parameter LLMs: Generating and Adapting Weights from Live Data
- Nested Learning: The Illusion of Deep Learning Architecture
Similar entries
- Paper Let's (not) just put things in Context: Test-Time Training for Long-Context LLMs
- Paper Balancing Memory Pathways: Analyzing and Improving Memory Utilization in Hybrid LMs
- Paper LongHarness Bench: Stress-Testing Language Model Harnesses for Long-Context Reasoning
- Paper Triadic Linear Attention: Three-Dimensional Recurrent States for Long-Context Sequence Modeling
- Paper MoBA: Mixture of Block Attention for Long-Context LLMs
- Paper Context Language Models