A Comparative Analysis of LLM Memorization at Statistical and Internal Levels: Cross-Model Commonalities and Model-Specific Signatures
Authors: Bowen Chen, Namgi Han, Yusuke Miyao
Organizations: Department of Computer Science, The University of Tokyo · Research and Development Center for Large Language Models, National Institute of Informatics
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)
Table 1: Model families and their pre-training data.
Figure 1: (Top Figure) The relationship between memorization rate, model size, and pre-training corpus size. The x/y-axis represents parameter counts and memorization rate on a log scale. Line width and color also encode the training token count (thicker lines = more tokens). (Bottom left) The compression ratio across models. A smaller compression ratio requires fewer tokens to generate the same memorized sequences. (Bottom right) The probability density distribution of memorization scores for all models (log-scaled y-axis).
Figure 2: The average token frequency distribution for different models. The upper figure shows the normalized frequency for memorized sequences. The dotted vertical lines indicate the average frequency for each model. The bottom figure shows the absolute frequency for memorized (solid line) and unmemorized (dotted line) sequences.
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%
Table 2: Proportion of memorized texts across Structural, Semi-Structural, and Free-Text categories. StarCoder is not presented as it is only trained on code.
Figure 3: (Left figure) Memorization score distribution shift under noise. (Right figure) The Attention Head similarity between clean and noised models, with variance represented by the shadow. Solid/dotted lines represent results for memorized/unmemorized sequences. The noise range is [0.1, 0.2, 0.3, 0.4, 0.5].
Figure 4: Decoding probability (Y-axis) for memorized and unmemorized tokens across different layers (X-axis) for all models. The solid/dotted line represents the probability for memorized/unmemorized sequences.
Model
Size
Any Two Domain Pair
In-Domain Example Pair
Percentage of Shared Important Heads Among >x% Domains
Mean Jaccard
Max Jaccard
Random
Mean Jaccard
>30% dom
>50% dom
>70% dom
>90% 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%
Table 3: Cross-domain top-20% head overlap against a random-selection, together with mean within-domain example-level overlap and the ratio of heads that remain top-20% important in at least X%, or all domains.
Figure 5: Distribution of shared important heads across layers for Pythia-12b and OLMo-13b
Figure 6: Distribution Similarity Heatmap of Layer-wise Average Head Importance for all models.
Table 4: Complete domain classification and counts by model family. Domains are categorized as Structural (code/mathematics), Semi-Structural (mixed format), and Free-Text (natural language prose). The #Dom column shows the count of domains in each category.
Table 5: Proportion of memorized texts (score=1) across Structural, Semi-Structural, and Free-Text categories at different noise levels.
Figure 7: MLP similarity between noised and clean models. Solid/Dotted lines represent the memorized/unmemorized sequence experiment results.
Figure 8: Frequency distribution for memorized, half-memorized, and unmemorized sequences.
Figure 9: Top 20% important heads overlap for Pythia and OLMo2 models on selected domains.
Figure 10: Average layer importance across layers.
Figure 11: Average norm value of residual stream for different models.
Figure 12: Layer-Normalized Averaged Importance Score for Attention Heads Across Layers.
Figure 13: Decoding probability (Y-axis) for memorized and unmemorized tokens across different layers (X-axis) for all models. The solid/dotted line represents the decoding probability across layers for memorized/unmemorized sequences.
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%
Appendix
Table 6: Domain distribution of memorized texts across model families and sizes.
MaiNLP, Center for Information and Language Processing, LMU Munich & Munich Center for Machine Learning (MCML), Germany · Mila – Quebec AI Institute & University of Montreal, Canada · Saarland University, Germany