Abstract
Differential Privacy (DP) provides rigorous mathematical guarantees for data privacy, yet its practical implementation is notoriously susceptible to subtle bugs. Traditional empirical auditing methods rely on batch hypothesis testing, which requires a fixed, often prohibitively large, number of samples. This paper introduces a sequential hypothesis testing framework for auditing DP guarantees in black-box algorithms. By leveraging Maximum Mean Discrepancy (MMD) and "testing by betting" techniques, the proposed method monitors algorithm outputs in real-time and terminates as soon as a privacy violation is detected. Experimental results demonstrate that this approach reduces the required sample size by orders of magnitude, enabling the detection of implementation flaws in DP-SGD in significantly less than a single training run.
Introduction
While Differential Privacy (DP) offers a robust framework for protecting individual privacy in datasets, the transition from theoretical models to software implementations is error-prone. Small oversights, such as incorrect constant scaling or flawed random number generation, can lead to significant privacy leakages that are difficult to detect through standard debugging. Empirical privacy auditing addresses this by treating the algorithm as a black box and using statistical hypothesis testing to verify if the output distributions conform to the claimed privacy parameters ($\epsilon, \delta$).
Historically, these audits have been conducted using "batch" tests. In a batch setting, an auditor must pre-determine a sample size $n$. If $n$ is too small, the test lacks the statistical power to detect a violation; if $n$ is too large, it wastes significant computational resources. This inefficiency is particularly acute when auditing complex machine learning models like Differentially Private Stochastic Gradient Descent (DP-SGD), where each sample requires a computationally expensive training pass. This paper proposes a sequential alternative that adapts to the data stream, optimizing both time and compute.
Methodology: Testing by Betting
The core of the proposed framework is a sequential hypothesis test built on the principles of e-values and nonnegative supermartingales, a concept often referred to as "testing by betting." In this paradigm, the auditor starts with an initial "wealth" and places bets on the likelihood that the observed outputs of an algorithm violate the null hypothesis (i.e., that the algorithm is private). If the wealth grows beyond a certain threshold, the null hypothesis is rejected, and a privacy violation is confirmed.
Maximum Mean Discrepancy (MMD)
To measure the divergence between the output distributions of an algorithm running on two adjacent datasets, the authors utilize Maximum Mean Discrepancy (MMD). MMD is a kernel-based statistic that avoids the need for explicit density estimation, making it well-suited for high-dimensional outputs.
Theoretical and Optimization Contributions
A primary challenge in using MMD for DP auditing is the mathematical gap between MMD and the Hockey-Stick divergence, which is the native measure for $(\epsilon, \delta)$-DP. The authors provide a tighter theoretical bound (Theorem 3.1) that connects these two measures. Unlike previous bounds that diverged as $\epsilon$ increased, this new bound remains stable, significantly enhancing the test's statistical power.
To ensure the test accumulates evidence as quickly as possible, the authors employ online learning techniques:
- Online Gradient Ascent (OGA): Used to learn the optimal "witness function" for the MMD, maximizing the perceived difference between distributions.
- Online Newton Step (ONS): Used to adaptively tune the learning rate parameter ($\lambda$), allowing the test to optimize its betting strategy without prior knowledge of the distribution's properties.
Experimental Evaluation
The framework was evaluated across several scenarios to test its robustness and efficiency:
- Synthetic Mechanisms: Testing against Gaussian and perturbed uniform distributions to verify Type I error control.
- Mean Estimation: Auditing additive-noise mechanisms (Laplace and Gaussian). This included testing both correct implementations and "buggy" versions with insufficient noise.
- DP-SGD Auditing: A practical application involving "canary gradients" inserted into neural network training batches to detect privacy failures in real-time.
Key Results
The sequential auditing framework outperformed existing batch methods across all metrics:
- Efficiency: For flawed mean estimation mechanisms, the sequential test detected violations using only 190 to 1,150 samples. In contrast, the state-of-the-art batch method, DP-Auditorium, failed to detect the same violations even with 500,000 samples.
- Real-time DP-SGD Auditing: The test successfully identified non-private DP-SGD implementations in just 60 to 75 gradient observations. This allows auditors to stop a training run almost immediately after a bug manifests, rather than waiting for multiple full training cycles.
- Reliability: The test maintained a 0% Type I error rate (false positives) on correctly implemented private mechanisms, confirming that the sequential approach does not sacrifice rigor for speed.
Discussion and Limitations
While the sequential MMD approach is highly effective for small to moderate privacy budgets, it faces challenges in the high-privacy-budget regime (e.g., $\epsilon > 0.6$). In these cases, the MMD statistic converges toward its rejection threshold, requiring a significantly higher number of samples to achieve statistical significance. Additionally, the current framework assumes the auditor can identify the "worst-case" adjacent datasets; it does not currently automate the discovery of these datasets.
Future research directions include extending this sequential framework to other privacy definitions, such as Rényi Differential Privacy (RDP), and integrating adaptive search algorithms to automatically identify the most vulnerable dataset pairs for auditing.
Summary updated