A Prior-Aware Metric for Efficiently Distinguishing Memorization from Generalization in Large Language Models
Organizations: Cornell University · Boston University · NVIDIA, Cornell University
Abstract
Training data leakage from Large Language Models (LLMs) raises serious concerns related to privacy, security, and copyright compliance. A central challenge in assessing this risk is distinguishing prefix-specific memorization of training data from the generation of statistically common sequences. Existing approaches to measuring memorization often conflate these phenomena, labeling outputs as memorized even when they arise from generalization over common patterns. Counterfactual memorization and other related metrics \citep{zhang2023counterfactual, wang2025generalization, lesci2024causal} provide principled solutions, however, their reliance on retraining multiple baseline models or parsing through the training data makes them computationally impractical at scale. This work introduces Prior-Aware memorization, a theoretically grounded, lightweight and training-free criterion for identifying prefix-specific memorization in LLMs. The key idea is to evaluate whether a candidate suffix is strongly associated with its specific training prefix or whether it appears with high probability across many IID sampled sequences from the training data distribution due to statistical commonality. We correlate our metric with counterfactual memorization, and also evaluate it on the training corpora of two pre-trained models, LLaMA and OPT. Our results show that between 55% and 90% of sequences previously labeled as memorized fail our criterion and are consistent with statistical commonality
Figures & tables
| Score (Low) | Sequence ( ) | Score (High) | Sequence ( ) |
| 2.9 | …and is a tributary to Saginaw Bay | 4052 | …t1=“Sea Zone” t2=“ South Atlantic Sea Zone |
| 3.0 | …special prosecutor Leon Jaworski | 3358 | …misguided members of the Autonomie Club |
| 3.7 | …Jack Germond and Jules Witcover | 2544 | …I’m watching Gore’s Warmista-Fest |
| 4.0 | …Hospital had received Hill-Burton | 1560 | …PLUS Gold certification.- Corsair Gold AX850 |
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
| Exact Copy | Near-Dup |
| Quantum doughnuts might not exist, but theoretical bakers remain hopeful. | majestic um Nant onuts might Conradavery 258 texted theoretical imperialistmlicks Shim. |
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