Students Parrot Their Teachers: Membership Inference on Model Distillation

Matthew Jagielski, Milad Nasr, Christopher A. Choquette-Choo, Katherine Lee, Nicholas Carlini · DOI

Introduction

In the pursuit of efficient machine learning, knowledge distillation has emerged as a cornerstone technique. By training a compact "student" model to mimic the output distributions (the "soft labels") of a larger, pre-trained "teacher" model, researchers can create high-performing models suitable for edge devices. Beyond efficiency, distillation has often been touted as an ad-hoc privacy defense. The intuition was straightforward: since the student model only observes the teacher's predictions and never the raw training data, the private details of that data should theoretically remain shielded.

However, this paper demonstrates that this "privacy barrier" is largely illusory. The authors show that student models "parrot" the specific quirks and decision-boundary idiosyncrasies of their teachers. This phenomenon allows attackers to perform highly accurate Membership Inference Attacks (MIA), determining whether a specific data point was part of the teacher's original training set, even when the attacker only has access to the distilled student.

The Threat Model: Membership Inference

Membership Inference Attacks pose a significant risk to data privacy, particularly in sensitive domains like healthcare or finance. An attacker aims to identify if a specific record—such as a patient's medical history—was used to train a model. If successful, the attack confirms the record's presence in the dataset, potentially revealing sensitive associations.

While previous research suggested that the abstraction layer provided by distillation might mitigate these attacks, this study applies the state-of-the-art Likelihood Ratio Attack (LiRA) to prove otherwise. LiRA functions by training multiple "shadow models" to calibrate the likelihood of a model's prediction on a target point, comparing the scores when the point is included versus when it is excluded from training.

Attack Methodologies

The authors introduce three distinct variants of the LiRA framework tailored for the distillation setting:

  1. Transfer LiRA: The attacker trains shadow teacher models and applies the resulting membership scores directly to the student model. This tests how directly the teacher's vulnerabilities are inherited.
  2. End-to-End LiRA: The attacker replicates the entire distillation pipeline, training both shadow teachers and shadow students. This more sophisticated approach allows the attacker to calibrate the attack based on the specific dynamics of the distillation process.
  3. Indirect Query Attack: Perhaps the most novel contribution, this attack demonstrates that membership can be inferred without even querying the target point itself. By querying the student on "neighboring" or related images that the model confuses in specific ways (due to the influence of the target point during the teacher's training), the attacker can deduce the target's membership status.

Why Students Leak: The "Dark Knowledge" Problem

The core of the paper's argument lies in Cross-Example Leakage. Knowledge distillation relies on "dark knowledge"—the subtle, inter-class relationships captured in the teacher’s probability outputs. The authors argue that this same dark knowledge is precisely what carries the "peculiarities" of the training set to the student.

When a teacher model is trained on a specific data point, it doesn't just learn to classify that point; it adjusts its entire decision boundary. If a teacher is trained on a specific image of a red parrot, the resulting student model becomes slightly more likely to predict "bird-like" features for other red objects. This subtle shift in the decision manifold is detectable and serves as a fingerprint for the original training data.

Experimental Evaluation

The study evaluates these attacks across diverse domains, including vision (CIFAR-10), natural language processing (WikiText103 using GPT-2), and tabular data (Purchase100 and Texas100). To ensure the results weren't skewed by simple memorization of duplicates, the authors used the imagededup library to clean the CIFAR-10 dataset.

Key Findings:

  • Minimal Privacy Gain: In many instances, the privacy benefit of distillation was near zero. On vulnerability plots, data points frequently fell along the $y=x$ line, indicating they were just as susceptible to MIA after distillation as they were before.
  • High Attack Accuracy: On CIFAR-10, the End-to-End LiRA achieved performance nearly identical to attacking the teacher directly. For the most vulnerable 5% of examples, the drop in vulnerability was less than 8 percentage points.
  • Indirect Success: Using the indirect query method, the authors achieved 73% to 78% accuracy in predicting membership for target images using only 10 informative queries on unrelated images.
  • Ineffectiveness of Temperature Scaling: Increasing the "temperature" ($H$) of the softmax—a common tactic to smooth outputs—had a negligible effect on privacy within standard ranges.

Conclusion and Implications

The primary takeaway is clear: Distillation is not Differential Privacy (DP). While DP provides mathematical guarantees against membership inference, distillation is merely an empirical observation that often fails under rigorous testing.

The authors suggest that distillation should not be viewed as a standalone defense. Instead, it should be used as a compression tool for models that have already been hardened with rigorous privacy frameworks, such as the Private Aggregation of Teacher Ensembles (PATE). For the research community, the challenge remains to find ways to "de-parrot" the student—stripping away the teacher's data-specific quirks while retaining its generalized knowledge.

Summary updated

BibTeX
@inproceedings{jagielski2023students,
  author = {Matthew Jagielski and Milad Nasr and Christopher A. Choquette-Choo and Katherine Lee and Nicholas Carlini},
  title = {{Students Parrot Their Teachers: Membership Inference on Model Distillation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=a2Yg9Za6Rb},
}
Figure