# Titans: Learning to Memorize at Test Time

- **ID:** 550
- **Kind:** paper
- **URL:** https://arxiv.org/abs/2501.00663
- **Authors:** Ali Behrouz, Peilin Zhong, Vahab Mirrokni
- **Venue:** arXiv / Google
- **Published:** 2025
- **Tags:** titans, test-time-memory, surprise, mac, mag, mal, long-context, mamba, ttt, google
- **Topics:** long-context memory, test-time training, hybrid architectures
- **Added:** 2026-10-01
- **Research status:** done
- **Page:** https://papers.projxon.ai/entries/550

## 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.

## Attributes

- **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.

## From the source (fetched 2026-10-03)

- **Published:** Dec 31, 2024 (arXiv)
- **arXiv categories:** cs.LG, cs.AI, cs.CL (arXiv)
- **Citations:** 361 (42 influential) (Semantic Scholar)
- **References:** 135 (Semantic Scholar)
- **Published in:** Neural Information Processing Systems (Semantic Scholar)

## Abstract

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.

## 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.

## Cites, within this collection

- [Eagle and Finch: RWKV with Matrix-Valued States and Dynamic Recurrence](https://papers.projxon.ai/entries/560) (paper 2024, #560)
- [Leave No Context Behind: Efficient Infinite Context Transformers with Infini-attention](https://papers.projxon.ai/entries/564) (paper 2024, #564)
- [Hymba: A Hybrid-head Architecture for Small Language Models](https://papers.projxon.ai/entries/918) (paper 2024, #918)

## Cited by, within this collection

- [Memory Caching: RNNs with Growing Memory](https://papers.projxon.ai/entries/461) (paper 2026, #461)
- [Metis: Memory Foundation Model](https://papers.projxon.ai/entries/466) (paper 2026, #466)
- [Language Models Need Sleep: Learning to Self-Modify and Consolidate Memories](https://papers.projxon.ai/entries/487) (paper 2026, #487)
- [Parallax: Parameterized Local Linear Attention for Language Modeling](https://papers.projxon.ai/entries/497) (model 2026, #497)
- [Infinite-Parameter LLMs: Generating and Adapting Weights from Live Data](https://papers.projxon.ai/entries/724) (paper 2026, #724)
- [Nested Learning: The Illusion of Deep Learning Architecture](https://papers.projxon.ai/entries/1109) (paper 2025, #1109)

## Related entries

- Discussed in: [Long context: three bets and a weak spot in evaluation (overview)](https://papers.projxon.ai/entries/1208) (note, #1208)

## Similar entries

- [Let's (not) just put things in Context: Test-Time Training for Long-Context LLMs](https://papers.projxon.ai/entries/533) (paper, #533)
- [Balancing Memory Pathways: Analyzing and Improving Memory Utilization in Hybrid LMs](https://papers.projxon.ai/entries/1282) (paper, #1282)
- [LongHarness Bench: Stress-Testing Language Model Harnesses for Long-Context Reasoning](https://papers.projxon.ai/entries/821) (paper, #821)
- [Triadic Linear Attention: Three-Dimensional Recurrent States for Long-Context Sequence Modeling](https://papers.projxon.ai/entries/1244) (paper, #1244)
- [MoBA: Mixture of Block Attention for Long-Context LLMs](https://papers.projxon.ai/entries/707) (paper, #707)
- [Context Language Models](https://papers.projxon.ai/entries/793) (paper, #793)
