How Private is DP-SGD?

Lynn Chua, Badih Ghazi, Pritish Kamath, Ravi Kumar, Pasin Manurangsi, Amer Sinha, Chiyuan Zhang

TL;DR

This paper reveals a significant "privacy gap" in how we measure the security of Differentially Private Stochastic Gradient Descent (DP-SGD). While most practical implementations use shuffling to create mini-batches, they often report privacy guarantees based on Poisson subsampling analysis; the authors prove that shuffling can be substantially less private than these reports suggest, especially when noise levels are low.

What Problem Does This Paper Address?

Training deep learning models with Differential Privacy (DP) usually involves DP-SGD, which adds noise to gradients calculated on small batches of data. To provide strong privacy guarantees, researchers rely on "privacy amplification"—the idea that picking a small random subset of data for each step makes it harder for an attacker to know if a specific individual's data was used.

There are two main ways to pick these subsets:

  1. Poisson Subsampling: Each data point is included in a batch with a fixed probability $q$. This leads to variable batch sizes, which is a nightmare to implement efficiently on hardware like GPUs/TPUs.
  2. Shuffling: The entire dataset is randomly permuted and then split into fixed-size batches. This is the standard in almost every ML framework (PyTorch, TensorFlow).

The challenge is that Poisson subsampling is easy to analyze mathematically but hard to code, while shuffling is easy to code but notoriously difficult to analyze. Consequently, a "common but inaccurate" practice has emerged: developers implement shuffling but report the (stronger) privacy numbers derived from Poisson analysis. This paper asks: Is this shortcut safe? (Spoiler: No.)

Methods

The authors analyze these sampling methods through the lens of the Adaptive Batch Linear Queries (ABLQ) mechanism, a theoretical abstraction of DP-SGD. They compare three samplers: Deterministic ($D$), Shuffle ($S$), and Poisson ($P$).

To compare them rigorously, they use:

  • Zero-out Adjacency: A fair way to compare fixed-size vs. variable-size batching by replacing a record with a "ghost" record that always returns a zero gradient.
  • Hockey Stick Divergence & Dominating Pairs: Advanced mathematical tools that allow for "tight" privacy accounting. Instead of loose bounds, these tools characterize the exact privacy loss curve ($\delta$ as a function of $\epsilon$).
  • Lower Bound Construction: For the shuffle sampler, where a tight upper bound is unknown, the authors construct specific "bad" query sequences to prove a lower bound on the privacy loss. This demonstrates that no matter how clever the analysis gets, shuffling cannot be as private as Poisson in certain regimes.

Datasets

This is a theoretical and numerical analysis paper. It does not use standard image or text datasets. Instead, the authors evaluate their bounds using:

  • Synthetic Adjacent Datasets: Carefully constructed pairs of datasets that differ by one record to test the limits of the privacy definitions.
  • Numerical Simulations: Using Google’s dp_accounting library to plot privacy loss curves across a wide range of noise parameters ($\sigma$) and training steps ($T$).

Key Insights and Ideas

  • The Information Leak of Fixed Sizes: In shuffling, batches have a fixed size. If an attacker knows a target record is not in the first 9 batches, they know with 100% certainty it must be in one of the remaining batches. In Poisson sampling, every batch is independent, so "missing" a record in early batches tells you nothing about its presence in later ones. This lack of independence in shuffling is what degrades privacy.
  • Incomparability of $D$ and $P$: Surprisingly, deterministic batching and Poisson subsampling are "incomparable." For very small privacy budgets (small $\epsilon$), Poisson is more private. But for larger budgets (large $\epsilon$), deterministic batching actually provides better protection.
  • Shuffling $\approx$ Deterministic at Low Noise: When the noise added to gradients ($\sigma$) is small, shuffling provides almost zero privacy amplification over a fixed, non-random order.

Key Results

The most striking result is the magnitude of the "privacy gap." As shown in Figure 1, when using a common setup ($T=10,000$ steps, $\delta=10^{-6}$), the reported privacy parameter $\epsilon$ can be wildly off.

Privacy parameter ε for different noise parameters σ. Note how the lower bound for shuffling (orange) stays close to deterministic batching (blue) and far above Poisson (green/purple) for small σ.

For example, at a noise level of $\sigma = 0.5$:

  • Poisson Analysis (what is usually reported): $\epsilon \approx 1.96$
  • Shuffle Lower Bound (the reality): $\epsilon > 10.99$

This means the implementation is significantly less private than the user is led to believe. Figure 3 (below) further illustrates this by showing that the actual privacy loss $\delta$ for shuffling is orders of magnitude higher than the Poisson prediction.

Figure 3. δD(ε), upper bounds on δP(ε) and a lower bound on δS(ε) for varying ε and fixed σ = 0.4 and T = 10, 000.

Limitations and Future Work

  • Single Epoch Only: The current analysis focuses on a single pass through the data (one epoch). Real-world training often uses dozens of epochs, which complicates the shuffling analysis further.
  • Lower Bounds vs. Upper Bounds: The authors provide a lower bound for shuffling. While this is enough to prove the gap exists, we still lack a numerically tight upper bound (a "perfect accountant") for shuffling that is as easy to use as the ones for Poisson.
  • Complex Shuffling: Some frameworks use "buffer-based" shuffling (e.g., tf.data.Dataset.shuffle), which doesn't perfectly permute the whole dataset. The privacy implications of these specific engineering choices remain an open question.

The authors conclude with a warning: practitioners should be extremely cautious when reporting DP-SGD privacy parameters if their implementation uses shuffling but their analysis assumes Poisson subsampling.

Summary updated

BibTeX
@inproceedings{chua2024how,
  author = {Lynn Chua and Badih Ghazi and Pritish Kamath and Ravi Kumar and Pasin Manurangsi and Amer Sinha and Chiyuan Zhang},
  title = {{How Private is DP-SGD?}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=xWI0MKwJSS},
}
Figure