How Private are DP-SGD Implementations?

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

Executive Summary

Most machine learning libraries implement Differentially Private Stochastic Gradient Descent (DP-SGD) using shuffling-based batching, yet they report privacy guarantees based on Poisson subsampling analysis. This paper reveals a substantial gap between the two, proving that the standard Poisson-based analysis can significantly underestimate the actual privacy loss of real-world shuffling implementations, especially when noise levels are low.

The Problem: Shuffling vs. Poisson Subsampling

To make a model "private" using DP-SGD, researchers typically clip gradients and add Gaussian noise. However, the way data batches are selected (sampling) also provides "privacy amplification." There are two main approaches:

  1. Poisson Subsampling: Each data point is included in a batch with a fixed probability. This is mathematically elegant and easy to analyze, but challenging to implement efficiently because batch sizes vary and it requires random memory access.
  2. Shuffling: The dataset is randomly permuted and divided into fixed-size blocks. This is the industry standard (used in TensorFlow and PyTorch) due to its computational efficiency.

The challenge is that shuffling is notoriously difficult to analyze mathematically. Consequently, practitioners often implement shuffling but "borrow" the privacy math from Poisson subsampling, assuming the difference is negligible. The authors set out to prove that this assumption is not just wrong, but potentially dangerous for privacy guarantees.

Methodology

The authors analyze these sampling techniques through the lens of the Adaptive Batch Linear Queries (ABLQ) mechanism, a framework that abstracts the iterative nature of DP-SGD. To compare the privacy guarantees, they use Privacy Loss Distributions (PLDs) and the concept of dominating pairs—a way to characterize the worst-case scenario for privacy leakage.

Their core contributions include:

  • Analytical Proofs: Demonstrating that for large privacy budgets ($\epsilon$), Poisson subsampling and deterministic batching are "incomparable," meaning one isn't strictly better than the other.
  • Lower Bound Construction: Designing specific worst-case synthetic adjacent datasets (typically vectors of $1$s and $-1$s differing by exactly one record) and queries to find a lower bound for the privacy loss in shuffling.
  • Numerical Verification: Using Google’s open-source dp_accounting library to calculate the actual privacy curves and visualize the gap between the Poisson theory and the Shuffling reality.

Key Insights

The fundamental reason shuffling is less private than Poisson subsampling is due to a "Location" Leak. In shuffling, the batches are constrained: if a specific record is not in the first batch, the adversary knows for a fact it must be in one of the remaining batches. In Poisson subsampling, every batch is independent, so missing a record in one batch reveals nothing about the others.

Furthermore, the paper highlights a Small Noise Trap. For small values of noise ($\sigma$), shuffling provides almost zero privacy amplification over simple deterministic batching, while the Poisson analysis suggests a much rosier (and incorrect) privacy picture.

Comparison of delta versus epsilon showing the substantial gap between shuffling lower bounds and Poisson upper bounds

Surprisingly, the paper also shows that Poisson subsampling isn't always strictly "better" than deterministic batching. For very small $\epsilon$, Poisson is better; but for large $\epsilon$, deterministic batching actually provides a tighter privacy bound.

Key Results

The most striking result is visualized in the comparison of privacy budgets ($\epsilon$) across different noise levels ($\sigma$).

Comparison of privacy budget epsilon for different noise levels sigma

For a fixed number of steps ($T=10,000$) and a noise level of $\sigma = 0.5$:

  • Poisson Analysis (The "Reported" Number): Suggests an $\epsilon$ of approximately 2 to 3.
  • Shuffling Lower Bound (The "Actual" Reality): Shows the $\epsilon$ is actually greater than 10.

In practical terms, an $\epsilon$ of 2 is often considered "strong" privacy, while an $\epsilon$ of 10 is often considered "weak" or even meaningless in certain contexts. The paper demonstrates that as $\epsilon$ grows, the privacy loss for shuffling decays much more slowly than the Poisson model predicts, meaning the tail of the privacy risk is much fatter than previously assumed.

Limitations and Future Work

The authors acknowledge a few key limitations in their current analysis:

  • Lower Bounds Only: While they proved that shuffling is at least this bad, they haven't yet produced a "tight" accountant (an upper bound) that dictates exactly how much privacy shuffling provides.
  • Single Epoch Focus: The analysis focuses on a single epoch (one pass through the data). Real-world training often involves dozens of epochs, and the privacy composition over multiple shuffled epochs remains an open, complex question.
  • Alternative Algorithms: The paper suggests that to achieve the efficiency of shuffling with better privacy, the field might need to move away from DP-SGD entirely and look toward algorithms like DP-FTRL (Follow-the-Regularized-Leader), which do not rely on sampling for privacy amplification.

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 are DP-SGD Implementations?}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=xWI0MKwJSS},
}
Figure