Introduction
Large Language Models (LLMs) are known to memorize significant portions of their training data, ranging from public Wikipedia entries to sensitive private communications. Traditionally, this memorization has been measured using a binary "discoverable extraction" metric: if a model produces an exact training suffix given a prefix under greedy (deterministic) sampling, it is considered memorized. However, this approach fails to account for the stochastic nature of modern LLM deployment and the persistence of potential adversaries.
The $(n, p)$-Discoverable Extraction Framework
Researchers from Google DeepMind, Microsoft Research, and Stanford propose a more robust framework: $(n, p)$-discoverable extraction. This metric defines memorization as the probability $p$ that a target sequence is generated at least once within $n$ independent randomized queries.
As shown in the figure above, greedy sampling acts as a lower bound for extraction risk. In many cases, the target token is not the most likely (rank 1) but remains highly probable. While greedy sampling diverges immediately upon encountering a non-top-ranked token, probabilistic sampling methods like top-k or nucleus sampling can still recover the memorized sequence over multiple attempts. This suggests that a model might fail a "greedy" test but still be highly likely to leak sensitive data after just a few randomized attempts.
Methodology: Efficient Probabilistic Estimation
A key contribution of this work is an efficient method for calculating $(n, p)$-extractability. Rather than performing $n$ separate inference passes, the authors demonstrate that the risk can be estimated from a single query by analyzing the log-likelihood of the target sequence ($p_z$). The probability of extraction over $n$ trials is given by the formula $1 - (1 - p_z)^n \geq p$. This allows for the assessment of extraction risk across a wide range of query budgets without prohibitive computational overhead.
Experimental Results and Scaling
The study evaluated models including Pythia, GPT-Neo, and Llama on datasets like Enron emails and GitHub code. The results reveal that traditional greedy metrics drastically underestimate privacy risks.
For the Pythia 2.8B model trained on the Enron dataset, the "worst-case" extraction rate reached 9.04%—nearly seven times the 1.3% rate identified by greedy sampling. Furthermore, the gap between greedy and probabilistic extraction grows as model size increases. For instance, in Pythia 12B, the maximum extraction risk was 13% higher than the greedy rate. This indicates that larger models are more susceptible to multi-query extraction attacks than previously thought, and a model that appears "safer" under greedy sampling may actually be riskier under probabilistic sampling.
Conclusion and Limitations
By shifting from a binary to a probabilistic view of memorization, this research provides a more accurate lens for evaluating LLM privacy. The findings suggest that "safety" under greedy sampling does not guarantee protection against determined adversaries using randomized sampling.
However, the authors acknowledge limitations: the study assumes a "benign" adversary with only API access and focuses primarily on verbatim or near-verbatim extraction. Future work is needed to address more powerful attacks (like prefix optimization) and the varying sensitivity of different types of memorized data, such as distinguishing between public facts and private PII.
Summary updated