Fine-Tuning Large Language Models with User-Level Differential Privacy
Zachary Charles, Arun Ganesh, Ryan McKenna, H. Brendan McMahan, Nicole Mitchell, Krishna Pillutla, Keith Rush
TL;DR
This work tackles the challenge of privately fine-tuning large language models under user-level differential privacy by comparing two scalable DP-SGD variants: DP-SGD-ELS, which operates at the example level with per-example clipping, and DP-SGD-ULS, which samples at the user level and clips per-user gradients. A key contribution is a tight Mixture-of-Gaussians based DP accountant that yields provably tight user-level privacy bounds for ELS, enabling fair comparisons with ULS. Theoretical analysis under Lipschitz losses, plus synthetic mean-estimation experiments, illuminate when ULS provides advantages—especially with diverse user data—and the empirical results on a 350M-parameter transformer show ULS often outperforms ELS under strict privacy or larger compute budgets, with practical heuristics for choosing group sizes. Overall, the paper demonstrates scalable, privacy-preserving DP fine-tuning of large models and offers actionable guidelines for deploying ELS and ULS in data-center settings.
Abstract
We investigate practical and scalable algorithms for training large language models (LLMs) with user-level differential privacy (DP) in order to provably safeguard all the examples contributed by each user. We study two variants of DP-SGD with: (1) example-level sampling (ELS) and per-example gradient clipping, and (2) user-level sampling (ULS) and per-user gradient clipping. We derive a novel user-level DP accountant that allows us to compute provably tight privacy guarantees for ELS. Using this, we show that while ELS can outperform ULS in specific settings, ULS generally yields better results when each user has a diverse collection of examples. We validate our findings through experiments in synthetic mean estimation and LLM fine-tuning tasks under fixed compute budgets. We find that ULS is significantly better in settings where either (1) strong privacy guarantees are required, or (2) the compute budget is large. Notably, our focus on LLM-compatible training algorithms allows us to scale to models with hundreds of millions of parameters and datasets with hundreds of thousands of users.
