Skip to main content
QUICK REVIEW

[Paper Review] Quantifying Privacy Risks of Masked Language Models Using Membership Inference Attacks

Fatemehsadat Mireshghallah, Kartik Goyal|arXiv (Cornell University)|Mar 8, 2022
Privacy-Preserving Technologies in DataComputer Science10 citations
TL;DR

This paper proposes a likelihood ratio-based membership inference attack to quantify privacy risks in masked language models (MLMs), using a reference MLM to improve detection of memorized training data. Unlike prior loss-only methods, the approach achieves an AUC of 0.90 on clinical MLMs—significantly higher than the prior state-of-the-art AUC of 0.66—demonstrating that MLMs are highly susceptible to privacy leakage through memorization.

ABSTRACT

The wide adoption and application of Masked language models~(MLMs) on sensitive data (from legal to medical) necessitates a thorough quantitative investigation into their privacy vulnerabilities -- to what extent do MLMs leak information about their training data? Prior attempts at measuring leakage of MLMs via membership inference attacks have been inconclusive, implying the potential robustness of MLMs to privacy attacks. In this work, we posit that prior attempts were inconclusive because they based their attack solely on the MLM's model score. We devise a stronger membership inference attack based on likelihood ratio hypothesis testing that involves an additional reference MLM to more accurately quantify the privacy risks of memorization in MLMs. We show that masked language models are extremely susceptible to likelihood ratio membership inference attacks: Our empirical results, on models trained on medical notes, show that our attack improves the AUC of prior membership inference attacks from 0.66 to an alarmingly high 0.90 level, with a significant improvement in the low-error region: at 1% false positive rate, our attack is 51X more powerful than prior work.

Motivation & Objective

  • To address the inconclusive results of prior membership inference attacks on masked language models (MLMs), which relied solely on model loss and failed to distinguish between intrinsic sample complexity and true memorization.
  • To develop a more accurate membership inference attack by incorporating a reference MLM to calibrate the likelihood ratio, reducing confounding effects from sample complexity.
  • To empirically quantify the extent of memorization in MLMs trained on sensitive data, such as medical notes, using principled statistical hypothesis testing.
  • To identify data characteristics (e.g., punctuation density) that increase susceptibility to membership inference attacks.
  • To provide a framework for auditing privacy risks in MLMs and inform the design of robust privacy-preserving training methods.

Proposed method

  • The attack uses likelihood ratio hypothesis testing between the target MLM and a reference MLM trained on the underlying data distribution to assess whether a sample is likely to be a member of the training set.
  • The method treats MLMs as energy-based probabilistic models, enabling likelihood computation despite their non-probabilistic nature, using the energy function to estimate sequence probabilities.
  • The likelihood ratio is computed as the ratio of the probability of the sample under the target model to that under the reference model, providing a calibrated test statistic.
  • The attack is evaluated on ClinicalBERT-Base models fine-tuned on MIMIC-III and i2b2 medical note datasets, using AUC and true positive rate at fixed false positive rates as metrics.
  • The reference model is trained on a distributionally similar but non-overlapping subset of data to ensure it reflects the population distribution without memorizing the target model’s training data.
  • The framework is applied to analyze the impact of model size, sequence length, and data characteristics (e.g., punctuation) on attack success.

Experimental results

Research questions

  • RQ1To what extent do masked language models memorize individual training samples, and how can this be accurately measured beyond relying on model loss alone?
  • RQ2Can a likelihood ratio test using a reference model significantly improve membership inference attack performance on MLMs compared to loss-based baselines?
  • RQ3Which data characteristics (e.g., length, punctuation, complexity) make samples more vulnerable to membership inference attacks in MLMs?
  • RQ4How does model size and sequence length affect the success of likelihood ratio-based membership inference attacks on MLMs?
  • RQ5What are the implications of these findings for the privacy of sensitive data used in fine-tuning MLMs, such as clinical notes?

Key findings

  • The proposed likelihood ratio-based membership inference attack achieves an AUC of 0.90 on the ClinicalBERT-Base model fine-tuned on MIMIC-III, a substantial improvement over the prior loss-based method, which achieved only 0.66 AUC.
  • At a false positive rate of 10%, the attack achieves a true positive rate of 79.2%, compared to just 15.6% for the baseline method, indicating a dramatic increase in detection capability.
  • In low-error regimes (1% false positive rate), the attack is 51 times more powerful than the prior loss-based approach, highlighting its effectiveness on hard-to-detect samples.
  • Samples with multiple non-alphanumeric characters (e.g., punctuation) are significantly more prone to memorization and thus more vulnerable to membership inference attacks.
  • The study demonstrates that MLMs trained on sensitive data are highly susceptible to privacy leakage, contradicting prior claims that they are more private than autoregressive models.
  • The results underscore the urgent need for privacy-preserving training techniques such as differential privacy to protect individual data records in MLMs.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.