Abstract: Differentially Private Stochastic Gradient Descent (DP-SGD) and its variants have been proposed to ensure rigorous privacy for fine-tuning large-scale pre-trained language models. However, they rely heavily on the Gaussian mechanism, which may overly perturb the gradients and degrade the accuracy, especially in stronger privacy regimes (e.g., the privacy budget $\epsilon < 3$). To address such limitations, we propose a novel Language Model-based Optimal Differential Privacy (LMO-DP) mechanism, which takes the first step to enable the tight composition of accurately fine-tuning (large) language models with a sub-optimal DP mechanism, even in strong privacy regimes (e.g., $0.1\leq \epsilon<3$). Furthermore, we propose a novel offline optimal noise search method to efficiently derive the sub-optimal DP that significantly reduces the noise magnitude. For instance, fine-tuning RoBERTa-large (with 300M parameters) on the SST-2 dataset can achieve an accuracy of 92.20% (given $\epsilon=0.3$, $\delta=10^{-10}$) by drastically outperforming the Gaussian mechanism (e.g., $\sim 50\%$ for small $\epsilon$ and $\delta$). We also draw similar findings on the text generation tasks on GPT-2. Finally, to our best knowledge, LMO-DP is also the first solution to accurately fine-tune Llama-2 with strong differential privacy guarantees.
Introduction
Fine-tuning large language models (LLMs) on sensitive data poses significant privacy risks, as models can "memorize" and later leak training samples. Differentially Private Stochastic Gradient Descent (DP-SGD) is the standard defense, but it has a major drawback: it relies almost exclusively on the Gaussian mechanism.
In "strong" privacy regimes—where the privacy budget $\epsilon$ is small (e.g., less than 3)—the amount of Gaussian noise required to satisfy DP requirements becomes so large that it "drowns out" the actual gradients. This leads to a massive drop in model utility. For example, fine-tuning a RoBERTa-large model with a very strict $\epsilon = 0.3$ using standard methods might result in an accuracy of only ~50% (essentially random guessing for binary tasks), making private LLMs impractical for real-world use.
Methodology
The core innovation of LMO-DP (Language Model-based Optimal Differential Privacy) is moving away from the "one-size-fits-all" Gaussian noise. Instead of adding simple noise, LMO-DP uses a nested approach where a Laplace distribution's scale parameter is itself randomized by a second "fold." This second fold is a mixture distribution—a linear combination of Gamma, Exponential, and Uniform distributions—chosen for its ability to approximate a wide variety of probability density functions while remaining computationally manageable.
To avoid the instability of optimizing noise during training, LMO-DP employs an Offline Optimal Noise Search. Using the Rényi Accountant, the system finds specific noise parameters that minimize noise magnitude while strictly adhering to the $(\epsilon, \delta)$ privacy budget. This approach is "orthogonal" to other DP optimizations, allowing it to be integrated with techniques like "Ghost Clipping" to reduce memory overhead.
Experimental Setup
The researchers evaluated LMO-DP across several standard Natural Language Processing (NLP) benchmarks:
- Classification: SST-2 (sentiment analysis), MNLI-m, QNLI, and QQP from the GLUE benchmark.
- Generation: The E2E dataset (table-to-text generation).
- Models: Architecture coverage included BERT-base/large, RoBERTa-base/large, GPT-2, and the 7-billion parameter Llama2-chat-7b.
Key Results and Discussion
The performance gains are most dramatic in high-privacy settings. LMO-DP reduced the noise magnitude by up to 95.13% compared to the Gaussian mechanism for the same privacy guarantee.
Key findings include:
- Accuracy Leap: On the SST-2 dataset with $\epsilon = 0.3$, LMO-DP achieved 92.20% accuracy, compared to roughly 50.92% for the standard Gaussian baseline.
- Faster Convergence: LMO-DP often reaches target accuracy levels in ~50% fewer training steps than Gaussian-based DP-SGD, suggesting the "shape" of LMO-DP noise is much less disruptive to the model's learning dynamics.
- Scaling to LLMs: LMO-DP is the first solution to successfully fine-tune Llama-2 (7B) with strong DP guarantees ($\epsilon < 3$), maintaining high accuracy where previous methods were not even evaluated.
- Text Generation: On GPT-2, LMO-DP improved the CIDEr score by up to 50% over DP-SGD.
Conclusion
LMO-DP represents a significant leap in private LLM fine-tuning by replacing standard Gaussian noise with an optimized mixture distribution. While the offline noise search adds a pre-processing step, the utility gains—especially in strong privacy regimes—make it a powerful tool for researchers needing to fine-tune LLMs under strict constraints. Future work will explore broader search spaces and generalization to more complex reasoning or multi-modal tasks.
Summary updated