Differentially Private Next-Token Prediction of Large Language Models

James Flemings, Meisam Razaviyayn, Murali Annavaram
3/22/2024
cs.CRcs.CLcs.LG

No official code found. Best implementation: james-flemings/pmixed (6 stars, Apache-2.0, last commit 2024-09-29).

Abstract

Ensuring the privacy of Large Language Models (LLMs) is becoming increasingly important. The most widely adopted technique to accomplish this is DP-SGD, which trains a model to guarantee Differential Privacy (DP). However, DP-SGD overestimates an adversary's capabilities in having white box access to the model and, as a result, causes longer training times and larger memory usage than SGD. On the other hand, commercial LLM deployments are predominantly cloud-based; hence, adversarial access to LLMs is black-box. Motivated by these observations, we present Private Mixing of Ensemble Distributions (PMixED): a private prediction protocol for next-token prediction that utilizes the inherent stochasticity of next-token sampling and a public model to achieve Differential Privacy. We formalize this by introducing RD-mollifers which project each of the model's output distribution from an ensemble of fine-tuned LLMs onto a set around a public LLM's output distribution, then average the projected distributions and sample from it. Unlike DP-SGD which needs to consider the model architecture during training, PMixED is model agnostic, which makes PMixED a very appealing solution for current deployments. Our results show that PMixED achieves a stronger privacy guarantee than sample-level privacy and outperforms DP-SGD for privacy $ε= 8$ on large-scale datasets. Thus, PMixED offers a practical alternative to DP training methods for achieving strong generative utility without compromising privacy.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

[NAACL 2024] Differentially Private Next-Token Prediction of Large Language Models

60PythonJul 8, 20232 years agoApache-2.0

Similar Papers

Cite this paper

@article{flemings2024differentially,
  title  = {Differentially Private Next-Token Prediction of Large Language Models},
  author = {James Flemings and Meisam Razaviyayn and Murali Annavaram},
  year   = {2024},
  eprint = {2403.15638},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2403.15638v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2403.15638.svg)](https://codeofpaper.com/paper/2403.15638)

Discussion