PreprintCited by 6

Memory Mosaics at scale

Zhang, Jianyu, Bottou, Léon·2025·arXiv

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.

AI snapshot

Written from the paper’s full text.

TL;DR

Memory Mosaics v2 scales associative-memory networks to llama-8B scale (10B parameters) and one trillion tokens, matching transformers on persistent-knowledge benchmarks while outperforming them on new-knowledge storage and in-context learning. The paper reports that these advantages are not easily replicated by simply training transformers on more data, with a 1T-token Memory Mosaics v2 still beating an 8T-token transformer on key new-task evaluations.

Key findings

  • On 19 common language benchmarks, Memory Mosaics v2 and transformers perform closely; on the 13 persistent-knowledge tasks, Memory Mosaics v2 large averages 56.8% versus transformer large 57.1%, and removing long-term memory after training barely changes performance (56.6% vs 56.8%).
  • On RULER multi-unrelated-documents question answering, Memory Mosaics v2 large trained at 4k context scores 59.3% at 4k task length versus transformer large 57.7%; after fine-tuning to 32k, Memory Mosaics v2 large scores 53.4% at 32k task length versus transformer large 41.1%, a 12.3% advantage (small models show 14.8%).
  • In-context learning on Banking77, Tacred, and Goemotion shows Memory Mosaics v2 outperforming transformers by more than 10%, and improving as more demonstration shots are provided, while transformers degrade with more shots; the advantage also appears with anonymous labels.
  • A transformer trained on 8T tokens still lags a 1T-token Memory Mosaics v2 by 6.5% on new-knowledge storage (46.9% vs 53.4%), and on anonymous-label in-context tasks more training data does not help transformers.
  • Fine-tuning: one mini-batch yields a 22% accuracy improvement for Memory Mosaics v2, two mini-batches reach optimal performance, while a transformer fine-tuned with 800 mini-batches still lags behind Memory Mosaics v2 fine-tuned with a single mini-batch.

Methods

  • Architecture: Memory Mosaics v2 replaces transformer attention with associative memories and adds three modifications: adaptive bandwidth in Gaussian kernel smoothing, a gated time-variant key feature extractor, and a 3-level memory design (short-term, long-term, persistent memory).
  • Training: small model is llama-1.5B scale (24 layers, 2048 hidden dimensions, 16 heads) trained on 200B tokens; large model is llama-8B scale (32 layers, 4096 hidden dimensions, 32 heads) trained on 1T tokens; both use 4,096 context length then fine-tune to 32,768 context length. Baseline transformers use the same configurations.
  • Evaluation: three dimensions—persistent-knowledge storage/retrieval on 19 common benchmarks (13 used after long-term-memory ablation), new-knowledge storage/retrieval on RULER multi-document QA, and in-context learning on multiclass classification tasks (Banking77, Tacred, Goemotion) with semantic and anonymous labels; additional analyses compare data scaling, FLOPs/parameters, context extrapolation, and fine-tuning speed.

Limitations

  • The paper states that hyperparameters were originally searched and optimized for the baseline transformer models and transferred to Memory Mosaics v2 without further hyperparameter searching, so the setup may be suboptimal for Memory Mosaics v2.
  • The paper states that model efficiency (service, throughput, VRAM) is not the goal of this work and that engineering work may be needed to adapt Memory Mosaics v2 to custom use cases or hardware.
  • Evident from the text: evaluation is limited to three specified dimensions and particular benchmarks, and the scaling analysis stops at 9.9B parameters and 1T training tokens; frontier-scale scaling is discussed only as a risk-return trade-off rather than demonstrated.

Model-written summary. Check it against the paper before relying on it.

Integrity signals

Registry

DataCite · 10.48550/arxiv.2507.03285

Cites

0 citation errors · 0 not checkable

Statistics

Nothing to recompute.

Claims the paper makes

9 of 19 cited sources checked · 1 supported · 0 flagged · accuracy not yet measured

  • Premisecitation
    § 3 Memory Mosaics v2 · p. 2

    Transformers show an induction head mechanism, that is, predict b after sequence [..., a, b, ..., a].

    “Transformers show an interesting induction head mechanism [Olsson et al., 2022], that is, predict b after sequence [ . . . , a, b, . . . , a ] .”
    Quote in the paperSubstantial claim1 of 1 sources checked
    • cites Olsson et al., 2022 source
  • Interpretationreasoning
    § 5.2 New-knowledge storage and retrieval · p. 6

    Local-window memory approaches (Alibi position encoding, sliding-window attention) also struggle on the multi-unrelated-documents question-answering task for the same reason.

    “Similarly, local-window memory approaches, such as Alibi position encoding Press et al. [2021] and sliding-window attention Beltagy et al. [2020], also struggle for the same reason.”
    Quote in the paperSubstantial claim2 of 2 sources checked
    • cites Press et al., 2021 source

      The Introduction (p. 1) identifies ALiBi as a method that penalizes attention to more distant tokens. Appendix B.2 (p. 24) suggests that ALiBi might not use contexts longer than those seen in training. The paper does not evaluate multi-unrelated-documents question answering or establish that ALiBi struggles on that task for the reason claimed. (LLM, conf=0.82)

      Experimental — accuracy not yet measured
    • cites Beltagy et al., 2020 source

      Section 3.1 (pp. 3–4) identifies sliding-window attention as a Longformer mechanism and says windowed attention alone is not flexible enough for task-specific representations, motivating global attention. The paper does not report that sliding-window attention struggles on the specific multi-unrelated-documents question-answering task or establish the cited sentence’s “same reason.” (LLM, conf=0.84)

      Experimental — accuracy not yet measured
  • Findingcitation
    § D Failures of memory compression baselines · p. 15

    Memory compression methods perform poorly on RULER long-context tasks as the required context length increases.

    “It is clear that memory compression methods perform poorly as the required context length (i.e., required information storage space) increases.”
    • Also stated in: § D Failures of memory compression baselines · p. 15 · plain
      “memory compression methods perform poorly as the required context length increases. Numbers are copied from Hsieh et al. [2024] Figure 4.”
    Quote in the paperSubstantial claim1 of 1 sources checked
    • cites Hsieh et al., 2024

      The Experiments & Results section (p. 6) reports that the evaluated models generally lose performance on RULER as sequence length increases. But it does not identify those models as memory-compression methods or report a result specifically for such methods; Related Work (p. 3) mentions compression as a separate approach. (LLM, conf=0.85)

      Experimental — accuracy not yet measured
  • Interpretationreasoning
    § D Failures of memory compression baselines · p. 15

    Many memory compression algorithms (RNNs, xLSTM, rwkv, state-space models) fail on new-task storage and retrieval and in-context learning evaluation dimensions by construction.

    “Many memory compression algorithms, such as RNNs, xLSTM [Beck et al., 2025], rwkv [Peng et al., 2023], and state-space models [Gu and Dao, 2023], fail on new-task storage and retrieval and in-context learning evaluation dimensions by construction.”
    Quote in the paperSubstantial claim2 of 3 sources checked
    • cites Beck et al., 2025

      Couldn’t be matched to a paper in Crossref, so it can’t be checked.

    • cites Peng et al., 2023 source

      The Limitations section (page unavailable) says RWKV's recurrent architecture limits its ability to look back at previous tokens and may impair recall of details over very long contexts. The paper does not establish that RWKV fails new-task storage and retrieval or in-context learning evaluations by construction; its claim about impaired recall is qualified rather than categorical. (LLM, conf=0.87)

      Experimental — accuracy not yet measured
    • cites Gu and Dao, 2023 source

      Section 3.1 says time-invariant models struggle with selective copying and context-dependent retrieval because their fixed dynamics cannot select information from context. But the claim extends that limitation to state-space models generally: the paper introduces a selective state-space model to address it, and its Induction Heads results report that Mamba learned the task. The source therefore does not support saying state-space models fail these dimensions by construction. (LLM, conf=0.88)

      Experimental — accuracy not yet measured
  • Interpretationreasoning
    § 5.2 New-knowledge storage and retrieval · p. 6

    Many memory compression algorithms (RNNs, xLSTM, rwkv, state-space models) fail on the multi-unrelated-documents question-answering task by construction because they cannot store all articles before reading the question.

    “Many memory compression algorithms, such as RNNs, xLSTM [Beck et al., 2025], rwkv [Peng et al., 2023], and state-space models [Gu and Dao, 2023], fail on this task by construction because they cannot store all articles before reading the question.”
    Quote in the paperSubstantial claim2 of 3 sources checked
    • cites Beck et al., 2025

      Couldn’t be matched to a paper in Crossref, so it can’t be checked.

    • cites Peng et al., 2023 source

      The paper’s “9 Limitations” section says RWKV’s recurrent architecture limits its ability to look back at previous tokens and may impair recall of details over very long contexts. Section L also says it cannot retrospectively readjust the weight of earlier information. Neither section establishes that RWKV fails the specified multi-document question-answering task by construction or cannot store all the articles before seeing the question. (LLM, conf=0.85)

      Experimental — accuracy not yet measured
    • cites Gu and Dao, 2023 source

      Section 3.1 describes recurrent models as compressing context into a finite state and says their effectiveness depends on how well that state preserves necessary information. It does not address the multi-unrelated-documents question-answering task or establish that state-space models necessarily fail it because they cannot store every article before the question arrives. (LLM, conf=0.86)

      Experimental — accuracy not yet measured
  • May combine two claims. 9
  • Classified as probably not a substantial claim. 6
  • May combine two claims.

    Findingown data
    § 6.1 Comparison of two approaches · p. 10

    For anonymous label in-context learning tasks, more training data cannot help transformers; transformers trained on 8T tokens exhibit degraded performance.

    “However, for the more challenging anonymous label tasks, more training data cannot help transformers. Contour-intuitively, transformers trained on more training data (8T) exhibit a degraded performance on anonymous label tasks (Figure 7).”
    • Also stated in: § 6.1 Comparison of two approaches · p. 10 · plain
      “Sadly, transformers trained on 8T (dash red line) still lag behind memory mosaics v2 trained on 1T (solid blue line) by a large margin.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingown data
    § 5.2 New-knowledge storage and retrieval · p. 7

    Memory mosaics v2 trained on 4k context length outperform transformers on 4k length and perform well after extrapolating context length ×4 to ×8 times without fine-tuning or adaptation.

    “In contrast, memory mosaics v2, trained on 4k context length, not only outperform transformers on 4k length, but also perform well after extrapolating context length × 4 ∼ × 8 times without any fine-tuning or adaptation.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingnone given
    § 5.2 New-knowledge storage and retrieval · p. 6

    The typical needle-in-a-haystack task is too easy, resulting in many models achieving near-perfect performance.

    “The typical 'needle-in-a-haystack' task is too easy, resulting in many models achieving near-perfect performance.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingown data
    § H Additional results for in-context learning · p. 18

    Memory mosaics v2 benefits from more demonstration shots, unlike transformers.

    “Meanwhile, memory mosaics v2 benefits from more demonstration shots (x-axis), unlike transformers.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Interpretationcitation
    § 2 Background on Associative Memory · p. 2

    Associative memory in Equation 3 is closely connected to attention when all key vectors share the same squared norm.

    “Associative memory in Equation 3 is closely connected to attention [Bahdanau et al., 2015] when all key vectors k i share the same squared norm.”
    Quote in the paperNot a substantial claim0 of 1 sources checked
    • cites Bahdanau et al., 2015

      Couldn’t be matched to a paper in Crossref, so it can’t be checked.

  • Probably not a substantial claim: may not pass S3 (load-bearing). May combine two claims.

    Study design and conductreasoning
    § C Training details · p. 14

    The hyperparameters were originally searched and optimized for the baseline transformer models, and transferred to memory mosaics v2 without further hyperparameter searching; thus the setup may be suboptimal for memory mosaics v2.

    “It is worth noting that these hyperparameters were originally searched and optimized for the baseline transformer models. We transfer these hyperparameters to memory mosaics v2 without further hyperparameter searching. Thus, it is possible that this hyperparameter setup is suboptimal for memory mosaics v2.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S4 (based).

    Interpretationnone given
    § 2 Background on Associative Memory · p. 2

    The differences of associative memory from attention (L2 normalized key vectors with an explicit bandwidth, a symmetric kernel, and absence of explicit position encoding) contribute to superior compositional and in-context learning capabilities in memory mosaics.

    “These differences further contribute to the superior compositional capabilities and in-context learning capabilities in memory mosaics.”
    Quote in the paperNot a substantial claim
  • Classified as probably not a substantial claim.

    Interpretationnone given
    § G Additional results on new-knowledge storage and retrieval · p. 17

    The stochastic long-term memory size training setup is used to encourage the allocation of position-invariant signals and position-dependent signals to long-term and short-term memories.

    “This stochastic long-term memory size setup is used to encourage the allocation of position-invariant signals and position-dependent signals to long-term and short-term memories.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Interpretationreasoning
    § 3 Memory Mosaics v2 · p. 3

    This design allows memory mosaics to get rid of explicit position encoding, use the same key as query, and perform induction head with only one layer.

    “This simple designer allows memory mosaics to get ride of explicit position encoding, use the same key as query, perform induction head with only one layer.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing), S4 (based).

    Interpretationnone given
    § 2 Background on Associative Memory · p. 2

    The size of associative memory (the number of key-value examples) is analogous to the sequence length in attention.

    “Moreover, the size of associative memory (i.e., the number of key-value examples) is analogous to the sequence length in attention.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Interpretationown data
    § 5.1 Persistent-knowledge storage and retrieval · p. 5

    Both memory mosaics v2 and transformers are capable of effectively storing and retrieving persistent knowledge.

    “The results (Table 1) show that memory mosaics v2 and transformers perform similarly in this evaluation dimension, suggesting that both models are capable of effectively storing and retrieving persistent knowledge.”
    Quote in the paperSubstantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing). May combine two claims.

    Interpretationreasoning
    § 5.1 Persistent-knowledge storage and retrieval · p. 5

    The close performance on the 19 common language benchmarks is expected because both models share the same persistent memory architecture.

    “This is expected since both models share the same persistent memory architecture.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Interpretationown data
    § 8 Discussion and future direction · p. 10

    This work scales memory mosaics (named memory mosaics v2) to llama-8B scale, demonstrating superior performance on new task learning, outperforming transformers by more than 10%.

    “This work scales memory mosaics (named memory mosaics v2) to llama-8B scale, demonstrating superior performance on new task learning, outperforming transformers by more than 10%.”
    Quote in the paperSubstantial claim
13 of 13
  • The authors state this as an assumption.

    Key-value pairs in an associative memory are permutation invariant.

    “The key-value pairs are stored in a set, and thus can be assumed to be permutation invariant.”
  • The paper relies on this without support.

    There is a lack of clear understanding of how current transformers achieve compositional and in-context learning capabilities, and why earlier models were unable to.

    “However, we still lack a clear understanding of how current transformers achieve these capabilities, and why earlier models were unable to.”
  • The paper relies on this without support.

    Memory-based methods are lazy methods.

    “(Note that memory-based methods are lazy methods).”
  • The paper relies on this without support.

    Humanity is running out of training data for language models.

    “Moreover, a serious problem occurs: we are running out of data!”
  • The paper relies on this without support.

    New task learning ability is a critical capability for language models.

    “demonstrating superior performance on new task learning, outperforming transformers by more than 10%”
    “particularly focusing on the new task learning”
5 of 5

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

Each contradiction between two passages listed here was confirmed by an independent check.

  • The conditional expectation reverses keys and values

    Minor

    The paper defines retrieval as estimating values conditional on keys, P(V|K), but the footnote says the same smoothing converges to E(K|V), which conditions in the opposite direction.

1 of 1

Cites

Flagged first, then by citations

Research works printed but not linked: 5

  1. Pierre Comon. Independent component analysis, a new concept? Signal processing , 36(3):287-314, 1994.
  2. V. Vapnik. Principles of risk minimization for learning theory. In J. Moody, S. Hanson, and R.P. Lippmann, editors, Advances in Neural Information Processing Systems , volume 4. MorganKaufmann, 1991.
  3. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems , 30, 2017.
  4. Geoffrey S. Watson. Smooth regression analysis. Sankhy¯ a: The Indian Journal of Statistics, Series A , pages 359-372, 1964.
  5. Yuhao Zhang, Victor Zhong, Danqi Chen, Gabor Angeli, and Christopher D. Manning. Positionaware attention and supervised data improve slot filling. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing (EMNLP 2017) , pages 35-45, 2017.

Cited by

Sorted by citations

Authors
Zhang, J., & Bottou, L.
Venue
arXiv
Publisher
arXiv
Published
2025
Type
Preprint

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Claims read by deepseek-v4.1-flash under definition version 3 (extract-v3) on 2026-10-08.

Classified by jev-1.13-20260917 (gold-guideline-v0.2) on 2026-10-08.

Cited sources are checked by gpt-6-sol.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review