How Private are DP-SGD Implementations?

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

TL;DR

This paper reveals a significant gap between the theoretical privacy guarantees of Differentially Private Stochastic Gradient Descent (DP-SGD) and its common practical implementations. By analyzing different batch sampling strategies, the authors demonstrate that relying on the privacy analysis for Poisson subsampling can lead to a substantial underestimation of privacy loss when shuffling is actually used, urging caution in reporting DP parameters.

What Problem Does This Paper Address?

Differentially Private Stochastic Gradient Descent (DP-SGD) is a cornerstone for training machine learning models with privacy guarantees. The theoretical analysis of DP-SGD, particularly the seminal work by Abadi et al. (2016), often relies on a specific batch sampling mechanism called Poisson subsampling. This mechanism, while amenable to rigorous privacy analysis, is challenging to implement efficiently at scale. In practice, many implementations opt for a simpler and more efficient batch sampling strategy: shuffling the dataset and then dividing it into fixed-size mini-batches.

The core problem this paper addresses is the mismatch between the privacy analysis and the actual implementation of DP-SGD. Researchers and practitioners often use the privacy bounds derived for Poisson subsampling even when their implementation uses shuffling. This paper investigates whether this common practice is justified and quantifies the potential discrepancy in privacy guarantees.

Methods

The paper's core methodology involves analyzing the privacy guarantees of an abstract mechanism called Adaptive Batch Linear Queries (ABLQB), which serves as a general framework for DP-SGD. They compare three batch sampling strategies:

  • Deterministic (D): Batches are formed by sequentially taking fixed-size chunks of the dataset.
  • Shuffle (S): The entire dataset is randomly permuted, and then divided into fixed-size batches.
  • Poisson (P): Each data point is included in a batch with a certain probability, leading to variable-sized batches.

The privacy analysis is performed using the concept of hockey stick divergence, a measure related to differential privacy. The authors derive and compare the privacy loss curves (δ(ε)) for ABLQB under these different sampling strategies. They also leverage existing privacy accounting tools like Rényi Differential Privacy (RDP) and Privacy Loss Distributions (PLD) for numerical evaluations.

Datasets

The paper does not introduce new datasets. Instead, it uses theoretical analysis and numerical experiments to demonstrate the privacy gaps. The figures and tables present results based on varying parameters like noise level ($\sigma$), number of training steps ($T$), and privacy budget ($\delta$), rather than specific datasets.

Key Insights and Ideas

  • Shuffling is not always better than deterministic batching: While shuffling (S) generally offers better privacy than deterministic batching (D), the paper shows that ABLQs always satisfies stronger privacy guarantees than ABLQD (δS(ε) ≤ δD(ε)).
  • Poisson vs. Deterministic is incomparable: The privacy guarantees of ABLQD and ABLQP are not directly comparable. For small privacy budgets (ε), Poisson subsampling (P) can be more private than deterministic batching (D), but for larger ε, deterministic batching can offer better privacy.
  • The "Poisson analysis for shuffling" is a dangerous shortcut: The most critical insight is that the privacy analysis for Poisson subsampling (P) can significantly underestimate the privacy loss when shuffling (S) is actually used, especially for larger privacy budgets. This means implementations claiming DP guarantees based on Poisson analysis might be less private than advertised.
  • Shuffling's amplification can be limited: The paper demonstrates that the privacy amplification benefits of shuffling can be severely limited in certain practical regimes, sometimes performing worse than Poisson subsampling. This is because non-differing records in shuffled batches can inadvertently leak information about the position of the differing record.

Key Results

  • Theorem 4.1: Shuffling-based DP-SGD (ABLQs) always provides stronger or equal privacy guarantees compared to deterministic batching (ABLQD) for any given privacy budget.
  • Theorem 4.2: The privacy loss of deterministic batching (ABLQD) and Poisson subsampling (ABLQP) are incomparable. Specifically, for small ε, ABLQD is more private, while for large ε, ABLQP is more private.
  • Empirical evidence (Figures 1-7): Numerical experiments consistently show that the lower bound on privacy loss for shuffling (δS(ε)) can be substantially larger than the upper bounds for Poisson subsampling (δP(ε)) and even deterministic batching (δD(ε)) in certain parameter regimes, particularly for larger ε. For instance, Figure 1 shows that for small noise ($\sigma$), shuffling incurs a significantly higher privacy cost compared to Poisson subsampling.

Limitations and Future Work

  • Conjecture 3.2: The paper conjectures that a specific pair of distributions (Ps, Qs) tightly dominates the shuffle-based mechanism (ABLQs) for all adaptive query methods. While this conjecture is not strictly necessary for their main results, proving it would enable tighter numerical accountants for ABLQs.
  • Tight Accounting for Shuffling: The paper provides lower bounds for shuffling-based DP-SGD but lacks a tight accounting method. Developing such a method, potentially by establishing Conjecture 3.2, is a key future direction.
  • Multiple Epochs: The current analysis focuses on a "single epoch" mechanism. Extending the analysis to multiple epochs, which is common in practice, is an important area for future work.
  • Practical Batch Samplers: The paper uses a simplified model of shuffling. Real-world data loaders might employ more complex shuffling strategies (e.g., with buffer sizes) that require more nuanced privacy analysis.
  • Utility Trade-offs: The paper focuses solely on privacy guarantees. Future work could investigate how using the correct, potentially weaker, privacy analysis for shuffling impacts the utility (e.g., model accuracy) of DP-SGD.
  • Alternative DP Techniques: Exploring alternative DP amplification techniques (e.g., amplification by iteration) for non-convex settings, or investigating other DP algorithms that might be less sensitive to batch sampling choices, are also suggested.

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