TL;DR
When large language models (LLMs) are fine-tuned on proprietary data, they don't just learn the task—they implicitly memorize aggregate, dataset-level properties (like patient demographics or disease prevalence). This paper introduces PropInfer, a benchmark for evaluating property inference attacks on LLMs, and demonstrates that both black-box generation and grey-box shadow-model attacks can successfully leak this confidential information.
What Problem Does This Paper Address?
While individual-level privacy breaches (e.g., leaking a specific patient's SSN) are widely studied and mitigated using techniques like Differential Privacy, dataset-level confidentiality remains a major blind spot. For instance, if a hospital fine-tunes an LLM on a dataset of patient-doctor chats, a competitor or adversary might want to infer the exact proportion of patients with a sensitive condition like HIV, or the overall gender distribution of their clientele.
Inferring these properties from LLMs introduces unique challenges:
- Implicit Embedding: Unlike tabular data where attributes occupy distinct columns, text data embeds properties implicitly through subtle linguistic cues (e.g., a patient mentioning "my daughter" or "my gynecologist").
- Hybrid Nature: LLMs do not fit neatly into the purely discriminative or generative categories targeted by prior property inference attacks.
The authors tackle this gap by formalizing property inference attacks (PIAs) for fine-tuned LLMs and exploring how different fine-tuning paradigms affect data leakage.
Methods
The authors propose two novel attack strategies tailored to the mechanics of LLMs:
-
Black-Box Generation-Based Attack (BB Generation): Operating under the assumption that an LLM's output distribution reflects its training distribution, the attacker feeds the target model high-level contextual prompts (e.g., "Hi doctor, I have a medical question"). The attacker generates thousands of responses, uses a strong judge model (ChatGPT-4o) to label the target property in each response, and calculates the aggregate ratio.
-
Grey-Box Shadow-Model Attack with Word Frequency: If the attacker has access to an auxiliary dataset, they train multiple "shadow models" across varying property ratios (e.g., 30%, 50%, 70% female). Instead of relying on model perplexity or loss vectors—which can be noisy—the attack extracts the word frequencies of highly correlated keywords from the shadow models' generations. A meta-classifier (XGBoost) is then trained on these frequencies to predict the exact property ratio of the target model.
Datasets
The authors introduced PropInfer, a benchmark built upon the ChatDoctor dataset (a collection of medical patient-doctor dialogues).
The benchmark evaluates two distinct fine-tuning paradigms:
- Q&A Mode: Fine-tuned using Supervised Fine-Tuning (SFT), optimizing only the doctor's responses given a patient's prompt.
- Chat-Completion Mode: Fine-tuned using Causal Language Modeling (CLM-FT), optimizing over the entire concatenated sequence of prompts and responses.
The attacks target two categories of properties: demographics (gender ratio) and medical diagnoses (prevalence of mental disorders, digestive disorders, and childbirth).
Key Insights and Ideas
- Fine-Tuning Paradigms Dictate Vulnerability: In Chat-Completion mode (CLM-FT), the model learns the joint distribution of the entire text, making it highly susceptible to the simple BB Generation attack. Conversely, Q&A mode (SFT) focuses heavily on the conditional distribution of the response, meaning it memorizes less of the prompt's characteristics.
- Word Frequency Outperforms Perplexity: For grey-box settings, tracking the frequency of specific keywords (e.g., "ovaries", "spotting", "himself") provides a significantly stronger and cleaner signal for property inference than traditional perplexity-based metrics.
- Pre-training Biases Interfere with Attacks: If a property has an extremely low baseline prevalence in the pre-training corpus (or is suppressed by safety alignment), the fine-tuned model struggles to output it naturally, which inadvertently shields that specific property from generation-based attacks.
Key Results
The attacks were evaluated across three base models: Llama-1-8b, Pythia-6.9b, and Llama-3-8b-instruct. Performance was measured using Mean Absolute Error (MAE) between the predicted and true ratios.
- In Q&A Mode: The Word-frequency attack was dominant. For example, on Llama-1 at a 50% target ratio, it achieved an MAE of just 7.33%, vastly outperforming direct asking and perplexity baselines.
- In Chat-Completion Mode: The BB Generation attack proved incredibly potent and efficient, often dropping the MAE below 2% with as few as 500 generated samples.
- Medical Diagnoses: The BB Generation attack successfully predicted the ratios for mental and digestive disorders across both modes, consistently beating the baselines.
Limitations and Future Work
- The "Childbirth" Anomaly: The attacks performed poorly when trying to infer the ratio of childbirth-related data. The authors hypothesize that safety training during the LLMs' pre-training phase suppresses terms related to pregnancy and abortion, making the model's output distribution misaligned with the fine-tuning data.
- Defenses are Fragile: While adjusting the decoding temperature parameter can disrupt generation-based attacks, this defense easily breaks down if an attacker discovers the temperature setting or gains white-box access to model weights.
- Domain Expansion: Future work is required to test property inference on non-medical datasets, such as tracking political or opinion distributions within news datasets.
Summary updated