Debugging Differential Privacy: A Case Study for Privacy Auditing

Florian Tramèr, Andreas Terzis, Thomas Steinke, Shuang Song, Matthew Jagielski, Nicholas CarliniarXiv 2022

Introduction

Differential Privacy (DP) has emerged as the gold standard for privacy-preserving machine learning, providing a provable guarantee (parameterized by $\epsilon$) that a model does not memorize specific training examples. However, a mathematical proof is only as robust as its implementation. In "Debugging Differential Privacy," researchers from Google Research demonstrate that DP implementations are prone to "silent failures"—bugs that do not cause crashes but instead quietly erode privacy guarantees. This work establishes privacy auditing, traditionally used to measure the tightness of privacy bounds, as a critical debugging tool for verifying DP software.

The Challenge of Silent Failures

Unlike standard software bugs, errors in DP implementations often lead to better model performance (e.g., higher accuracy or faster convergence) because the algorithm fails to add sufficient noise. This creates a perverse incentive where developers might celebrate state-of-the-art results that are actually the byproduct of a broken privacy guarantee. Because these failures do not manifest as errors or performance degradation, empirical verification tools are necessary to bridge the gap between theoretical proofs and actual code.

Methodology: Privacy Auditing via Membership Inference

The authors propose using membership inference attacks to audit DP implementations. If an algorithm is $(\epsilon, \delta)$-DP, there is a theoretical maximum success rate for an adversary attempting to determine if a specific sample was included in the training set. If an empirical attack exceeds this rate, the claimed $\epsilon$ is demonstrably false.

The auditing process involves:

  1. Canary Insertion: A "poisoned" sample (e.g., a mislabeled MNIST digit with a unique pattern) is inserted into the dataset. This sample is designed to be easily memorized if privacy is weak.
  2. Massive Training: The authors train a large ensemble of models (e.g., 100,000) on the dataset with the canary and an equal number without it.
  3. Threshold-Based Attack: A simple loss-based threshold is applied. If the model's loss on the canary is below a certain threshold, the adversary guesses it was in the training set.
Distribution of model losses on a poisoned 'canary' example. The separation between models trained with the canary (Poisoned) and without it (Baseline) allows for a membership inference attack using a loss threshold.
  1. Statistical Verification: Using Clopper-Pearson confidence intervals, the attack's success rate is converted into a statistically significant lower bound for $\epsilon$.

Case Study: The Batch Size Blunder

The authors applied this auditing framework to a recent high-profile DP training scheme, Backpropagation Clipping, which claimed to outperform state-of-the-art methods by a factor of 30. The audit revealed a catastrophic discrepancy: while the algorithm claimed a privacy guarantee of $\epsilon = 0.21$, the empirical audit proved a lower bound of $\epsilon > 2.79$ with $99.99999999\%$ confidence ($p < 10^{-10}$).

The root cause was a common implementation error: the code mistakenly divided the sensitivity of the gradient by the batch size $|B|$, effectively reducing the required noise by a factor of $|B|$. Since clipping was already performed at the per-example level, this division was redundant and invalidated the privacy proof. The authors suggest a simple "Triangle Inequality Test" as a sanity check: the norm of a batch gradient must always be less than or equal to the product of the batch size and the per-example clipping threshold.

Conclusion and Recommendations

Auditing provides a necessary empirical check on DP implementations, though it only provides a lower bound on privacy leakage. A successful audit does not prove code is "correct," but a failed one definitively proves it is broken. The authors advocate for:

  • Integrating empirical auditing as a standard unit test in DP libraries.
  • Releasing full implementation code alongside DP research papers.
  • Providing formal algorithm descriptions that explicitly handle constants like batch size and sensitivity.

By making auditing a routine part of the development lifecycle, the community can move toward DP software that is as reliable in practice as it is in theory.

Summary updated

BibTeX
@misc{tramer2022debugging,
  author = {Florian Tramèr and Andreas Terzis and Thomas Steinke and Shuang Song and Matthew Jagielski and Nicholas Carlini},
  title = {{Debugging Differential Privacy: A Case Study for Privacy Auditing}},
  year = {2022},
  eprint = {2202.12219},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2202.12219},
}
Figure