Can We Infer Confidential Properties of Training Data from LLMs?

Pengrun Huang, Chhavi Yadav, Kamalika Chaudhuri, Ruihan Wu

Introduction

While privacy research in machine learning has traditionally focused on preventing the leakage of individual records—such as specific names or medical identifiers—a new frontier of risk has emerged: Property Inference Attacks (PIA). These attacks aim to uncover aggregate, dataset-level characteristics, such as the demographic distribution or the prevalence of specific diseases within a training set. For organizations fine-tuning Large Language Models (LLMs) on proprietary data, such as hospital patient records, these aggregate properties are often sensitive trade secrets or protected sociological information.

Defining the Threat: Property Inference

Unlike individual-level privacy, PIA targets the statistical properties of the underlying training distribution. For instance, an attacker might seek to determine if 70% of patients in a medical dataset have a specific condition, even if the model never reveals an individual's identity. This study introduces PropInfer, a benchmark designed to evaluate these risks in LLMs.

Visualizing Property Inference Attacks: An attacker uses model outputs to estimate aggregate statistics like gender distribution or disease prevalence.

Using the ChatDoctor dataset, researchers tested the inferability of patient gender and the prevalence of conditions like mental disorders, digestive issues, and childbirth across several models, including Llama-1, Llama-3, and Pythia.

Attack Methodologies

The researchers developed two primary attack vectors tailored to the generative nature of LLMs:

  1. Black-Box Generation Attack: The attacker prompts the target LLM to generate numerous samples (e.g., simulated medical inquiries). An external high-capacity model, such as GPT-4o, is then used to label these outputs according to the target property. By aggregating these labels, the attacker can estimate the original training data's property ratio.
  2. Shadow-Model Word-Frequency Attack: This "grey-box" approach involves training multiple "shadow models" on auxiliary data with known property ratios. The attacker identifies keywords strongly correlated with the target property (e.g., "prostate" vs. "ovaries") and calculates their frequency in the shadow models' outputs. A meta-classifier is then trained to map these frequencies to the actual property ratio of the target model.

Experimental Results

The attacks proved remarkably effective, often achieving a Mean Absolute Error (MAE) of less than 2%. The word-frequency attack was particularly potent in Q&A fine-tuning modes, where it significantly outperformed simpler baselines like "Direct Asking."

Experimental results showing the Mean Absolute Error (MAE) of different attack methods across various LLM architectures and fine-tuning paradigms.

Key findings from the experiments include:

  • Efficiency: Generation-based attacks converged quickly, requiring as few as 500 samples to reach high accuracy.
  • Fine-tuning Impact: Models in Chat-Completion Mode (learning the joint distribution of dialogue) were more vulnerable to generation-based attacks than those in Q&A Mode, which focus primarily on the doctor's response.
  • Signal Strength: Word frequency emerged as a more reliable signal for property inference in high-dimensional LLMs compared to traditional metrics like perplexity.

Discussion and Conclusion

The success of these attacks is influenced by the model's pre-training bias. If a property is rare or heavily moderated during initial safety training (e.g., sensitive reproductive health topics), the attack is less successful because the model's "prior" resists the fine-tuning distribution. Furthermore, while adjusting output "temperature" can provide a minor defense, it is easily bypassed if the attacker accounts for the setting.

This research highlights a significant, often overlooked privacy vulnerability in the LLM lifecycle. As organizations increasingly fine-tune models on specialized, proprietary datasets, the risk of leaking aggregate confidential properties becomes a critical security concern. Future work must expand these benchmarks to other high-stakes domains like finance and law to develop more robust defenses against property inference.

Summary updated

BibTeX
@inproceedings{huang2025can,
  author = {Pengrun Huang and Chhavi Yadav and Kamalika Chaudhuri and Ruihan Wu},
  title = {{Can We Infer Confidential Properties of Training Data from LLMs?}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=PhIWEbewAz},
}
Figure