The Hidden Cost of Modeling $\text{P}(X)$: Membership Inference Attacks in Generative Text Classifiers

Owais Makroo, Karan Gupta, Siva Rajesh Kasa, Sumegh Roychowdhury, Pattisapu Nikhil Priyatam, Santhosh Kumar Kasa, Sumit Negi · Submission to ICLR 2026 · Rejected

TL;DR

While generative classifiers (such as discrete diffusion and autoregressive language models) are gaining popularity in text classification for their low-resource performance and robustness, they introduce a severe privacy risk. Because generative classifiers must explicitly model the input data distribution $P(X)$ alongside the labels $P(Y)$, they are substantially more susceptible to Membership Inference Attacks (MIAs) than traditional discriminative models.

What Problem Does This Paper Address?

In a Membership Inference Attack (MIA), an adversary attempts to determine whether a particular data point was included in a model's training set. While most prior MIA research has scrutinized discriminative models (like standard BERT classifiers that directly model $P(Y|X)$), generative text classifiers have seen a resurgence due to better calibration, data efficiency, and reduced shortcut learning.

However, generative models explicitly capture the joint distribution $P(X, Y) = P(X|Y)P(Y)$ or $P(X)P(Y|X)$. This paper investigates the hidden privacy cost of modeling the input text distribution $P(X)$ and conducts the first systematic theoretical and empirical comparison of MIA vulnerabilities across discriminative, fully generative, and pseudo-generative text classification paradigms.

Methods

The authors analyze three broad classifier paradigms trained from scratch to avoid pre-training confounds:

  1. Discriminative: Standard BERT encoder with a linear classification head modeling $P(Y|X)$.
  2. Fully Generative:
  3. Label-Prefix Autoregressive models that generate text conditioned on a prepended label and classify via multi-pass log-likelihood estimation: $\arg\max_{y} \log P(x, y)$.
  4. Discrete Diffusion models that corrupt text with [MASK] tokens and classify by denoising/approximating likelihood using Diffusion Weighted Denoising Score Entropy (DWDSE).
  5. Pseudo-Generative:
  6. Masked Language Models (MLMs) capturing pseudo-likelihood rather than true joint likelihood.
  7. Pseudo-Autoregressive models (Label-Suffix) that append the label at the end of the text, implicitly factorizing $P(X, Y) = P(X)P(Y|X)$.

The authors evaluate these models under two output settings (pre-softmax logits vs. post-softmax probabilities) using:

  • Threshold-based MIAs: Label-agnostic (Max Probability, Prediction Entropy) and label-aware (Log-Loss).
  • Model-based MIAs: A Gradient Boosting Decision Tree (GBM) trained on output probability vectors combined with one-hot encoded ground-truth labels.

Datasets

Empirical evaluations were conducted on five public text classification benchmarks spanning sentiment, topic, emotion, and hate-speech detection:

  • SST-5 (Stanford Sentiment Treebank, fine-grained 5-class)
  • Hate Speech (offensive language detection)
  • Emotion (tweet emotion classification across 6 classes)
  • AG News (4-class topic classification)
  • IMDb (binary long-form movie reviews)

(Appendix A also details related auxiliary datasets such as SST-2, Rotten Tomatoes, Multiclass Sentiment Analysis, and Twitter Financial News).

Key Insights and Ideas

  • Theoretical Bound on Privacy Leakage: The authors prove that the membership inference advantage $\varepsilon_{\text{MIA}}$ is upper-bounded by the sum of two terms: $$\varepsilon_{\text{MIA}} \le \sqrt{\frac{D_{\mathrm{KL}}(P_{\text{train}}(X) \parallel P_{\text{test}}(X))}{2}} + \sqrt{\frac{\mathbb{E}_x [D_{\mathrm{KL}}(P_{\text{train}}(Y|X) \parallel P_{\text{test}}(Y|X))]}{2}}$$ Discriminative models only leak via the second term (conditional memorization), while generative models inevitably leak through both due to explicitly learning $P(X)$ (input memorization).

  • Logits Are a High-Bandwidth Leakage Channel: Exposing raw, unnormalized logits provides an adversary with raw class confidence information, driving significantly higher attack success rates compared to softmax probabilities, where shared denominator terms cancel out and compress information.

  • Factorization Changes the Privacy Vector: Flipping the generative sequence from label-prefix ($P(Y)P(X|Y)$) to label-suffix ($P(X)P(Y|X)$) in pseudo-autoregressive models drastically increases marginal input leakage $P(X)$ (measured via Jensen-Shannon Divergence and KS statistics), yet reduces overall label-targeted attack vulnerability.

Key Results

  • Generative vs. Discriminative Vulnerability: Across all datasets, fully generative classifiers suffered the highest privacy leakage. Under GBM probability-based attacks:
  • Autoregressive: 0.81 ± 0.13 AUROC
  • Discrete Diffusion: 0.76 ± 0.16 AUROC
  • BERT (Discriminative): 0.62 ± 0.08 AUROC
  • Pseudo-Autoregressive & MLM: ~0.53–0.56 AUROC (near random baseline).
  • Log-Loss and Label Access: In label-aware threshold attacks, Autoregressive models reached an average AUROC of 0.76, compared to 0.60 for BERT.
  • Distribution Divergence: The Pseudo-Autoregressive setup demonstrated substantially higher divergence between train and test loss distributions than the standard Autoregressive model (e.g., JSD of 0.8872 vs. 0.4780 on Emotion), verifying that forcing the model to generate the prompt text first drastically leaks the input distribution $P(X)$.

Limitations and Future Work

  • Assumptions on Adversary Access: The study assumes a black-box adversary with access to unperturbed output vectors (logits or probabilities) and ground-truth human labels, ignoring scenarios where only hard labels are returned.
  • Attack Scope: Advanced extraction techniques, such as knowledge distillation-based or diffusion trajectory-based attacks, were considered out of scope.
  • Scale and Pre-training: All models were trained from scratch on modest architectures to isolate architectural effects; the interaction between large-scale foundation model pre-training and generative classifier privacy remains to be investigated.
  • Future Directions: Developing dedicated defense mechanisms (such as differential privacy or calibrated decoding strategies) to protect generative classifiers without erasing their sample-efficiency benefits.

Summary updated

BibTeX
@misc{makroo2025hidden,
  author = {Owais Makroo and Karan Gupta and Siva Rajesh Kasa and Sumegh Roychowdhury and Pattisapu Nikhil Priyatam and Santhosh Kumar Kasa and Sumit Negi},
  title = {{The Hidden Cost of Modeling $\textbackslash\{\}text\{P\}(X)$: Membership Inference Attacks in Generative Text Classifiers}},
  year = {2025},
  eprint = {2510.16122},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.16122},
}
Figure