SOFT: Selective Data Obfuscation for Protecting LLM Fine-tuning against Membership Inference Attacks

Kaiyuan Zhang, Siyuan Cheng, Hanxi Guo, Yuetian Chen, Zian Su, Shengwei An, Yuntao Du, Charles Fleming, Ashish Kundu, Xiangyu Zhang, Ninghui Li

Introduction

While Large Language Models (LLMs) have demonstrated remarkable capabilities, their deployment often involves fine-tuning on sensitive, domain-specific datasets. This paper investigates the privacy risks associated with this process, specifically focusing on Membership Inference Attacks (MIAs)—where an adversary attempts to determine if a specific data point was part of the training set. The authors introduce SOFT (Selective data Obfuscation in LLM Fine-Tuning), a novel defense mechanism that preserves privacy without sacrificing model utility.

The Vulnerability Gap: Fine-tuning as a Privacy Risk

Recent literature suggested that pre-trained LLMs are relatively resistant to MIAs because they typically encounter each data point only once during training. However, this research reveals a critical vulnerability: fine-tuning often involves multiple epochs on smaller datasets, leading to significant "memorization" or overfitting. This creates a detectable "loss gap" between training members and non-members.

MIA performance (AUC-ROC) on fine-tuned models across various datasets and attack methods. High values indicate significant privacy leakage.

As shown in the evaluation of fine-tuned models, AUC-ROC scores for various attacks frequently exceed 0.8, indicating that attackers can identify training data with high confidence. This is a stark contrast to pre-trained models, where attack performance typically hovers around 0.5 (random guessing).

SOFT: Selective Data Obfuscation

To mitigate these risks, the authors propose SOFT, a four-phase pipeline designed to neutralize MIAs:

  1. Warm-up: The model performs a single pass over the training data to establish a baseline response for each sample.
  2. Influential Data Selection: Using loss-based approximations of Influence Functions, SOFT identifies "influential" samples—those most likely to be memorized and thus vulnerable to MIA.
  3. Data Obfuscation: Instead of removing these samples, SOFT uses a high-quality "teacher" model (e.g., GPT-4) to generate semantically equivalent paraphrases.
  4. Fine-tuning: The final model is trained on a combination of original "safe" data and the newly generated paraphrased data.

By training on paraphrases, the model learns the underlying concepts and semantic meaning without overfitting to the specific token sequences that MIAs exploit.

Key Insights: Scale and Adaptation

The study highlights several critical factors that influence privacy leakage:

  • Model Scale: Larger models possess a greater capacity for memorization, making them more susceptible to MIAs as parameter counts increase.
  • LoRA vs. Full Fine-tuning: While Low-Rank Adaptation (LoRA) offers slightly better privacy than full fine-tuning by complicating the loss landscape, it remains insufficient against sophisticated attacks.
MIA vulnerability (AUC-ROC) increases significantly as the model size grows from 70M to 6.9B parameters.

Results and Performance

SOFT demonstrates exceptional efficacy in neutralizing privacy threats. In experimental evaluations, it reduced MIA success rates from an AUC-ROC of ~0.82 down to ~0.52, effectively returning the model to the privacy level of a pre-trained baseline.

Crucially, SOFT maintains model utility. Unlike Differential Privacy (DP-LoRA), which often degrades performance to ensure privacy, SOFT-protected models showed nearly identical quality scores to unprotected models in "LLM-as-a-Judge" evaluations. Furthermore, the defense proved robust against adaptive attacks where the adversary is aware of the obfuscation strategy.

Conclusion

SOFT provides a practical and effective shield for fine-tuning LLMs on sensitive data. By selectively paraphrasing influential data points, it breaks the link between specific token sequences and model memorization, ensuring that the benefits of fine-tuning do not come at the cost of data privacy.

Summary updated

BibTeX
@inproceedings{zhang2025soft,
  author = {Kaiyuan Zhang and Siyuan Cheng and Hanxi Guo and Yuetian Chen and Zian Su and Shengwei An and Yuntao Du and Charles Fleming and Ashish Kundu and Xiangyu Zhang and Ninghui Li},
  title = {{SOFT: Selective Data Obfuscation for Protecting LLM Fine-tuning against Membership Inference Attacks}},
  booktitle = {USENIX Security},
  year = {2025},
  url = {https://openreview.net/forum?id=PzWGpHlACK},
}
Figure