Privacy Auditing with One (1) Training Run
Thomas Steinke, Milad Nasr, Matthew Jagielski
Introduction
Differential privacy (DP) [DMNS06] provides a quantifiable privacy guarantee by ensuring that no person’s data significantly affects the probability of any outcome. Formally, a randomized algorithm satisfies -DP if, for any pair of inputs differing only by the addition or removal of one person’s data and any measurable , we have
A DP algorithm is accompanied by a mathematical proof giving an upper bound on the privacy parameters and . In contrast, a privacy audit provides an empirical lower bound on the privacy parameters. Privacy audits allow us to assess the tightness of the mathematical analysis [JUO20, NHSBTJCT23] or, if the lower and upper bounds are contradictory, to detect errors in the analysis or in the algorithm’s implementation [TTSSJC22].
Can we perform privacy auditing using a single run of the algorithm M?
This is the question we address in our work.
Our approach (§2): The DP definition (1) considers adding or removing a single person’s data to or from the dataset. We consider multiple people’s data and the dataset independently includes or excludes each person’s data point. Our analysis exploits the parallelism of multiple independent data points in a single run of the algorithm in lieu of multiple independent runs.
Our auditing procedure operates as follows. We identify data points (i.e., training examples or “canaries”) to either include or exclude and we flip independent unbiased coins to decide which of them to include or exclude. We then run the algorithm on the randomly selected dataset. Based on the output of the algorithm, the auditor “guesses” whether or not each data point was included or excluded (or it can abstain from guessing for some data points). We obtain a lower bound on the privacy parameters from the fraction of guesses that were correct.
Intuitively, if the algorithm is -DP, then the auditor can correctly guess each inclusion/exclusion coin flip with probability at most . Thus DP implies a high-probability upper bound on the fraction of correct guesses and, conversely, a large fraction of correct guesses implies a high-probability lower bound on the privacy parameters.
Our analysis (§5): Naïvely, analyzing the addition or removal of multiple data elements would rely on group privacy; but this does not exploit the fact that the data items were included or excluded independently. Instead, we leverage the connection between DP and generalization [DFHPRR15a, DFHPRR15, BNSSSU16, RRST16, JLNRSMS19, SZ20]. Our main theoretical contribution is an improved analysis of this connection that is tailored to yield nearly tight bounds in our setting.
Informally, if we run a DP algorithm on i.i.d. samples from some distribution, then, conditioned on the output of the algorithm, the samples are still “close” to being i.i.d. samples from that distribution. There is some technicality in making this precise, but, roughly speaking, we show that including or excluding data points independently for one run is essentially as good as having independent runs (as long as is small).
Our results (§6): We implement our new auditing framework to audit DP-SGD training on a WideResNet model, trained on the CIFAR10 dataset across multiple configurations. Our approach successfully achieves an empirical lower bound of , compared to a theoretical upper bound of in the white-box setting. The examples we insert for auditing (known in the literature as “canaries”) do not significantly impact the accuracy of the final model (less than a decrease in accuracy) and our procedure only requires a single end-to-end training run. Such results were previously unattainable in the setting where only one model could be trained.
Our Auditing Procedure
We now present our auditing procedure in Algorithm 1. We independently include each of the first examples with 50% probability and exclude it otherwise.Alternatively, we could also consider a different probability of inclusion; our theoretical results can handle this (see Proposition 5.7). However, this seems unlikely to be useful, as it intuitively lowers the signal-to-noise ratio. Another alternative is to non-independently choose which points to include to ensure has a fixed size; see Appendix A. Our approach is applicable to both white-box auditing in the sense that the adversary has access to all intermediate values of the model weights and black-box auditing in the sense that the adversary only sees the final model weights (or can only query the final model). In both cases we compute a “score” for each example and “guess” whether the example is included or excluded based on these scores. Specifically, we guess that the examples with the highest scores are included and the examples with the lowest scores are excluded, and we abstain from guessing for the remaining auditing examples; the setting of these parameters will depend on the application.
Note that we only randomize the first examples (which we refer to as “auditing examples” or “canaries”); the last examples are always included and, thus, we do not make any guesses about them. To get the strongest auditing results we would set , but we usually want to set . For example, computing the score of all examples may be computationally prohibitive, so we only compute the scores of examples. Also we may wish to artificially construct examples to be easy to identify (i.e., canaries), but still include “real” examples to ensure that still produces a useful model. (I.e., having more training examples improves the performance of the model.)
Intuitively, the vector of scores should be correlated with the true selection , but too strong a correlation would violate DP. This is the basis of our audit. Specifically, the auditor computes from which is a “guess” at . By the postprocessing property of DP, the guesses are a differentially private function of the true , which means that they cannot be too accurate.
To obtain a lower bound on the DP parameters, in Section 5, we show that DP implies a high-probability upper bound on the number of correct guesses . The observed value of then yields a high-probability lower bound on the DP parameters. To be more precise, we have the following guarantee.
If we ignore for the moment, Theorem 2.1 says that the number of correct guesses is stochastically dominated by , where is the total number of guesses. This binomial distribution is precisely the distribution of correct guesses we would get if was obtained by independently performing -DP randomized response on bits of . In other words, the theorem says that -DP randomized response is the worst-case algorithm in terms of the number of correct guesses. In particular, this means the theorem is tight (when )
The binomial distribution is well-concentrated. In particular, for all , we have
There is an additional term in the guarantee (2). The exact expression for this term is somewhat complex. It is always , but it is much smaller than this for reasonable parameter values. In particular, for as in Equation 3 with , this term is .
Theorem 2.1 gives us a hypothesis test: If is -DP, then the number of correct guesses is with high probability. Thus, if the observed number of correct guesses is larger than this, we can reject the hypothesis that satisfies -DP. We can convert this hypothesis test into a confidence interval (i.e., a lower bound on ) by finding the largest that we can reject at a desired level of confidence; see Section 4.3.
Related Work
The goal of privacy auditing is to empirically estimate the privacy provided by an algorithm, typically to accompany a formal privacy guarantee. Early work on auditing has often been motivated by trying to identify bugs in the implementations of differentially private data analysis algorithms [DWWZK18, BGDCTV18].
Techniques for auditing differentially private machine learning typically rely on conducting some form of membership inference attack [SSSS17];[SSSS17] coined the term “membership inference attack” and were the first to apply such attacks to machine learning systems. However, similar attacks were developed for applications to genetic data [HSRDTMPSNC08, SOJH09, DSSUV15] and in cryptography [BS98, Tar08]. these attacks are designed to detect the presence or absence of an individual example in the training set. Essentially, a membership inference attack which achieves some true positive rate (TPR) and false positive rate (FPR) gives a lower bound on the privacy parameter (after ensuring statistical validity of the TPR and FPR estimates).
[JE19] use standard membership inference attacks to evaluate different privacy analysis algorithms. [JUO20] consider inferring membership of worst-case “poisoning” examples to conduct stronger membership inference attacks and understand the tightness of privacy analysis. [NSTPC21] measure the tightness of privacy analysis under a variety of threat models, including showing that the DP-SGD analysis is tight in the threat model assumed by the standard DP-SGD analysis.
Improvements to auditing have been made in a variety of directions. For example, [NHSBTJCT23] and [MSS22] take advantage of the iterative nature of DP-SGD, auditing individual steps to understand privacy of the end-to-end algorithm. Improvements have also been made to the basic statistical techniques for estimating the parameter, for example by using Log-Katz confidence intervals [LMFLZWRFT22], Bayesian techniques [ZBWTSRPNK22], or auditing algorithms in different privacy definitions [NHSBTJCT23]. [AKOOMS23] build on the observation that, when performing membership inference, analyzing the case where the data is not included does not require re-running the algorithm; instead we can re-sample the excluded data point; if the data points are i.i.d. from a nice distribution, this permits closed-form analysis of the excluded case.
A recent heuristic proposed to improve the efficiency of auditing is performing membership inference on multiple examples simultaneously. This heuristic was proposed by [MEMPST21], and evaluated more rigorously by [ZBWTSRPNK22]. However, this heuristic is not theoretically justified, as the TPR and FPR estimates are not based on independent samples. In our work, we provide a proof of the validity of this heuristic. In fact, with this proof, we show for the first time that standard membership inference attacks, which attack multiple examples per training run, can be used for auditing analysis; prior work using these attacks must make an independence assumption. As a result, auditing can take advantage of progress in the membership inference field [CCNSTT22, WBKBGGG22].
Background
We briefly review some standard background material. Readers may wish to skip to the next section and revisit this only if necessary.
They We recite the definitions of differential privacy and some relevant relaxations. For detailed background, see the tutorial by [Vad17] or the textbook by [DR14].
Let be a randomized algorithm, where . We say is -differentially private (-DP) if, for all differing only by the addition or removal of one element, we have
We say is -Rényi differentially private (-RDP) if, for all differing only by the addition or removal of one element, we have
We say is -zero concentrated differentially private (-zCDP) if, for all differing only by the addition or removal of one element, we have
In this paper, we focus on to the addition or removal notion of DP, rather than replacement. (In Appendix A, we consider replacement.) Note that, in our theoretical analysis, we consider DP algorithms of the form . In this case, DP is with respect to flipping one of the input bits, as each bit indicates whether some example is included or excluded.
The main property of DP that we use is invariance under postprocessing. That is, if satisfies DP and is an arbitrary function, then also satisfies DP with the same parameters.
A common method for achieving DP is Gaussian noise addition. The following gives the optimal DP guarantee for the Gaussian mechanism.
2 DP-SGD – Differentially Private Stochastic Gradient Descent
The algorithm whose privacy we are most interested in auditing is Differentially Private Stochastic Gradient Descent (DP-SGD, Algorithm 2). This is the workhorse of private machine learning both in theory [BST14] and in practice [ACGMMTZ16].
DP-SGD satisfies differential privacy. Much ink has been spilled precisely quantifying its privacy properties [MTZ19, WBK19, KJH20, GLW21, ZDW22, etc.]. A simple guarantee is the following.
DP-SGD (Algorithm 2) satisfies -RDP for
If , then DP-SGD should provide meaningful privacy protection. In particular, -RDP implies that membership inference has a maximum accuracy (in the balanced case) of
3 Hypothesis Testing & Statistical Estimation
Our goal is to estimate the privacy parameters of the algorithm that we are auditing. As prior work has noted [DWWZK18, JUO20], this task can be framed as statistical estimation, with a goal of outputting a statistical lower bound on the privacy parameters. These lower bounds will have a corresponding confidence level, roughly representing the probability that the lower bound could have been produced even when analyzing an algorithm with perfect privacy. As empirical methods, it is impossible to have 100% confidence in our methods, so we will generally use 95% confidence in our experiments, comparable to the use of in science literature.
To be precise, our auditor runs the algorithm and outputs with the following guarantee. If satisfies -DP, then, with probability at least , we have . Here is the confidence level and is fixed. Note that this is a frequentist guarantee, rather than a Bayesian guarantee. That is, the probability is with respect to our auditing procedure, rather than a statement about our beliefs about .
We can also view this in terms of hypothesis testing. Here we start with a “null hypothesis” that satisfies -DP and the auditor’s goal is to test this hypothesis by running . If the auditor rejects this null hypothesis, then this gives us a lower bound .
The difference between hypothesis testing and statistical estimation is that a hypothesis test starts with a given and outputs a binary decision to reject or not, while an estimator outputs a number . However, we can convert between these:
Further suppose that, if , then . Then, for all and all ,
Fix a realization of and suppose . Then there exists some with and, hence,
The equality above follows from our monotonicity assumption on . Thus
To interpret Lemma 4.7, is an algorithm and is the “true” privacy parameter that it satisfies. (We’re considering to be fixed.) The random variable is the output of our auditing procedure applied to . (This is our test statistic in the language of hypothesis testing.) The hypothesis test’s rejection set is and Equation 5 guarantees that, if is indeed -DP (i.e., the null hypothesis is true), then the probability that we reject the null hypothesis is at most . Equation 6 then shows how to estimate the true privacy parameter from ; we simply take the largest for which we can reject the corresponding null hypothesis.
Note that Lemma 4.7 needs to make a technical monotonicity assumption. In our setting this simply means that, if a given realization of the test statistic allows us to reject the null hypothesis that is -DP and , then we can also reject the null hypothesis that is -DP.
4 Stochastic Dominance
In our theoretical analysis we use the concept of stochastic dominance. Specifically, we use this to formalize the “worst-case” DP algorithm for auditing.
Stochastic dominance is preserved under sums/convolutions:
Theoretical Analysis
To analyze the results of our audit, we leverage the connection between DP and generalization [DFHPRR15a, DFHPRR15, BNSSSU16, RRST16, JLNRSMS19, SZ20]. Unfortunately, directly applying the existing results from the literature is unlikely to yield meaningful results, as the constants are not optimal. Thus we provide an analysis of DP’s generalization guarantees that is suitable for our application and which has sharp constants.
The algorithm represents both the “real” algorithm (e.g., DP-SGD) and the auditor which postprocesses the output of the real algorithm into guesses. In this formalism, the examples themselves are considered fixed and not part of the input – i.e., the examples are “hardcoded” into . The algorithm is an abstraction for our analysis, rather than a realistic system.
where is uniform on and . If and disagree in sign (i.e., the guess is wrong), then ; if they agree (i.e., the guess is right), then . That is, increases when we guess correctly and the increase is proportional to how much “weight” we placed on that guess. The auditor seeks to maximize and then we compare it to a baseline that is consistent with DP. (The analysis in this section focuses on computing this baseline.) Incorrect guesses do not increase , but they do increase the baseline. Note that we can guess , which amounts to abstaining from making a guess; this doesn’t increase , but also doesn’t increase the baseline.
Our formalism is inspired by that of [SZ20], who also restrict to binary inputs. In contrast, most of the work connecting DP and generalization does not do this. The benefit of restricting to binary inputs which represent inclusion or exclusion of a data point is that it simplifies our analysis.
We first consider the pure DP () case, as it is considerably simpler than the general case. We follow the analysis of [JLNRSMS19] with some refinement. Specifically, rather than relying on a Hoeffding bound, we show that it is stochastically dominated by a Binomial distribution. This result is tight – i.e., if independently performs a randomized response for each input bit, then the inequality becomes an equality.
Proposition 5.1 is Bayesian: We condition on the output and then consider the probability that each guess was right. The vector should be seen as indicating whether each guess was right. The proposition says that, in the worst case, each guess is correct independently with probability .
How do we use this result? Suppose we have conducted an audit and observed and as the output of Algorithm 3. Let . Following Lemma 4.7, we choose a desired confidence (e.g., ) and then we choose so that . Then this value of is our lower bound.
2 Approximate DP Analysis
Our analysis most closely resembles that of [RRST16]. Essentially, we repeat the analysis for the pure DP case, but add some failure events, and carefully account for how much they can distort the results.
In particular, if we substitute into Equation 11, we get
Since stochastically dominates for all in the support of , we can apply Theorem 5.2 to obtain the first part of the result (10).
Setting yields the second part of the result (11) ∎
In the next corollary we restrict to ternary outputs, so it must either guess () or abstain (). We bound the number of guesses by . In this case the dominating distribution is a binomial distribution, which is relatively easy to compute. This is the form of Theorem 5.2 that we use in all of our experimental results. We provide pseudocode in Appendix D.
Now we delve into the proof of Theorem 5.2. We use a decomposition result of [KOV15] (see also [MV15] & [Ste22, Corollary 24]).
Let and be probability distributions over . Fix . Suppose that, for all measurable , we have and .
Then there exist and distributions , , , and over such that the following three properties are all satisfied. First, we can express and as convex combinations:
Second, for all measurable , we have . Third, there exist measurable such that , , , and .
This proof follows that of [Ste22]. We begin with some formalities: Fix some base measure such that and are absolutely continuous with respect to the base measure. (If and are discrete distributions, this can be the counting measure. If they are continuous distributions, this can be the Lebesgue measure. In general, serves as such a measure.) For , let and denote the Radon-Nikodym derivative of and, respectively, with respect to this base measure.
If for all measurable , then the result follows trivially by setting , and , and choosing and to be arbitrary distributions supported on and respectively. Thus we assume that this is not the case and, hence, that and .
Similarly, if and , then the result follows trivially by setting , , , and arbitrary. Thus we assume that .
Fix to be determined later. Define distributions , , , and (in terms of their Radon-Nikodym derivatives) as follows. For all points ,
where are appropriate normalizing constants. (We will choose to avoid and, likewise, we will choose to avoid .)
By construction, and , so the first property is satisfied. Note that is supported on and is supported on , which implies the third property.
If , then we have the appropriate decomposition (with ) and, for all , we have
It only remains to show that we can ensure that by appropriately setting . We have
where . If , then by assumption. If , then . By decreasing , we continuously increase . Thus, by starting at and decreasing until either or , we can pick such that . Similarly, we can pick , such that . ∎
We need a Bayesian version of this decomposition. I.e., suppose we observe a sample from either or and we have a prior on these two possibilities, what is the posterior distribution on possibilities? The following gives such a result. However, it introduces an event . Intuitively, when , then we get the result we would get under pure DP. But with probability , in which case things can fail arbitrarily.
[KS14, Lemma 3.4] provide a similar result. Ours improves the constant factors and is also stated slightly differently.
Let and be probability distributions over . Fix . Suppose that, for all measurable , we have and .
Then there exists a randomized function with the following properties.
Fix and suppose . If , sample ; and, if , sample . Then, for all , we have
We apply the decomposition from Lemma 5.5: There exist distributions , , , and over and such that
and, for all , and and . (Here denotes the Radon-Nikodym derivative of the distribution with respect to some appropriate base measure and similarly for the other distributions.)
We define by
since . For any , we have
Now we can prove an analog of Proposition 5.1 for the -DP setting.
For and , let denote the distribution on obtained by conditioning on . We can express this as a convex combination:
For distributions and on , let be the randomized function promised by Lemma 5.6. In our analysis, the internal randomness of is independent from everything else – i.e., the only dependence is induced by its input. Specifically, for all , all , and all , we have
Symmetrically, for all , all , and all , we have
For simplicity, we define a symmetric event: , where the internal randomnesses are again independent. Combining these, we have, for all , all , and all ,
For , , and , define
where, for each independently, if and if .
By induction and Lemma 4.9, for any and , the conditional distribution where is stochastically dominated by .
For and , define
Since the conditional distribution where is stochastically dominated by , is stochastically dominated by the convolution .
Finally is supported on and
Since does not depend on , the input does not contribute to the dependence between and , so we can elide this input in the statement – i.e., for drawn from an appropriate distribution. ∎
Proposition 5.7 is rather unwieldy. It can be simplified by setting and identifying the optimal distribution , which yields Theorem 5.2.
where for .
By strong duality, the linear program above has the same value as its dual:
Any feasible solution to the dual gives an upper bound on the primal. So, in particular, we can use the solution given by
Theorem 5.2 gives a worst-case bound in terms of . Specifically, must uniformly bound for all in the support of . Proposition 5.7 is more general than this. Thus we give another corollary that allows us to have the bound adjust to . In particular, this result allows the auditing procedure (Algorithm 1 or 3) to dynamically choose the number of guesses .
Let satisfy -DP. Let be uniformly random. Let . Then, for all and ,
Setting in Proposition 5.7 yields
By a union bound and Markov’s inequality, we have, for all , all , and all ,
We combine inequalities, set , and average over to obtain
Experiments
Our contributions are focused on improved analysis of an existing privacy attack, and are therefore orthogonal to the design of an attack. As a result, we rely on the experimental setup of the recent auditing procedure of [NHSBTJCT23].
We run DP-SGD on the CIFAR-10 dataset with Wide ResNet (WRN-16) [ZK16], we followed the experimental setup from \AtNextCite\AtEachCitekey\@nocounterrmaxnames[NHSBTJCT23]. Our experiments reach test accuracy at -DP, which is comparable with the state-of-the-art [DBHSB22]. Unless specified otherwise, all lower bounds are presented with confidence. Following \AtNextCite\AtEachCitekey\@nocounterrmaxnames[NHSBTJCT23], we refer to the setting where the adversary has access to all intermediate steps as “white-box” and when the adversary can only see the last iteration as “black-box.” We experiment with both settings.
Algorithm 3 summarizes our approach for auditing DP-SGD. The results are converted into lower bounds on the privacy parameters using Theorem 5.2 / Corollary 5.4.
We also experiment with both the gradient and input attacks proposed by \AtNextCite\AtEachCitekey\@nocounterrmaxnames[NHSBTJCT23]. In particular, for the gradient attack we use the strongest attack they proposed – the “Dirac canary” approach – which sets all gradients to zero except at a single random index. In our setting where we need to create multiple auditing examples (canaries) we make sure the indices selected in our experiments do not have any repetitions. To compute the score for gradient space attacks, we use the dot product between the gradient update and auditing gradient. When auditing in input space, we leverage two different types of injected examples as:
Mislabeled example: We select a random subset of the test set and randomly relabel them (ensuring the new label is not the same as the original label).
In-distribution example: We select a random subset of the test set.
For input space audits, we use the loss of the input example as the score. In our experiments we report the attack with the highest lower bound.
In our experiments, we evaluate different values of and and only report the highest auditing results. Since this is doing multiple hypothesis testing on the same data, we are reducing the confidence value of our results. However, this is commonly used in the previous works [ZBWTSRPNK22, MSS22] and can be easily improved by using a different set of observations to select the parameters for the auditing and another set of the data for the auditing itself (see also Corollary 5.8).
1 Gradient Space attacks
We start with the strongest attack: We assume white-box access – i.e., the auditor sees all intermediate iterates of DP-SGD – and that the auditor can insert examples with arbitrary gradients into the training procedure. First, we evaluate the effect of the number of the auditing example on the tightness. Figure 5 demonstrates that as the number of examples increases, the auditing becomes tighter. However, the impact of the additional examples eventually diminishes. Intriguingly, adding more non-auditing training examples (resulting in a larger compared to ) does not seem to influence the tightness of the auditing, as depicted in Figure 5. This can be primarily due to the fact that gradient attacks proposed in prior studies can generate near-worst-case datasets, irrespective of the presence of other data points.
Now we directly use the parameters used in the training CIFAR10 models. Figure 7 summarizes results for the CIFAR10 models. We used and all of the training dataset from CIFAR10 () for the attack. We were able to achieve accuracy for (, compared to when not auditing). We are able to achieve an empirical lower bound of for theoretical epsilon of respectively. While our results are not as tight as the prior works, we only require a single run of training which is not possible using the existing techniques. In the era of exponentially expanding machine learning models, the computational and financial costs of training these colossal architectures even once are significant. Expecting any individual or entity to shoulder the burden of training such models thousands of times for the sake of auditing or experimental purposes is both unrealistic and economically infeasible. Our method offers a unique advantage by facilitating the auditing of these models, allowing for an estimation of privacy leakage in a white-box setting without significantly affecting performance.
2 Input Space Attacks
Now we evaluate the effect of input space attacks in the black-box setting. In this attack, the auditor can only insert actual images into the training procedure and cannot control any of the aspects of the training. Then, the adversary can observe the final model as mentioned in Algorithm 3. This is the weakest attack setting.
For simplicity we start with the setting where ; in other words, all of the examples used to train the model are randomly included or excluded and can be used for auditing. Figure 9 illustrates the result of this setting. As we see from the figure, unlike the white-box attack we do not observe a monotonic relationship between the number of auditing examples and the tightness of the auditing. Intuitively, when the number of auditing examples are low then we do not have enough observations to have high confidence lower bounds for epsilon. On the other hand, when the number of auditing examples are high, the model does not have enough capacity to “memorize” all of the auditing examples which reduces the tightness of the auditing. However, this can be improved by designing better black-box attacks which we reiterate in the next section.
We also evaluate the effect of adding additional training data to the auditing in Figure 9. We see that adding superfluous training data significantly reduces the effectiveness of auditing. The observed reduction in auditing effectiveness with the addition of more training data could be attributed to several factors. One interpretation could be that the theoretical privacy analysis in a black-box setting tends to be considerably more loose when the adversary is constrained to this setting. This could potentially result in an overestimation of the privacy bounds. Conversely, it is also plausible that the results are due to the weak black-box attacks and can be improved in the future.
Discussion
Our main contribution is showing that we can audit the differential privacy guarantees of an algorithm with a single run. In contrast, prior methods require hundreds – if not thousands – of runs, which is computationally prohibitive for all but the simplest algorithms. Our experimental results demonstrate that in practical settings our methods are able to give meaningful lower bounds on the privacy parameter .
However, while we win on computational efficiency, we lose on tightness of our lower bounds. We now illustrate the limitations of our approach and discuss the extent to which this is inherent, and what lessons we can learn.
But, first, we illustrate that our method can give tight lower bounds. In Figure 10, we consider an idealized setting where the number of guesses changes and the fraction that are correct is fixed at for – i.e., 98.2% of guesses are correct.The number of correct guesses is rounded down to an integer (which results in the lines being jagged). There are no abstentions. This is the maximum expected fraction of correct guesses compatible with -DP. In this setting the lower bound on does indeed come close to . With 10,000 guesses we get with 95% confidence.
Note that the lower bound in Figure 10 improves as we increase the number of guesses. This is simply accounting for sampling error – to get a lower bound with 95% confidence, we must underestimate to account for the fact that the number of correct guesses may have been inflated by chance. As we get more guesses, the relative size of chance deviations reduces.
Limitations: Next we consider a different idealized setting – one that is arguably more realistic – where our method does not give tight lower bounds. Suppose indicates whether example is included or excluded. In Figure 11, we consider Gaussian noise addition. That is, we release a sample from . (In contrast, Figure 10 considers randomized response on .) Lemma 4.5 gives an upper bound of -DP. Unlike for randomized response, abstentions matter here. We consider 100,000 examples, each of which has a score sampled from , where is uniformly random. We pick the largest scores and guess . Similarly we guess for the smallest scores. We abstain for the remaining examples. If we make more guesses (i.e., increase ), then the accuracy goes down and so does our lower bound. We must trade off between more guesses being less accurate on average and more guesses having smaller relative sampling error.
In Figure 11, the highest value of the lower bound is for , which is attained by correct guesses out of . In contrast, the upper bound is for . To get a matching upper bound of we would need to set . In other words, the gap between the upper and lower bounds is a factor of in .
Figure 12 considers the same idealized setting as Figure 11, but we fix the number of guesses to 1,500 out of 100,000 (of which 1,429 are correct); instead we vary and consider different confidence levels.
Are these limitations inherent? Figures 11 & 12 illustrate the limitations of our approach. They also hint at the causes: The number of guesses versus abstentions, the parameter, and the confidence all have a large effect on the tightness of our lower bound.
Our theoretical analysis is fairly tight; there is little room to improve Theorem 5.2. We argue that the inherent problem is a mismatch between “realistic” DP algorithms and the “pathological” DP algorithms for which our analysis is nearly tight. This mismatch makes our lower bound much more sensitive to than it “should” be.
To be concrete about what we consider pathological, consider defined by Algorithm 4. This algorithm satisfies -DP and makes guesses with abstentions. In the case, the expected fraction of correct guesses is . This is higher than the average fraction of correct guesses, but if we want confidence in our lower bound, we must consider this case, as happens with probability .
Intuitively, the contribution from to the fraction of correct guesses should be negligible. However, we see that is multiplied by . That is to say, in the settings we consider, is multiplied by a factor on the order of or , which means makes a non-negligible contribution to the fraction of correct guesses.
It is tempting to try to circumvent this problem by simply setting to be very small. However, as shown in Figure 12, the upper bound on also increases as .
Unfortunately, there is no obvious general way to rule out algorithms that behave like Algorithm 4. The fundamental issue is that the privacy losses of the examples are not independent; we shouldn’t expect them to be independent, but we also shouldn’t expect them to be pathologically dependent in reality.
Directions for further work: Our work highlights several questions for further exploration:
Improved attacks: Our experimental evaluation uses existing attack methods. Any improvements to membership inference attacks could be combined with our results to yield improved privacy auditing.
One limitation of our attacks is that some examples may be “harder” than others and the scores we compute do not account for this. When we have many runs, we can account for the hardness of individual examples [CCNSTT22], but in our setting it is not obvious how to do this.
Algorithm-specific analyses: Our methods are generic – they can be applied to essentially any DP algorithm. This is a strength, but there is also the possibility that we could obtain stronger results by exploiting the structure of specific algorithms. A natural example of such structure is the iterative nature of DP-SGD. That is, we can view one run of DP-SGD as the composition of multiple independent DP algorithms which are run sequentially.
Multiple runs & multiple examples: Our method performs auditing by including or excluding multiple examples in a single training run, while most prior work performs multiple training runs with a single example example included or excluded. Can we get the best of both worlds? If we use multiple examples and multiple runs, we should be able to get tighter results with fewer runs.
Other measures of privacy: Our theoretical analysis is tailored to the standard definition of differential privacy. But there are other definitions of differential privacy such as Rényi DP. And, in particular, many of the upper bounds (e.g., Proposition 4.6) are stated in this language. Hence it would make sense for the lower bounds also to be stated in this language.
Beyond lower bounds: Privacy auditing produces empirical lower bounds on the privacy parameters. In contrast, mathematical analysis produces upper bounds. Both are necessarily conservative, which leaves a large gap between the upper and lower bounds. A natural question is to find some middle ground – an estimate which is neither a lower nor upper bound, but provides some meaningful estimate of the “true” privacy loss. However, it is unclear what kind of guarantee such an estimate should satisfy, or what interpretation the estimate should permit.
References
Appendix A Sampling a Fixed-Size Dataset
Our auditing framework considers randomly including or excluding examples independently. This means that the size of the dataset is random. This may be undesirable.
Fortunately, we can fix this, without changing our theoretical analysis. But it does require more examples and it requires changing the definition of DP to consider pairs of datasets differing by the replacement of one person’s data, rather than the addition or removal of one person’s data (cf. Remark 4.4).
Recall that our auditing framework starts with examples and then samples uniformly at random. Then each example is included in the dataset if and excluded if . Thus flipping corresponds to adding or removing .
Instead we can start with examples and then sample uniformly. Now, if , we include in the dataset and, if , we include instead. Thus flipping corresponds to replacing with or vice versa.
This alternative approach ensures that we always include out of the examples – i.e., the dataset size is not random. This still fits the formalism of our theoretical analysis (§5). However, the DP guarantee of the algorithm being audited (e.g., DP-SGD) must now be with respect to replacement of one example, rather than addition or removal.By group privacy, -DP for addition or removal implies -DP for replacement. The auditor also needs to change slightly; rather than being given and needing to guess whether or not it is included in the datsets, the auditor is given both and and must guess which of the two is included.
Appendix B Generalization from Differential Privacy
Our analysis builds on the connection between DP and generalization [DFHPRR15a, DFHPRR15, BNSSSU16, FS17, JLNRSMS19]. We now extend our theoretical results (§5) to this setting. The main difference between our analysis in Section 5 and the prior work on DP and generalization is that we restrict to i.i.d. binary inputs with a uniform distribution, while prior work considers i.i.d. inputs from an arbitrary set with an arbitrary distribution. Thus the prior work is more general, but, as we now show, we can reduce the general case to the binary case.
where .
The proof of Theorem B.1 relies on the following technical lemma. This is using what is known as the “ghost samples” symmetrization technique [SZ20, Footnote 2].
Let . For , define by if and if . Let be -DP (for replacement). Let , and denote for and .
Let be uniform. Then, for all ,
where .
where . Note that Theorem 5.2 applies with any distribution satisfying
If , then for all , which implies satisfies this requirement. In the analysis above, we used Hoeffding’s inequality to show that the sum of randomized roundings is close to (within of) the unrounded sum with high probability and we carry this failure probability into the final result. ∎
Let be -DP (with respect to replacement). Let , and denote for and . Let be a distribution on . Then, for all , we have
where .
The proof relies on Lemma B.2, which considers to be fixed. We now average the lemma over these being i.i.d. samples from , which gives
where . Since the samples from are independent, the coordinates of and are interchangeable, so
for . Setting yields the result. ∎
Let be two independent samples. Let . Let . By Proposition B.3, for all , we have
By Hoeffding’s inequality, for all , we have
By a union bound, for all , we have
Combining inequalities yields the result:
We now briefly compare our results to the prior work on the connection between DP and generalization [DFHPRR15a, DFHPRR15, BNSSSU16, FS17, JLNRSMS19]. We focus on the work of [JLNRSMS19] as it has the sharpest results in the literature.
Note that the prior work is focused on the setting of adaptive data analysis, while we are focused on the setting of auditing. This difference is mostly cosmetic, but there is a material difference when the prior results are applied to our setting: In addition to outputting guesses, the prior works assume that the algorithm outputs a differentially private estimate of the number of correct guesses. The guarantee then is that this differentially private estimate is close to the distributional average (i.e., only half of the guesses being correct). In contrast, for auditing, we want the true number of correct guesses to be close to the distributional average and don’t produce a DP estimate. We can convert between these two settings using the triangle inequality.
Below we state the accuracy guarantee that we compare against, followed by a corollary of Theorem B.1 that applies the triangle inequality and a union bound to ensure that it is directly comparable.
Then, for all , we have
where .
Equations 13 and 14 are directly comparable, but it is not immediately obvious how they compare. By setting , , , and applying Hoeffding’s inequality to , we can simplify Equation 14 to
For comparison, setting in Equation 13 gives
Now we can compare the results more easily. The term in the accuracy bound of [JLNRSMS19] is improved to in our result, which is an improvement by a factor of at least two. This is (arguably) the dominant term, so our result is a significant improvement. In particular, if , then Equation 13 gives a vacuous bound (since the value of is always in $\varepsilon\frac{e^{\varepsilon}-1}{e^{\varepsilon}+1}<1$).
However, there is another term in the accuracy bound – i.e., . The failure probability either has a multiplicative factor or a additive factor. How these compare depends on the value of . To give a concrete comparison, suppose , , , and we want a final failure probability of ; then Theorem B.4 gives an error guarantee of , while Corollary B.5 gives .
Appendix C Mutual Information Bounds from DP
Our framework for the theoretical analysis (§5) is inspired by that of [SZ20]. In this appendix, we use our analysis to also improve one of their results. Specifically, they show that if satisfies -DP and is uniformly random, then
where denotes the mutual information.Throughout this paper we use natural logarithms (so ), including when defining information-theoretic quantities like mutual information. However, it is common to use base-2 logarithms in information theory (i.e., ). To avoid confusion, the statements (outside proofs) in this section are stated in a redundant way so that they would be correct regardless of the base of the logarithm, as long as we are consistent. Prior work [DFHPRR15, BS16] showed that, if satisfies -DP and has as product distribution, then
The latter result is numerically better than the former result, but only holds for pure DP. (The latter result is also not restricted to binary inputs. However, if we do not restrict the input at all, then it is not possible to prove bounds under approximate DP.)
We improve the bound to the following. If satisfies -DP and is uniformly random, then
Let satisfy -DP. Let be sampled from . Then
where is the binary Entropy function.
We apply the chain rule and convexity of KL divergence [FS18, Lemma 3.7]:
Fix and fix . Now we must analyze
where for .
Since is -DP, we have for all measurable and . Thus we can apply Lemma 5.5: There exist distributions on such that and and for all measurable .
so that and . Hence
This decomposition (which was first used by [KOV15]) states that we can view as a postprocessing of an -DP randomized response on the bit . That is, with probability , we output the bit with a flag indicating certainty; with probability , we output with an uncertain flag; and, with probability , we output with the uncertain flag. We can postprocess this to generate a sample from as follows. If we receive with the uncertain flag, then output a sample from . If we receive with the certain flag, then output a sample from .
To be formal, define two distributions on the set by
Define the a randomized postprocessing function by , , , and . Then we have and .
Now we use the postprocessing property (a.k.a. the data processing inequality):
A tedious calculation now yields the bound:
Combining inequalities and summing over yields the first part of the result. The final part of the result is the bound
which can be verified by showing that and (or by plotting it). ∎
Appendix D Implementation of Theorem 5.2
On the next page is Python pseudocode implementing Corollary 5.4. Some example usage:
Suppose the auditor correctly guesses out of examples, with no abstentions. We have . So we would expect this to correspond roughly to . Theorem 5.2 gives p-value of for the null hypothesis and ; to obtain this result call p_value_DP_audit(100,100,75,math.log(3),0) in the code below. If we want 95% confidence, we obtain the lower bound by calling get_eps_audit(100,100,75,0,0.05). If we set , we obtain the weaker lower bound by calling get_eps_audit(100,100,75,1e-4,0.05).
Suppose the auditor correctly guesses out of guesses, but with a total of examples. I.e., the auditor abstains on examples. We obtain a lower bound of for and 95% confidence. (This is slightly weaker than the lower bound we get when there are no abstentions.) This is obtained by calling get_eps_audit(1000,100,75,1e-4,0.05).