A Comparative Analysis of LLM Memorization at Statistical and Internal Levels: Cross-Model Commonalities and Model-Specific Signatures
Organizations: Department of Computer Science, The University of Tokyo · Research and Development Center for Large Language Models, National Institute of Informatics
Abstract
Memorization is a fundamental component of intelligence for both humans and LLMs. However, while LLM performance scales rapidly, our understanding of memorization lags. Due to limited access to the pre-training data of LLMs, most previous studies focus on a single model series, leading to isolated observations among series, making it unclear which findings are general or specific. In this study, we collect multiple model series (Pythia, OpenLLaMa, StarCoder, OLMo1/2/3) and analyze their shared or unique memorization behavior at both the statistical and internal levels, connecting individual observations while showing new findings. At the statistical level, we reveal that the memorization rate scales log-linearly with model size, and memorized sequences can be further compressed. Further analysis demonstrated a shared frequency and domain distribution pattern for memorized sequences. However, different models also show individual features under the above observations. At the internal level, we find that LLMs can remove certain injected perturbations, while memorized sequences are more sensitive. By decoding middle layers and attention head ablation, we revealed the general decoding process and shared important heads for memorization. However, the distribution of those important heads differs between families, showing a unique family-level feature. Through bridging various experiments and revealing new findings, this study paves the way for a universal and fundamental understanding of memorization in LLM.
Figures & tables
| Model | Size | Pre-training Data |
| Pythia | 160m, 410m, 1b | Pile Gao et al. (2020) |
| 2.8b, 6.9b, 12b | ||
| OLMo1 | 1b, 7b | Dolma Soldaini et al. (2024) |
| OLMo2 | 1b, 7b, 13b | OLMo-Mix and Domino |
| 32b | OLMo et al. (2025) | |
| OLMo3 | 7b, 32b | Dolma3 Olmo et al. (2025) |
| Model | Pythia | OLMo1 | OLMo2 | OLMo3 | OpenLLaMA | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Size | 1B | 2.8B | 12B | 1B | 7B | 7B | 13B | 32B | 7B | 32B | 3B | 7B | 13B |
| Structural | 75.1% | 76.3% | 74.3% | 57.1% | 49.7% | 44.7% | 43.9% | 39.8% | 49.0% | 44.4% | 65.9% | 61.3% | 58.7% |
| Semi-Structural | 19.4% | 17.2% | 17.1% | 32.3% | 34.6% | 9.7% | 10.5% | 12.1% | 6.4% | 7.9% | 12.1% | 13.5% | 13.2% |
| Free-Text | 5.5% | 6.5% | 8.6% | 10.6% | 15.7% | 45.6% | 45.6% | 48.1% | 44.7% | 47.7% | 21.9% | 25.2% | 28.1% |
| Model | Size | Any Two Domain Pair | In-Domain Example Pair | Percentage of Shared Important Heads Among Domains | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Mean Jaccard | Max Jaccard | Random | Mean Jaccard | dom | dom | dom | dom | all dom | ||
| OLMo1 | 1b | 28.58% | 57.58% | 11.39% | 57.86% | 28.12% | 12.11% | 5.08% | 1.17% | 0.78% |
| 7b | 24.41% | 48.01% | 11.14% | 80.03% | 29.79% | 10.84% | 2.05% | 0.98% | 0.98% | |
| OLMo2 | 1b | 52.08% | 89.09% | 11.39% | 57.69% | 23.05% | 18.75% | 14.06% | 7.42% | 4.69% |
| 7b | 21.97% | 70.12% | 11.14% | 82.26% | 23.24% | 9.96% | 3.42% | 0.78% | 0.29% | |
| 13b | 18.93% | 38.23% | 11.12% | 87.66% | 20.62% | 8.94% | 1.75% | 0.62% | 0.38% | |
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
| Model Family | Domain Type | Domains | #Dom |
| Pythia | Structural | USPTO_Backgrounds, EuroParl, Enron_Emails, Github, StackExchange | 5 |
| Semi-Structural | PubMed_Abstracts, PubMed_Central, FreeLaw, NIH_ExPorter | 4 | |
| Free-Text | ArXiv, DM_Mathematics, Gutenberg (PG-19), HackerNews, Pile-CC, | 8 | |
| PhilPapers, Ubuntu_IRC, Wikipedia (en) | |||
| OLMo1 | Structural | starcoder, proof_pile_2_algebraic_stack, proof_pile_2_open_web_math | 3 |
| Semi-Structural | redpajama_stackexchange, cc_news_head, cc_news_middle, cc_news_tail, | 8 |
| Model | Size | Domain | Count | Share | Total |
|---|---|---|---|---|---|
| OLMo1 | 1B | starcoder | 2,834 | 48.99% | 5,785 |
| cc_en_tail | 575 | 9.94% | |||
| c4_filtered | 367 | 6.34% | |||
| books | 334 | 5.77% | |||
| cc_news_head | 318 | 5.50% | |||
| proof_pile_2_open_web_math | 295 | 5.10% |
Memorization in Language Models
Memorization in language models studies how training examples and facts are stored, recalled, generalized, and exposed by model parameters.
See all 111 papers