Abstract
Large Language Models (LLMs) are known to memorize sensitive information from their training data. A common mitigation strategy is "scrubbing," where personally identifiable information (PII) is replaced with generic masks (e.g., [MASK]). This paper introduces R.R. (Recollect and Rank), a powerful two-stage attack framework that demonstrates the vulnerability of scrubbed data. By combining bidirectional context recollection with a novel calibrated ranking criterion, R.R. achieves over double the PII recovery accuracy of previous state-of-the-art methods.
Introduction
The rapid deployment of LLMs has raised significant privacy concerns, particularly regarding the leakage of sensitive data used during fine-tuning. Developers often rely on data scrubbing—replacing names, addresses, and other PII with placeholders—under the assumption that the model cannot leak what it never explicitly "saw" in its raw form. However, LLMs' sophisticated pattern-matching capabilities allow them to infer missing information from surrounding context. Previous attacks, such as TAB or P2P, primarily relied on prefix continuation, which ignores the rich information available in the text following a mask.
The R.R. Framework
The proposed R.R. (Recollect and Rank) framework addresses these limitations through a two-stage process:
- Recollection (Candidate Generation): Instead of simple prefix completion, R.R. utilizes a "recollection" prompt that provides the entire masked sentence to the victim LLM. This allows the model to leverage bidirectional context (both preceding and succeeding text), significantly enhancing its ability to recall memorized entities.
- Ranking (Candidate Selection): To distinguish between general linguistic knowledge and specific memorized data, the authors introduce a biased ranking criterion. This method compares the loss of the victim model against a reference model (the base model prior to fine-tuning). By calculating the difference in loss and applying a tunable bias parameter $b$, the attack can isolate candidates that the model specifically learned during the private fine-tuning phase.
Experimental Setup
The attack was evaluated on three PII-heavy datasets: ECHR (legal judgments), ENRON (corporate emails), and LLM-PC (a synthetic dataset for privacy challenges). The study tested several prominent open-weight models, including Llama 3.1-8B, Llama 3.2-3B, Qwen 2.5-7B, and Phi 3.5-Mini.
Key Results and Analysis
R.R. demonstrates a substantial leap in PII reconstruction performance. On the LLM-PC dataset, it achieved an average top-1 accuracy of 25.73%, a 122% improvement over the best existing baselines.
Several key insights emerged from the evaluation:
- Bidirectional Context is Crucial: The shift from prefix-only to full-sentence recollection is the primary driver of the accuracy boost.
- Calibration Filters Noise: Using a reference model effectively filters out common names or phrases that any LLM would predict, focusing the attack on the specific secrets of the fine-tuning set.
- Model Scale Correlates with Risk: Larger models (e.g., Llama 3.1-8B) proved more susceptible to the attack than smaller counterparts, likely due to their greater capacity for memorizing redundant details.
- Robustness to Defense: Remarkably, R.R. remained effective even against models trained with Differential Privacy (DP-SGD), maintaining significant accuracy where other attacks failed.
Conclusion
The findings of this paper serve as a critical warning for the AI community: data scrubbing is a superficial defense against determined extraction attacks. The R.R. framework proves that masked PII remains highly accessible to adversaries who can leverage bidirectional context and model calibration. Future work must focus on more robust privacy-preserving techniques, such as selective language modeling or advanced unlearning methods, to truly protect sensitive training data.
Summary updated