TL;DR
This paper introduces a more granular, sequence-level approach to measuring data leakage in Large Language Models (LLMs), revealing that common metrics like "extraction rate" can significantly underestimate the risk, especially with randomized decoding. Their findings suggest that smaller models and shorter prefixes can sometimes be more prone to leaking specific data, challenging previous assumptions.
What Problem Does This Paper Address?
Large Language Models (LLMs) are trained on vast amounts of data, and a critical concern is whether they inadvertently "memorize" and can later reveal sensitive or copyrighted information from this training data. Previous research has attempted to quantify this "data leakage" risk, often by measuring how often a model can reproduce a specific piece of training data when prompted. However, these prior studies typically relied on population-level metrics (like average extraction rates) and deterministic decoding methods (like greedy decoding). This approach has two main limitations:
- Ignores Randomized Decoding: Modern LLMs often use randomized decoding schemes (e.g., top-k, top-p sampling) to generate more diverse and natural-sounding text. These schemes introduce variability, meaning the same prompt can yield different outputs. Prior work often overlooked how these randomized methods might increase leakage risk.
- Lacks Granularity: Averaging extraction rates across many sequences can mask important nuances. A sequence that is difficult to extract on average might be highly vulnerable for a specific reason, or vice-versa. This "one-size-fits-all" approach doesn't provide fine-grained insights into which sequences are at risk and why.
This paper aims to address these gaps by introducing a sequence-level probability-based metric to quantify leakage risk, allowing for a more nuanced analysis across various LLM configurations and decoding strategies.
Methods
The core innovation of this paper is the adoption of sequence-level probabilities to measure data leakage. Instead of just checking if a sequence can be extracted, they calculate the probability of a model generating a specific target suffix given a prefix from the training data. This is done using the Exact Sample Probability (ESP), which is the product of the probabilities of each token in the target suffix.
To provide a more comprehensive view, they also introduce and analyze:
- n-Inexact Sample Probability (n-ISP): This metric relaxes the strict requirement of verbatim extraction by allowing a certain number of tokens within the target sequence to be incorrect. This helps understand partial leakage.
- Approximate n-ISP: For computational efficiency, they propose an approximation that focuses on higher-probability sequences.
They then systematically evaluate these metrics across different:
- Decoding Schemes: Comparing greedy, random sampling, top-k, top-p, and temperature-based sampling.
- Model Sizes: Examining models ranging from 125M to 13B parameters.
- Prefix Lengths: Varying the input context from 10 to 50 tokens.
- Token Positions: Analyzing how the position of a token within a sequence affects its extractability.
Datasets
The study uses two prominent pre-trained LLMs:
- Llama: Trained on the Common Crawl dataset.
- OPT: Trained on The Pile dataset.
For evaluation, they specifically sample sequences containing Named Entities (NEs) to simulate sensitive data like names of individuals, organizations, and places. They also use sequences for evaluating longer data extraction and a specific benchmark from the 2023 SATML training data extraction challenge.
Key Insights and Ideas
- Extraction Rate is Misleading: The traditional "extraction rate" metric, which relies on a single prompt and deterministic decoding, significantly underestimates the leakage risk, especially with randomized decoding schemes.
- Randomized Decoding Matters: Randomized decoding schemes (like top-k and top-p) can reveal training data much more effectively than greedy decoding, especially after a few more prompts than the single prompt assumed by extraction rate.
- Partial Leakage Isn't Always Easier: Contrary to intuition, partial leakage (allowing some tokens to be incorrect) is often not easier than verbatim leakage for common decoding schemes like top-k and top-p. This is because the conditional nature of language models makes it harder to produce correct subsequent tokens when conditioned on an incorrect one.
- Model Size and Prefix Length Nuances: While larger models and longer prefixes generally increase the average leakage risk, a substantial portion of individual sequences are actually easier to extract with smaller models or shorter prefixes. This suggests that smaller models might be "better" at memorizing certain types of data.
- Token Position Matters: Later tokens in a sequence are significantly easier to extract than earlier ones, especially for Named Entities, possibly due to LLMs' tendency to memorize out-of-distribution or less common patterns.
Key Results
- The "extraction rate" metric can underestimate leakage risk by as much as 2.14X for randomized LLMs.
- Randomized decoding schemes can outperform greedy decoding after just 3-20 samples per sequence.
- For Named Entities, 85.25-94.82% of targets were not easier to extract partially than exactly when using top-k decoding.
- 30.4-41.5% of sequences were found to be easier to extract with smaller models or shorter prefixes.
- Extracting the last token of a Named Entity can be 5.23-10.12X easier than extracting the first token.
Limitations and Future Work
- Computational Cost: Computing exact sequence probabilities can be computationally intensive, especially for n-Inexact Sample Probability. The paper proposes approximations but acknowledges the inherent challenge.
- Defining "Sensitive": The study uses Named Entities as a proxy for sensitive data. Future work could explore leakage of other types of sensitive information or copyrighted material.
- Future Work: The authors advocate for the adoption of their sequence-level probability metric for future leakage quantification. They suggest exploring better ways to capture and quantify partial leakage, potentially by measuring semantic closeness rather than exact token matches. Further research into the specific reasons why smaller models or shorter prefixes might be more prone to leaking certain data is also warranted.
Summary updated