Manuscript Offprint

arXiv:2609.10935

Empirical Evaluation of Membership Inference Attacks on NLP Text Classifiers: A Baseline Study on SST-2

William Novak, Muhammad Abusaqer

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Membership inference attacks (MIAs) try to determine whether a specific record was used to train a model, a privacy risk that matters in natural language processing (NLP), where training data can contain sensitive user text. This paper presents a controlled benchmark of membership inference vulnerability for text classification on the GLUE SST-2 sentiment dataset. A TF-IDF + Logistic Regression pipeline and a fine-tuned DistilBERT classifier are compared under a loss-threshold MIA, with utility measured by development accuracy and macro F1. DistilBERT reached 0.9466 accuracy and 0.9460 macro F1 against 0.8756 and 0.8727 for Logistic Regression, yet both models leaked membership signal (Attack AUC 0.5615 and 0.5800, respectively). Two mitigations were tested. Stronger regularization reduced leakage for Logistic Regression at a visible utility cost, whereas fine-tuning DistilBERT for 2 epochs instead of 3 reduced leakage with negligible accuracy loss. Lightweight training adjustments can improve the privacy-utility trade-off without complex defenses.

1. Introduction

Membership inference attacks (MIAs) have emerged as a significant privacy threat in machine learning because they aim to determine whether a specific record was used during model training [1]. Although this task may appear narrow, successful membership inference can reveal whether an individual’s data was included in a sensitive dataset, which is particularly concerning in domains involving personal, medical, financial, or behavioral information [1], [3]. Prior work has shown that such leakage is often tied to model behavior rather than direct disclosure of training examples, which makes MIAs relevant even when only prediction outputs are exposed [1], [2].

Privacy risk is especially important in natural language processing (NLP). Text datasets frequently contain sensitive user-generated content, and modern NLP systems are increasingly deployed through prediction APIs and cloud-based services [3]–[5]. At the same time, much of the literature on text classification emphasizes predictive performance, while privacy evaluation is less frequently included as a first-class criterion. This imbalance creates a practical gap: a model may achieve strong utility while still retaining measurable membership-related signal. The connection between overfitting and privacy leakage has been well documented, suggesting that stronger task performance alone should not be interpreted as evidence of privacy safety [2].

This study addresses that gap through a controlled benchmark on the SST-2 sentiment classification task from GLUE [6], [7]. Two target models are compared: a traditional TF-IDF + Logistic Regression pipeline and a fine-tuned DistilBERT classifier [8]. This pairing is useful because it contrasts a lightweight, interpretable baseline with a compact transformer model under the same dataset, attack design, and evaluation protocol. Comparative benchmarking between traditional and transformer-based NLP models has shown that transformers often improve classification performance, but such comparisons typically focus on utility rather than privacy leakage [10]. The present study therefore extends that comparative perspective into the privacy domain.

The paper is guided by three research questions. First, how much membership information can be inferred from a traditional text classifier compared with a compact transformer on SST-2? Second, how closely is privacy leakage associated with overfitting-related behavior in this setting? Third, to what extent can simple mitigation choices reduce privacy leakage while preserving utility? To answer these questions, the study evaluates both models using a loss-threshold membership inference attack, reports both utility and privacy metrics, and tests two simple mitigations: stronger regularization for Logistic Regression and fewer fine-tuning epochs for DistilBERT. The resulting benchmark is intended to provide a clear empirical view of the privacy-utility trade-off in text classification.

References (10)