Memory Mosaics at scale
Jianyu Zhang, Léon Bottou
TL;DR
This work presents Memory Mosaics v2, a scalable associative-memory-based architecture that extends memory mosaics to llama-8B with one trillion tokens to enhance new-task learning and in-context learning. By introducing adaptive bandwidth, a gated time-variant key extractor, and a 3-level memory, the approach achieves superior new-knowledge storage and in-context learning compared to transformers, often with less data and comparable or lower compute. The authors propose three evaluation dimensions—persistent-knowledge storage, new-knowledge storage, and in-context learning—to precisely diagnose capabilities, and show that Memory Mosaics v2 surpasses transformer baselines on challenging tasks like ruler QA and in-context learning benchmarks, while maintaining competitive or worse on persistent benchmarks. A risk–return analysis suggests smart architectural innovations can outperform mere data scaling, and highlights future directions for long-context efficiency and broader applicability in real-world tasks.
Abstract
Memory Mosaics [Zhang et al., 2025], networks of associative memories, have demonstrated appealing compositional and in-context learning capabilities on medium-scale networks (GPT-2 scale) and synthetic small datasets. This work shows that these favorable properties remain when we scale memory mosaics to large language model sizes (llama-8B scale) and real-world datasets. To this end, we scale memory mosaics to 10B size, we train them on one trillion tokens, we introduce a couple architectural modifications ("Memory Mosaics v2"), we assess their capabilities across three evaluation dimensions: training-knowledge storage, new-knowledge storage, and in-context learning. Throughout the evaluation, memory mosaics v2 match transformers on the learning of training knowledge (first dimension) and significantly outperforms transformers on carrying out new tasks at inference time (second and third dimensions). These improvements cannot be easily replicated by simply increasing the training data for transformers. A memory mosaics v2 trained on one trillion tokens still perform better on these tasks than a transformer trained on eight trillion tokens.
