For Better or for Worse, Transformers Seek Patterns for Memorization
Madhur Panwar, Gail Weiss, Navin Goyal, Antoine Bosselut
Abstract
Memorization in language models is a critical yet poorly understood phenomenon. In this work, we investigate memorization in transformer-based language models by analyzing their memorization dynamics during training over multiple epochs. We find that memorization is neither a constant accumulation of sequences nor simply dictated by the recency of exposure to these sequences. Instead, much like generalization, memorization appears to be driven by pattern recognition. Tracking memorization dynamics in mixed datasets, we observe that models memorize different sub-datasets in distinct bursts, suggesting that each subset is associated with unique underlying patterns, and that the model prefers to learn these patterns in a consistent order. We also find that easily learnable patterns tend to support generalization on unseen data, while more complex patterns do not. Furthermore, in datasets with weak or absent patterns, larger models may delay memorization relative to smaller ones, a behavior we term overthinking . Our results show that the subset of sequences memorized by a model over time is not arbitrary, and give insights into the internal processes a model goes through during training. Our code is available at: https://github.com/mdrpanwar/memorization-patterns .
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
Lineage
- Quantifying Memorization Across Neural Language Models cites Deduplicating Training Data Makes Language Models Better
- Quantifying Memorization Across Neural Language Models cites Counterfactual Memorization in Neural Language Models
- Counterfactual Memorization in Neural Language Models cites Quantifying Memorization Across Neural Language Models
- Quantifying Memorization Across Neural Language Models cites Extracting Training Data from Large Language Models
- The Privacy Onion Effect: Memorization is Relative cites Extracting Training Data from Large Language Models
- Deduplicating Training Data Makes Language Models Better cites Extracting Training Data from Large Language Models
- Counterfactual Memorization in Neural Language Models cites Deduplicating Training Data Makes Language Models Better
- Counterfactual Memorization in Neural Language Models cites Extracting Training Data from Large Language Models
Builds on15
- Extracting Training Data from Large Language ModelsNicholas Carlini, Florian Tramèr, Eric Wallace, Matthew Jagielski et al.USENIX Security 2021 · 2,866 citations
- Deduplicating Training Data Makes Language Models BetterKatherine Lee, Daphne Ippolito, Andrew Nystrom, Chiyuan Zhang et al.ACL 2022 · 844 citations
- Counterfactual Memorization in Neural Language ModelsChiyuan Zhang, Daphne Ippolito, Katherine Lee, Matthew Jagielski et al.NeurIPS 2023 · 184 citations
- The Privacy Onion Effect: Memorization is RelativeNicholas Carlini, Matthew Jagielski, Chiyuan Zhang, Nicolas Papernot et al.NeurIPS 2022 · 175 citations
- Quantifying Memorization Across Neural Language ModelsNicholas Carlini, Daphne Ippolito, Matthew Jagielski, Katherine Lee et al.ICLR 2023 · 158 citations
Related papers
- Memorization Without Overfitting: Analyzing the Training Dynamics of Large Language ModelsKushal Tirumala, Aram H. Markosyan, Luke Zettlemoyer, Armen AghajanyanNeurIPS 2022 · 304 citations
- Position Paper: MeMo: Towards Language Models with Associative Memory MechanismsFabio Massimo Zanzotto, Elena Sofia Ruzzetti, Giancarlo A. Xompero, Leonardo Ranaldi et al.ACL Findings 2025
- Provable Memorization Capacity of TransformersJunghwan Kim, Michelle Kim, Barzan MozafariICLR 2023
- Recite, Reconstruct, Recollect: Memorization in LMs as a Multifaceted PhenomenonUSVSN Sai Prashanth, Alvin Deng, Kyle O'Brien, Jyothir S. V et al.ICLR 2025
- A Multi-Perspective Analysis of Memorization in Large Language ModelsBowen Chen, Namgi Han, Yusuke MiyaoEMNLP 2024 · 2 citations
