Private Language Models via Truncated Laplacian Mechanism

Tianhao Huang, Tao Yang, Ivan Habernal, Lijie Hu, Di Wang

Abstract

Deep learning models for NLP tasks are prone to variants of privacy attacks. To prevent privacy leakage, researchers have investigated word-level perturbations, relying on the formal guarantees of differential privacy (DP) in the embedding space. However, many existing approaches either achieve unsatisfactory performance in the high privacy regime when using the Laplacian or Gaussian mechanism, or resort to weaker relaxations of DP that are inferior to the canonical DP in terms of privacy strength. This raises the question of whether a new method for private word embedding can be designed to overcome these limitations. In this paper, we propose a novel private embedding method called the high dimensional truncated Laplacian mechanism. Specifically, we introduce a non-trivial extension of the truncated Laplacian mechanism, which was previously only investigated in one-dimensional space cases. Theoretically, we show that our method has a lower variance compared to the previous private word embedding methods. To further validate its effectiveness, we conduct comprehensive experiments on private embedding and downstream tasks using three datasets. Remarkably, even in the high privacy regime, our approach only incurs a slight decrease in utility compared to the non-private scenario.

Introduction: The Privacy-Utility Trade-off

In Natural Language Processing (NLP), deep learning models often act as "data sponges," inadvertently memorizing sensitive information from their training sets, such as medical records or private communications. Differential Privacy (DP) is the standard framework for mitigating this risk, but it typically imposes a significant "utility tax." Adding sufficient noise to protect privacy often degrades the semantic coherence of the model's output, turning fluent text into gibberish.

Existing methods like the Gaussian or Laplacian mechanisms face a "utility wall." In high-privacy regimes (low $\epsilon$), the noise required is so substantial that it destroys the model's performance. While some researchers have turned to "Metric DP" to alleviate this, it offers a weaker privacy guarantee than the canonical $(\epsilon, \delta)$-DP.

Qualitative comparison of private embedding methods showing how TrLaplace maintains fluency while protecting sensitive details.

The Truncated Laplacian Mechanism (TrLaplace)

To bridge this gap, Huang et al. propose the High-Dimensional Truncated Laplacian Mechanism (TrLaplace). This method extends the 1D truncated Laplacian distribution to high-dimensional embedding spaces, providing a way to satisfy strong DP requirements with significantly lower noise variance.

The TrLaplace process involves three key stages:

  1. Clipping: Word embeddings are scaled to a maximum length $C$ to bound the sensitivity of the output to any single word.
  2. Truncated Noise Injection: Instead of standard distributions with infinite tails, TrLaplace uses a distribution that is "cut off" at specific bounds. This truncation reduces the overall variance of the added noise while maintaining the necessary privacy guarantees through careful parameter tuning.
  3. Projection: The resulting noisy vector is projected back onto the nearest valid word embedding in the vocabulary, ensuring the output remains linguistically valid.

Theoretically, the authors demonstrate that this high-dimensional truncation leads to a lower variance than standard Laplacian mechanisms, which is crucial for preserving the semantic neighborhood of words.

Experimental Evaluation

The researchers evaluated TrLaplace on text re-writing tasks (Yelp and Yahoo datasets) and downstream classification tasks (SST-2 for sentiment and AG News for topic classification).

Key Results in High-Privacy Regimes

The most striking finding is TrLaplace's performance when the privacy budget $\epsilon$ is very small. For instance, on the Yelp dataset with $\epsilon = 0.05$, TrLaplace maintained a Rouge1 score of 92.43, whereas standard Gaussian and Laplacian mechanisms dropped to 12.72 and 10.99, respectively.

Quantitative performance metrics (Loss, Rouge1, and BERT-Score) across varying privacy budgets $\epsilon$, demonstrating TrLaplace's stability in high-privacy settings.

As shown in the figures above, TrLaplace (purple line) consistently tracks the non-private baseline (red dashed line) even as $\epsilon$ approaches zero, while traditional methods (red and blue solid lines) suffer sharp utility declines.

Conclusion

The Truncated Laplacian mechanism offers a robust solution for privatizing language models without sacrificing fluency or accuracy. By mathematically optimizing the noise distribution for high-dimensional spaces, it allows for strong privacy protections that remain practical for real-world NLP applications. Future work may explore its scalability to massive transformer models and its impact on long-form text generation.

Summary updated

Abstract

Deep learning models for NLP tasks are prone to variants of privacy attacks. To prevent privacy leakage, researchers have investigated word-level perturbations, relying on the formal guarantees of differential privacy (DP) in the embedding space. However, many existing approaches either achieve unsatisfactory performance in the high privacy regime when using the Laplacian or Gaussian mechanism, or resort to weaker relaxations of DP that are inferior to the canonical DP in terms of privacy strength. This raises the question of whether a new method for private word embedding can be designed to overcome these limitations. In this paper, we propose a novel private embedding method called the high dimensional truncated Laplacian mechanism. Specifically, we introduce a non-trivial extension of the truncated Laplacian mechanism, which was previously only investigated in one-dimensional space cases. Theoretically, we show that our method has a lower variance compared to the previous private word embedding methods. To further validate its effectiveness, we conduct comprehensive experiments on private embedding and downstream tasks using three datasets. Remarkably, even in the high privacy regime, our approach only incurs a slight decrease in utility compared to the non-private scenario.
BibTeX
@inproceedings{huang2024private,
  author = {Tianhao Huang and Tao Yang and Ivan Habernal and Lijie Hu and Di Wang},
  title = {{Private Language Models via Truncated Laplacian Mechanism}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  url = {https://openreview.net/forum?id=0lRCV8graJ},
}
Figure