Introduction
As Natural Language Processing (NLP) models, ranging from BERT-based architectures to Large Language Models (LLMs) like Llama2, become ubiquitous, they increasingly process sensitive user data. While individual privacy attacks—such as extracting training data or inferring user attributes—have been studied, research often occurs in isolation. This siloed approach fails to capture the complex interactions between different types of vulnerabilities. This paper introduces NLP-Doctor, a comprehensive benchmark designed to systematically evaluate privacy risks across diverse models and realistic threat scenarios.
The NLP-Doctor Framework
NLP-Doctor serves as a diagnostic tool for privacy vulnerabilities by integrating four primary attack vectors:
- Membership Inference Attack (MIA): Identifying if a specific data point was part of the training set.
- Model Inversion Attack (MDIA): Reconstructing actual training samples.
- Attribute Inference Attack (AIA): Inferring sensitive user traits (e.g., age, location).
- Model Extraction Attack (MEA): Creating a functional clone of the target model.
The benchmark evaluates these attacks across 15 datasets covering tasks like sentiment analysis and medical search, using a rigorous data segmentation strategy (Target vs. Shadow sets) to ensure realistic assessment.
Chained Attacks and Cross-Domain Generalization
A core contribution of this work is the Chained Framework, which explores how one privacy breach can facilitate another. For instance, an attacker might use Model Extraction (MEA) to obtain a local "copycat" model, which then serves as a white-box proxy for a more effective Attribute Inference Attack (AIA).
Furthermore, to simulate realistic scenarios where an attacker's data comes from a different domain than the target's training data, the authors use Knowledge Distillation (KD). This technique "distills" the target model's behavior into a shadow model, significantly improving attack success rates in cross-domain settings from near-random (0.5) to approximately 0.7.
Key Insights and Results
The study reveals several critical findings regarding model privacy:
- The Overfitting-Privacy Link: There is a strong correlation between overfitting and MIA vulnerability. Models that memorize training data (e.g., BERT on the RTE dataset) showed MIA success rates up to 0.778.
- LLM Memorization: LLMs are particularly prone to "memorization-based" leaks; approximately 35% of tested candidates in LLMs were found to be uniquely memorized training examples.
- The Extraction Defense Paradox: Interestingly, Model Extraction (MEA) can sometimes act as a defense against MIA. The extracted "student" model often learns the general function without inheriting the specific memorization of the "teacher" model's training data.
- Defense Trade-offs: While Differential Privacy (DP-SGD) is effective at reducing MIA success to near-random levels, it often imposes a "utility tax," significantly dropping the target model's accuracy.
Conclusion and Future Work
While current benchmarks provide a robust starting point, gaps remain in black-box inversion attacks for small models and the evolving threat landscape of prompt-based attacks in LLMs. NLP-Doctor provides an open-source foundation for researchers to stress-test their models before deployment, ensuring that privacy is a primary consideration in the development lifecycle.
Summary updated