Introduction
While Transformers have dominated the landscape of large language models, their internal mechanisms for in-context learning (ICL) remain inefficient and opaque. Transformers often struggle with extremely long contexts or out-of-distribution tasks. To address these challenges, researchers have introduced Memory Mosaics v2, a scaled-up architecture based on associative memories. By replacing the traditional attention mechanism with transparent key-value associative memories, Memory Mosaics aim to provide a more interpretable and data-efficient path to intelligence.
Methods: Scaling Associative Memories
The core of the Memory Mosaic architecture is the use of associative memory to retrieve past information based on current keys. Unlike the asymmetric $Q$ and $K$ matrices in Transformers, this model utilizes symmetric keys and queries.
To scale to 10 billion parameters, Memory Mosaics v2 introduces three critical upgrades:
- Adaptive Bandwidth: A learnable schedule that automatically adjusts the search width in kernel regression based on the number of examples.
- Gated Time-Variant Key Extractor: A recurrent-style gating mechanism that produces semantically aware keys by incorporating sequence history.
- 3-Level Memory Design: The architecture explicitly partitions knowledge into three distinct tiers:
- Short-term memory: Focuses on immediate, nearby tokens.
- Long-term memory: Handles distant context by skipping the immediate past.
- Persistent memory: Stores global facts from training data using standard feed-forward layers.
Key Results and Performance
Memory Mosaics v2 were evaluated against Llama-style Transformer baselines across a variety of benchmarks, including MMLU, GSM8K, and HumanEval.
- General Capability: The 10B parameter Memory Mosaic matched the Transformer baseline on 19 standard benchmarks, achieving an average score of approximately 52.2%.
- Long-Context Retrieval: On the RULER benchmark (32k tokens), Memory Mosaics outperformed Transformers by a significant margin of 12.3% to 14.8%.
- In-Context Learning (ICL): In tasks like intent detection (Banking77) and sentiment analysis (Goemotion), Memory Mosaics maintained a lead of over 10% in accuracy.
- Data Efficiency: Remarkably, a Memory Mosaic trained on 1 trillion tokens outperformed a Transformer trained on 8 trillion tokens in learning new tasks, suggesting that the architecture's native retrieval capabilities are far more efficient than the simulated retrieval in Transformers.
Insights and Future Directions
The success of Memory Mosaics v2 highlights the potential of structural transparency. The explicit separation of memory types allows researchers to pinpoint which components drive specific tasks, such as long-context QA versus persistent fact retrieval. Furthermore, these models exhibit superior context extrapolation, moving from 4k to 32k context lengths without additional fine-tuning.
However, challenges remain. Future work will focus on improving computational efficiency for extremely long sequences—perhaps through fuzzy hashing—and optimizing training recipes specifically for this unique architecture rather than relying on Transformer-centric hyperparameters.
Summary updated