User-Entity Differential Privacy in Learning Natural Language Models

Phung Lai, NhatHai Phan, Tong Sun, Rajiv Jain, Franck Dernoncourt, Jiuxiang Gu, Nikolaos Barmpalios

Abstract

Large Language Models (LLMs) are prone to memorizing sensitive training data, posing significant privacy risks such as membership inference and entity extraction. While traditional Differential Privacy (DP) methods offer some protection, they often suffer from a "utility gap," where high privacy guarantees result in poor model performance. This paper introduces User-Entity Differential Privacy (UeDP), a novel framework that protects both user identity and specific sensitive entities within text. By employing a two-level sampling strategy and a tighter mathematical bound on noise, the proposed UeDP-Alg achieves superior model utility compared to standard DP approaches.

Introduction

As Natural Language Models (NLMs) like GPT-2 and BERT become increasingly integrated into sensitive applications, the risk of data leakage grows. These models are known to "memorize" specific strings from their training sets, which can lead to the exposure of personally identifiable information (PII) such as names, addresses, or financial details.

Existing privacy-preserving techniques typically focus on either User-level DP or Sample-level DP. User-level DP protects the individual but often introduces excessive noise, degrading model accuracy. Sample-level DP protects individual sentences but fails when a single user contributes multiple data points. This research addresses this "protection gap" by proposing a hybrid approach: User-Entity Differential Privacy (UeDP).

The UeDP Framework

The core of the UeDP framework is the simultaneous protection of data owners and the sensitive entities contained within their contributions. This is achieved through a combination of novel mathematical definitions and a specialized training algorithm.

User-Entity Adjacent Databases

The authors redefine privacy through "User-Entity Adjacent Databases." In this framework, two datasets are considered neighbors if they differ by exactly one user and one sensitive entity. This granular definition allows for more precise noise application than traditional user-level definitions.

Two-Step Sampling and the Extended Set

To implement this, the UeDP-Alg utilizes a two-step sampling process within a Federated Learning (FL) environment, where data remains on local devices and only model updates (gradients) are shared.

  1. User Sampling: In each training round, a subset of users is selected.
  2. Entity Sampling: From the selected users, a subset of sensitive entities is sampled. Only sentences containing these specific entities are used to compute gradients.

A critical innovation is the handling of "Ghost Entities." Recognizing that automated Named Entity Recognition (NER) tools (like spaCy or Stanza) are imperfect, the authors introduce an Extended Set (S). This set includes "non-sensitive" text segments, treating them as a special class of entities. This ensures that even if a sensitive name is missed by the NER detector, it remains mathematically protected under the DP umbrella.

Technical Innovations: Tight Sensitivity Bounds

A major hurdle in DP is the "sensitivity" of the gradient estimator. High sensitivity requires more noise to be added to ensure privacy, which harms model utility. The authors derive a new, tighter bound for the sensitivity of their gradient estimator. By reducing the required noise for a given privacy budget ($\epsilon$), UeDP-Alg maintains higher accuracy (lower perplexity) than traditional methods.

Experimental Evaluation

The researchers evaluated UeDP-Alg across three distinct datasets:

  • CoNLL-2003: A standard benchmark for Named Entity Recognition.
  • AG News: A large-scale news article dataset used for topic classification.
  • SEC Financial Contracts: A real-world dataset containing highly sensitive corporate and personal information.

The framework was tested using GPT-2, BERT, and AWD-LSTM models.

Key Results

  • Model Utility: On the CoNLL-2003 dataset, with a strict privacy budget ($\epsilon \approx 0.185$), UeDP-Alg achieved a perplexity of ~35. In contrast, standard User-level DP resulted in a significantly worse perplexity of ~52 (where lower is better).
  • Privacy Efficiency: UeDP-Alg demonstrated "proportional privacy savings." As training progressed, the gap in the privacy budget consumed between UeDP and standard methods widened, making UeDP particularly effective for long-term training tasks where privacy leakage usually accumulates quickly.
  • Classification Accuracy: On the AG News dataset, the error rates for UeDP-Alg remained close to the "noiseless" (non-private) baseline, outperforming both simple de-identification (masking) and standard DP.

Discussion and Limitations

The "Extended Set" serves as a vital safety net, proving that formal mathematical guarantees are superior to simple de-identification, which can often be bypassed by linkage attacks. However, the authors note several areas for future research:

  • Dynamic Environments: The current model assumes static user and entity lists. Adapting to growing datasets in real-time may incur additional computational and privacy costs.
  • Hyperparameter Optimization: The sampling rate for non-sensitive entities ($q_s$) significantly impacts utility, and finding the theoretical "sweet spot" remains an open research question.
  • Complexity: The two-level sampling and per-user gradient clipping add complexity to the training pipeline compared to non-private training, though it remains more efficient than many cryptographic alternatives.

Conclusion

User-Entity Differential Privacy represents a significant step forward in balancing the trade-off between privacy and utility in NLP. By protecting both the user and the specific entities within their data, UeDP-Alg allows for the training of high-performing language models that respect individual privacy even in the face of sophisticated extraction attacks.

Summary updated

BibTeX
@inproceedings{lai2022user,
  author = {Phung Lai and NhatHai Phan and Tong Sun and Rajiv Jain and Franck Dernoncourt and Jiuxiang Gu and Nikolaos Barmpalios},
  title = {{User-Entity Differential Privacy in Learning Natural Language Models}},
  booktitle = {IEEE Big Data},
  year = {2022},
  doi = {10.1109/bigdata55660.2022.10020247},
}
Figure