TL;DR
Fine-tuning Large Language Models (LLMs) on datasets containing sensitive information in the inputs—even when completely absent from the target outputs—leads to significant unintended memorization and leakage of Personally Identifiable Information (PII). While Differential Privacy (DP) offers strong mathematical guarantees, post-training alignment methods like Direct Preference Optimization (DPO) provide a more stable and practical privacy-utility trade-off.
What Problem Does This Paper Address?
When we fine-tune LLMs on domain-specific data (like medical records), the training inputs often contain sensitive PII such as patient names, phone numbers, or addresses. Crucially, this sensitive data is often completely irrelevant to the downstream task's target output (e.g., predicting a generic classification label or generating a generic follow-up plan).
While previous research has focused on models memorizing task-relevant data or data seen during pre-training, this paper tackles input-only PII memorization. The authors investigate how and why fine-tuned models inadvertently internalize sensitive data that they were never explicitly trained to output, creating a massive privacy vulnerability.
Methods
To systematically measure and mitigate this leakage, the authors design an experimental framework consisting of extraction attacks and defense benchmarks:
- The Attacks: The primary probe is the True-Prefix Attack (TPA), which feeds the model a real text prefix from the training data and evaluates whether it completes it with the exact ground-truth PII. They also test an Enhanced TPA (providing the first character of the PII) and more aggressive adversarial prompts like Role-Play, Recovery, and Jailbreak scenarios.
- The Defenses: They benchmark four privacy-preserving training strategies:
- Differential Privacy Fine-Tuning (DP-FT): Injecting noise into gradients during training to bound individual sample influence.
- Machine Unlearning (UnDial): A post-training method that suppresses the logits of tokens meant to be forgotten via self-distillation.
- Regularization: Integrating the targeted UnDial loss directly into the fine-tuning loop.
- Direct Preference Optimization (DPO): Aligning the model post-fine-tuning by treating PII-containing text as "rejected" responses and masked text as "preferred" responses.
Datasets
The authors evaluate their methods across three distinct datasets:
- GretelAI-Financial: A synthetic, multilingual dataset (~30k samples across 7 languages) used for financial text classification.
- Pathology Reports: A private German medical dataset consisting of 2,553 documents summarizing bone and soft-tissue tumor analyses, used for information extraction.
- Discharge Summary (DS): A large private German clinical dataset containing 26,306 reports used for generating medical follow-up plans.
Key Insights and Ideas
-
Fine-tuning boosts confidence in PII: Fine-tuning shifts the model's token log-likelihoods for PII significantly closer to zero. This means the model becomes highly confident in predicting sensitive data it shouldn't care about.
Figure 2: Distribution of per-token log-likelihoods for ground-truth PII completions. -
Frequency is a terrible predictor of memorization: Counterintuitively, how often a piece of PII appears in the training set is a poor predictor of whether it gets memorized ($R^2 = 0.237$). Context and task relevance matter far more than raw repetition.
Figure 3: Relation of extracted PII counts (enhanced TPA, Cross-memorization) and true counts in the DS dataset for Llama 3.2 1B (seed 2431). -
Language matters: Even when trained on the exact same multilingual data, models exhibit systematic variation in memorization across languages. English and Spanish showed significantly higher extraction rates than German or Swedish.
Figure 4: PII extraction success ratio across languages for GretelAI-Financial with Llama 3.2 1B. Error bars represent 95% confidence intervals over 3 random seeds. -
Model size vs. Fine-tuning: Larger models (8B–12B) have a higher baseline capacity to leak PII out-of-the-box due to pre-training, but fine-tuning them doesn't exacerbate the raw count of leaked PII as severely as it does for smaller models (<4B).
Key Results
- Post-training alignment wins on utility: Methods like DPO and UnDial consistently achieve the best privacy-utility trade-offs. For example, DPO on Llama 3.2 1B maintained near-optimal task performance while drastically reducing direct PII extraction.
- DP is powerful but unstable: DP-FT achieved the strongest reduction in cross-memorization (over 60% on the Discharge Summary dataset), but it suffered from high training instability, required larger batch sizes, and degraded downstream task performance.
- No silver bullet: Even the most effective mitigation combinations only achieved around a 40% reduction in direct PII memorization under enhanced attacks, showing that current defenses still leave substantial room for improvement.
Limitations and Future Work
The study primarily focuses on parameter-efficient fine-tuning (QLoRA) on models up to 12B parameters; full-parameter fine-tuning or larger reasoning architectures might exhibit different behaviors. Additionally, high-quality datasets with explicit PII annotations are rare due to privacy constraints, forcing a reliance on synthetic data or semi-automated annotations which can introduce bias.
The authors emphasize that future work must focus on developing more robust defenses against highly optimized adversarial jailbreaks and exploring why current methods fail to eliminate input-only leakage entirely.
Summary updated