Introduction
It is a well-known phenomenon that Large Language Models (LLMs) memorize portions of their training data. While this is crucial for learning factual knowledge and generalizing to certain tasks, it also introduces severe privacy and security vulnerabilities, such as the risk of extracting sensitive personal data.
Most prior work has studied memorization by probing fully trained models. However, there is a significant gap in our understanding of the training dynamics of memorization. How quickly do models memorize data? Do larger models memorize differently than smaller ones? And how does a model "forget" data it has already seen as it continues to train on new data? This paper tackles these questions by tracking memorization epoch-by-epoch across models ranging from 125 million to 13 billion parameters.
Tracking Memorization Dynamics
The authors track exact memorization, defined simply as whether the model's most likely next-token prediction exactly matches the ground-truth token for a given context.
To study these dynamics, they train standard Transformer-based causal and masked language models on standard text corpora (WikiText-103 and the RoBERTa Corpus) and measure:
- Time to Memorization: The number of epochs or gradient updates required for a model of size $N$ to exactly memorize a specific fraction ($\tau$) of the training dataset.
- Forgetting Curves: To understand how models forget, the authors inject a "special batch" of held-out data into the training process exactly once. They then resume normal training and track how the exact memorization of that special batch degrades over time.
- Linguistic Tracking: They use Part-of-Speech (POS) tagging to analyze which types of words are memorized first.
Key Insights
Scale Accelerates Memorization
Larger models are highly sample-efficient when it comes to memorization. They require significantly fewer passes over the data to memorize the same proportion of the training set compared to smaller models. For causal language modeling, the number of epochs required to reach 90% exact memorization strictly decreases as parameter count increases from 125M to 13B.
Crucially, a common assumption is that memorization is just a symptom of overfitting. Surprisingly, the authors found that larger models can memorize a much larger portion of the training data before validation loss starts to degrade. Overfitting alone cannot explain the memorization capabilities of large models. Furthermore, this trend holds true even when controlling for fixed learning rates across different model sizes.
The "Forgetting Baseline" Rises with Scale
When a model sees a batch of data only once, its memory of that data decays exponentially but eventually plateaus at a lower bound—the "forgetting baseline." The authors discovered that larger models have a higher forgetting baseline, meaning they permanently retain more information from a single exposure than smaller models.
Interestingly, injecting the "special batch" multiple times back-to-back increases the forgetting baseline. However, spaced repetition (injecting it periodically) has almost no effect on the baseline, contrasting with how human memory works.
Nouns and Numbers Act as Memory Anchors
Models do not memorize all words equally. Nouns, proper nouns, and numbers are memorized noticeably faster than verbs and adjectives. The authors hypothesize that nouns and numbers act as natural "unique identifiers" for specific training examples. To test this, they prepended artificial <unique_id> tokens to examples and found that explicit indexing actually accelerated the model's overall memorization speed.
Limitations and Future Work
While the authors prove that larger models memorize faster and rule out learning rate and overfitting as the sole causes, they note that the underlying mathematical or architectural why behind this phenomenon remains an open question. Additionally, their metric of "exact memorization" is a strict lower bound and does not capture semantic memorization (where a model learns the concept but outputs a paraphrased version).
Future work should investigate the exact structure of the "forgetting baseline." Analyzing exactly what types of tokens (e.g., specific facts, syntax, or synonyms) survive the forgetting curve could have profound implications for mitigating privacy leaks in production LLMs.
Summary updated