Preserving Statistical Validity in Adaptive Data Analysis

Cynthia Dwork, Vitaly Feldman, Moritz Hardt, Toniann Pitassi, Omer Reingold, Aaron Roth

Introduction

Throughout the scientific community there is a growing recognition that claims of statistical significance in published research are frequently invalid [Ioa05b, Ioa05a, PSA11, BE12]. The past few decades have seen a great deal of effort to understand and propose mitigations for this problem. These efforts range from the use of sophisticated validation techniques and deep statistical methods for controlling the false discovery rate in multiple hypothesis testing to proposals for preregistration (that is, defining the entire data-collection and data-analysis protocol ahead of time). The statistical inference theory surrounding this body of work assumes a fixed procedure to be performed, selected before the data are gathered. In contrast, the practice of data analysis in scientific research is by its nature an adaptive process, in which new hypotheses are generated and new analyses are performed on the basis of data exploration and observed outcomes on the same data. This disconnect is only exacerbated in an era of increased amounts of open access data, in which multiple, mutually dependent, studies are based on the same datasets.

It is now well understood that adapting the analysis to data (e.g., choosing what variables to follow, which comparisons to make, which tests to report, and which statistical methods to use) is an implicit multiple comparisons problem that is not captured in the reported significance levels of standard statistical procedures. This problem, in some contexts referred to as “p-hacking” or “researcher degrees of freedom”, is one of the primary explanations of why research findings are frequently false [Ioa05b, SNS11, GL14].

The “textbook” advice for avoiding problems of this type is to collect fresh samples from the same data distribution whenever one ends up with a procedure that depends on the existing data. Getting fresh data is usually costly and often impractical so this requires partitioning the available dataset randomly into two or more disjoint sets of data (such as a training and testing set) prior to the analysis. Following this approach conservatively with mm adaptively chosen procedures would significantly (on average by a factor of mm) reduce the amount of data available for each procedure. This would be prohibitive in many applications, and as a result, in practice even data allocated for the sole purpose of testing is frequently reused (for example to tune parameters). Such abuse of the holdout set is well known to result in significant overfitting to the holdout or cross-validation set [Reu03, RF08].

Clear evidence that such reuse leads to overfitting can be seen in the data analysis competitions organized by Kaggle Inc. In these competitions, the participants are given training data and can submit (multiple) predictive models in the course of competition. Each submitted model is evaluated on a (fixed) test set that is available only to the organizers. The score of each solution is provided back to each participant, who can then submit a new model. In addition the scores are published on a public leaderboard. At the conclusion of the competition the best entries of each participant are evaluated on an additional, hitherto unused, test set. The scores from these final evaluations are published. The comparison of the scores on the adaptively reused test set and one-time use test set frequently reveals significant overfitting to the reused test set (e.g. [Win, Kaga]), a well-recognized issue frequently discussed on Kaggle’s blog and user forums [Kagb, Kagc].

Despite the basic role that adaptivity plays in data analysis we are not aware of previous general efforts to address its effects on the statistical validity of the results (see Section 1.4 for an overview of existing approaches to the problem). We show that, surprisingly, the challenges of adaptivity can be addressed using insights from differential privacy, a definition of privacy tailored to privacy-preserving data analysis. Roughly speaking, differential privacy ensures that the probability of observing any outcome from an analysis is “essentially unchanged” by modifying any single dataset element (the probability distribution is over the randomness introduced by the algorithm). Differentially private algorithms permit a data analyst to learn about the dataset as a whole (and, by extension, the distribution from which the data were drawn), while simultaneously protecting the privacy of the individual data elements. Strong composition properties show this holds even when the analysis proceeds in a sequence of adaptively chosen, individually differentially private, steps.

We choose this setup for three reasons. First, a variety of quantities of interest in data analysis can be expressed in this form for some function ψ\psi. For example, true means and moments of individual attributes, correlations between attributes and the generalization error of a predictive model or classifier. Next, a request for such an estimate is referred to as a statistical query in the context of the well-studied statistical query model [Kea98, FGR+13], and it is known that using statistical queries in place of direct access to data it is possible to implement most standard analyses used on i.i.d. data (see [Kea98, BDMN05, CKL+06] for examples). Finally, the problem of providing accurate answers to a large number of queries for the average value of a function on the dataset has been the subject of intense investigation in the differential privacy literature.The average value of a function ψ\psi on a set of random samples is a natural estimator of P[ψ]\mathcal{P}[\psi]. In the differential privacy literature such queries are referred to as (fractional) counting queries.

We address the following basic question: how many adaptively chosen statistical queries can be correctly answered using nn samples drawn i.i.d. from P{\mathcal{P}}? The conservative approach of using fresh samples for each adaptively chosen query would lead to a sample complexity that scales linearly with the number of queries mm. We observe that such a bad dependence is inherent in the standard approach of estimating expectations by the exact empirical average on the samples. This is directly implied by the techniques from [DN03] who show how to make linearly many non-adaptive counting queries to a dataset, and reconstruct nearly all of it. Once the data set is nearly reconstructed it is easy to make a query for which the empirical average on the dataset is far from the true expectation. Note that this requires only a single round of adaptivity! A simpler and more natural example of the same phenomenon is known as “Freedman’s paradox” [Fre83] and we give an additional simple example in the Appendix. This situation is in stark contrast to the non-adaptive case in which n=O(logmτ2)n=O\left(\frac{\log m}{\tau^{2}}\right) samples suffice to answer mm queries with tolerance τ\tau using empirical averages. Below we refer to using empirical averages to evaluate the expectations of query functions as the naïve method.

2 Our Results

Our main result is a broad transfer theorem showing that any adaptive analysis that is carried out in a differentially private manner must lead to a conclusion that generalizes to the underlying distribution. This theorem allows us to draw on a rich body of results in differential privacy and to obtain corresponding results for our problem of guaranteeing validity in adaptive data analysis. Before we state this general theorem, we describe a number of important corollaries for the question we formulated above.

Our primary application is that, remarkably, it is possible to answer nearly exponentially many adaptively chosen statistical queries (in the size of the data set nn). Equivalently, this reduces the sample complexity of answering mm queries from linear in the number of queries to polylogarithmic, nearly matching the dependence that is necessary for non-adaptively chosen queries.

There exists an algorithm that given a dataset of size at least nmin(n0,n1)n\geq\min(n_{0},n_{1}), can answer any mm adaptively chosen statistical queries so that with high probability, each answer is correct up to tolerance τ\tau, where:

The two bounds above are incomparable. Note that the first bound is larger than the sample complexity needed to answer non-adaptively chosen queries by only a factor of O(logmlogX/τ3/2)O\left(\sqrt{\log m\log|\mathcal{X}|}/\tau^{3/2}\right), whereas the second one is larger by a factor of O(log(X)/τ2)O\left(\log(|\mathcal{X}|)/\tau^{2}\right). Here logX\log|\mathcal{X}| should be viewed as roughly the dimension of the domain. For example, if the underlying domain is X={0,1}d\mathcal{X}=\{0,1\}^{d}, the set of all possible vectors of dd-boolean attributes, then logX=d\log|\mathcal{X}|=d.

The above mechanism is not computationally efficient (it has running time linear in the size of the data universe X|\mathcal{X}|, which is exponential in the dimension of the data). A natural question raised by our result is whether there is an efficient algorithm for the task. This question was addressed in [HU14, SU14] who show that under standard cryptographic assumptions any algorithm that can answer more than n2\approx n^{2} adaptively chosen statistical queries must have running time exponential in logX\log|\mathcal{X}|.

We show that it is possible to match this quadratic lower bound using a simple and practical algorithm that perturbs the answer to each query with independent noise.

There exists a computationally efficient algorithm for answering mm adaptively chosen statistical queries, such that with high probability, the answers are correct up to tolerance τ\tau, given a data set of size at least nn0n\geq n_{0} for:

Finally, we show a computationally efficient method which can answer exponentially many queries so long as they were generated using o(n)o(n) rounds of adaptivity, even if we do not know where the rounds of adaptivity lie. Another practical advantage of this algorithm is that it only pays the price for a round if adaptivity actually causes overfitting. In other words, the algorithm does not pay for the adaptivity itself but only for the actual harm to statistical validity that adaptivity causes. This means that in many situations it would be possible to use this algorithm successfully with a much smaller “effective” rr (provided that a good bound on it is known).

There exists a computationally efficient algorithm for answering mm adaptively chosen statistical queries, generated in rr rounds of adaptivity, such that with high probability, the answers are correct up to some tolerance τ\tau, given a data set of size at least nn0n\geq n_{0} for:

Formal statements of these results appear in Section 5.

3 Overview of Techniques

We consider a setting in which an arbitrary adaptive data analyst chooses queries to ask (as a function of past answers), and receives answers from an algorithm referred to as an oracle whose input is a dataset S{\bm{S}} of size nn randomly drawn from Pn{\mathcal{P}}^{n}. To begin with, the oracles we use will only guarantee accuracy with respect to the empirical average on their input dataset S{\bm{S}}, but they will simultaneously guarantee differential privacy. We exploit a crucial property about differential privacy, known as its post-processing guarantee: Any algorithm that can be described as the (possibly randomized) post-processing of the output of a differentially private algorithm is itself differentially private. Hence, although we do not know how an arbitrary analyst is adaptively generating her queries, we do know that if the only access she has to S{\bm{S}} is through a differentially private algorithm, then her method of producing query functions must be differentially private with respect to S{\bm{S}}. We can therefore, without loss of generality, think of the oracle and the analyst as a single algorithm A{\cal A} that is given a random data set S{\bm{S}} and returns a differentially private output query ϕ=A(S).{\bm{\phi}}={\cal A}({\bm{S}}). Note that ϕ{\bm{\phi}} is random both due to the internal randomness of A{\cal A} and the randomness of the data S.{\bm{S}}. This picture is the starting point of our analysis, and allows us to study the generalization properties of queries which are generated by differentially private algorithms, rather than estimates returned by them.

Our results then follow from a strong connection we make between differential privacy and generalization, which will likely have applications beyond those that we explore in this paper. At a high level, we prove that if A{\cal A} is a differentially private algorithm then the empirical average of a function that it outputs on a random dataset will be close to the true expectation of the function with high probabilityA weaker connection that gives closeness in expectation over the dataset and algorithm’s randomness was known to some experts and is considered folklore. We give a more detailed comparison in Sec. 1.4 and Sec. 2.1. (over the choice of the dataset and the randomness of A{\cal A}). More formally, for a dataset S=(x1,,xn)S=(x_{1},\dots,x_{n}) and a function ψ:X\psi:\mathcal{X}\rightarrow, let ES[ψ]=1ni=1nψ(xi){\cal E}_{S}[\psi]=\frac{1}{n}\sum_{i=1}^{n}\psi(x_{i}) denote the empirical average of ψ\psi. We denote a random dataset chosen from Pn{\mathcal{P}}^{n} by S{\bm{S}}. For any fixed function ψ\psi, the empirical average ES[ψ]{\cal E}_{{\bm{S}}}[\psi] is strongly concentrated around its expectation P[ψ]{\mathcal{P}}[\psi]. However, this statement is no longer true if ψ\psi is allowed to depend on S{\bm{S}} (which is what happens if we choose functions adaptively, using previous estimates on S{\bm{S}}). However for a hypothesis output by a differentially private A{\cal A} on S{\bm{S}} (denoted by ϕ=A(S){\bm{\phi}}={\cal A}({\bm{S}})), we show that ES[ϕ]{\cal E}_{{\bm{S}}}[{\bm{\phi}}] is close to P[ϕ]{\mathcal{P}}[{\bm{\phi}}] with high probability.

High probability bounds are necessary to ensure that valid answers can be given to an exponentially large number of queries. To prove these bounds, we show that differential privacy roughly preserves the moments of ES[ϕ]{\cal E}_{{\bm{S}}}[{\bm{\phi}}] even when conditioned on ϕ=ψ{\bm{\phi}}=\psi for any fixed ψ\psi. Now using strong concentration of the kk-th moment of ES[ψ]{\cal E}_{{\bm{S}}}[\psi] around P[ψ]k{\mathcal{P}}[\psi]^{k}, we can obtain that ES[ϕ]{\cal E}_{{\bm{S}}}[{\bm{\phi}}] is concentrated around P[ϕ]{\mathcal{P}}[{\bm{\phi}}]. Such an argument works only for (ε,0)(\varepsilon,0)-differential privacy due to conditioning on the event ϕ=ψ{\bm{\phi}}=\psi which might have arbitrarily low probability. We use a more delicate conditioning to obtain the extension to (ε,δ)(\varepsilon,\delta)-differential privacy. We note that (ε,δ)(\varepsilon,\delta)-differential privacy is necessary to obtain the stronger bounds that we use for Theorems 1 and 2.

We give an alternative, simpler proof for (ε,0)(\varepsilon,0)-differential privacy that, in addition, extends this connection beyond expectations of functions. We consider a differentially private algorithm A{\cal A} that maps a database SPn{\bm{S}}\sim{\mathcal{P}}^{n} to elements from some arbitrary range ZZ. Our proof shows that if we have a collection of events R(y)R(y) defined over databases, one for each element yZy\in Z, and each event is individually unlikely in the sense that for all yy, the probability that SR(y){\bm{S}}\in R(y) is small, then the probability remains small that SR(Y){\bm{S}}\in R({\bm{Y}}), where Y=A(S){\bm{Y}}={\cal A}({\bm{S}}). Note that this statement involves a re-ordering of quantifiers. The hypothesis of the theorem says that the probability of event R(y)R(y) is small for each yy, where the randomness is taken over the choice of database SPn{\bm{S}}\sim{\mathcal{P}}^{n}, which is independent of yy. The conclusion says that the probability of R(Y)R({\bm{Y}}) remains small, even though Y{\bm{Y}} is chosen as a function of S{\bm{S}}, and so is no longer independent. The upshot of this result is that adaptive analyses, if performed via a differentially private algorithm, can be thought of (almost) as if they were non-adaptive, with the data being drawn after all of the decisions in the analysis are fixed.

4 Related Work

Numerous techniques have been developed by statisticians to address common special cases of adaptive data analysis. Most of them address a single round of adaptivity such as variable selection followed by regression on selected variables or model selection followed by testing and are optimized for specific inference procedures (the literature is too vast to adequately cover here, see Ch. 7 in [HTF09] for a textbook introduction and [TT15] for a survey of some recent work). In contrast, our framework addresses multiple stages of adaptive decisions, possible lack of a predetermined analysis protocol and is not restricted to any specific procedures.

The traditional perspective on why adaptivity in data analysis invalidates the significance levels of statistical procedures given for the non-adaptive case is that one ends up disregarding all the other possible procedures or tests that would have been performed had the data been different (see e.g. [SNS11]). It is well-known that when performing multiple tests on the same data one cannot use significance levels of individual tests and instead it is necessary to control measures such as the false discovery rate [BH95]. This view makes it necessary to explicitly account for all the possible ways to perform the analysis in order to provide validity guarantees for the adaptive analysis. While this approach might be possible in simpler studies, it is technically challenging and often impractical in more complicated analyses [GL14].

There are procedures for controlling false discovery in a sequential setting in which tests arrive one-by-one [FS08, ANR11, AR14]. However the analysis of such tests crucially depends on tests maintaining their statistical properties despite conditioning on previous outcomes. It is therefore unsuitable for the problem we consider here, in which we place no restrictions on the analyst.

The classical approach in theoretical machine learning to ensure that empirical estimates generalize to the underlying distribution is based on the various notions of complexity of the set of functions output by the algorithm, most notably the VC dimension (see [KV94] or [SSBD14] for a textbook introduction). If one has a sample of data large enough to guarantee generalization for all functions in some class of bounded complexity, then it does not matter whether the data analyst chooses functions in this class adaptively or non-adaptively. Our goal, in contrast, is to prove generalization bounds without making any assumptions about the class from which the analyst can choose query functions. In this case the adaptive setting is very different from the non-adaptive setting.

An important line of work [BE02, MNPR06, PRMN04, SSSSS10] establishes connections between the stability of a learning algorithm and its ability to generalize. Stability is a measure of how much the output of a learning algorithm is perturbed by changes to its input. It is known that certain stability notions are necessary and sufficient for generalization. Unfortunately, the stability notions considered in these prior works are not robust to post-processing, and so the stability of a query answering procedure would not guarantee the stability of the query generating procedure used by an arbitrary adaptive analyst. They also do not compose in the sense that running multiple stable algorithms sequentially and adaptively may result in a procedure that is not stable. Differential privacy is stronger than these previously studied notions of stability, and in particular enjoys strong post-processing and composition guarantees. This provides a calculus for building up complex algorithms that satisfy stability guarantees sufficient to give generalization. Past work has considered the generalization properties of one-shot learning procedures. Our work can in part be interpreted as showing that differential privacy implies generalization in the adaptive setting, and beyond the framework of learning.

Differential privacy emerged from a line of work [DN03, DN04, BDMN05], culminating in the definition given by [DMNS06]. It defines a stability property of an algorithm developed in the context of data privacy. There is a very large body of work designing differentially private algorithms for various data analysis tasks, some of which we leverage in our applications. Most crucially, it is known how to accurately answer exponentially many adaptively chosen queries on a fixed dataset while preserving differential privacy [RR10, HR10], which is what yields the main application in our paper, when combined with our main theorem. See [Dwo11] for a short survey and [DR14] for a textbook introduction to differential privacy.

For differentially private algorithms that output a hypothesis it has been known as folklore that differential privacy implies stability of the hypothesis to replacing (or removing) an element of the input dataset. Such stability is long known to imply generalization in expectation (e.g. [SSSSS10]). See Section 2.1 for more details. Our technique can be seen as a substantial strengthening of this observation: from expectation to high probability bounds (which is crucial for answering many queries), from pure to approximate differential privacy (which is crucial for our improved efficient algorithms), and beyond the expected error of a hypothesis.

Further Developments: Our work has attracted substantial interest to the problem of statistical validity in adaptive data analysis and its relationship to differential privacy. Hardt and Ullman [HU14] and Steinke and Ullman [SU14] have proven complementary computational lower bounds for the problem formulated in this work. They show that, under standard cryptographic assumptions, the exponential running time of the algorithm instantiating our main result is unavoidable. Specifically, that the square-root dependence on the number of queries in the sample complexity of our efficient algorithm is nearly optimal, among all computationally efficient mechanisms for answering arbitrary statistical queries.

In [DFH+15a] we discuss approaches to the problem of adaptive data analysis more generally. We demonstrate how differential privacy and description-length-based analyses can be used in this context. In particular, we show that the bounds on n1n_{1} obtained in Theorem 1 can also be obtained by analyzing the transcript of the median mechanism for query answering [RR10] (even without adding noise). Further, we define a notion of approximate max-information between the dataset and the output of the analysis that ensures generalization with high probability, composes adaptively and unifies (pure) differential privacy and description-length-based analyses. We also demonstrate an application of these techniques to the problem of reusing the holdout (or testing) dataset. An overview of this work and [DFH+15a] intended for a broad scientific audience appears in [DFH+15b].

Blum and Hardt [BH15] give an algorithm for reusing the holdout dataset specialized to the problem of maintaining an accurate leaderboard for a machine learning competition (such as those organized by Kaggle Inc. and discussed earlier). Their generalization analysis is based on the description length of the algorithm’s transcript.

Our results for approximate (δ>0\delta>0) differential privacy apply only to statistical queries (see Thm. 10). Bassily, Nissim, Smith, Steinke, Stemmer and Ullman [BNS+15] give a novel, elegant analysis of the δ>0\delta>0 case that gives an exponential improvement in the dependence on δ\delta and generalizes it to arbitrary low-sensitivity queries. This leads to stronger bounds on sample complexity that remove an O(log(m)/τ)O(\sqrt{\log(m)/\tau}) factor from the bounds on n0n_{0} we give in Theorems 1 and 2. It also implies a similar improvement and generalization to low-sensitivity queries in the reusable holdout application [DFH+15a].

Another implication of our work is that composition and post-processing properties (which are crucial in the adaptive setting) can be ensured by measuring the effect of data analysis on the probability space of the analysis outcomes. Several additional techniques of this type have been recently analyzed. Bassily et al. [BNS+15] show that generalization in expectation (as discussed in Cor. 7) can also be obtained from two additional notions of stability: KL-stability and TV-stability that bound the KL-divergence and total variation distance between output distributions on adjacent datasets, respectively. Russo and Zou [RZ15] show that generalization in expectation can be derived by bounding the mutual information between the dataset and the output of analysis. They give applications of their approach to analysis of adaptive feature selection procedures. We note that these techniques do not imply high-probability generalization bounds that we obtain here and in [DFH+15a].

Preliminaries

A statistical query is defined by a function ψ:X\psi:\mathcal{X}\rightarrow and tolerance τ\tau. For distribution P{\mathcal{P}} over X\mathcal{X} a valid response to such a query is any value vv such that vP(ψ)τ|v-{\mathcal{P}}(\psi)|\leq\tau.

We now formally define differential privacy. We say that datasets S,SS,S^{\prime} are adjacent if they differ in a single element.

where the probability space is over the coin flips of the algorithm A{\cal A}. The case when δ=0\delta=0 is sometimes referred to as pure differential privacy, and in this case we may say simply that A{\cal A} is ε\varepsilon-differentially private.

Appendix B contains additional background that we will need later on.

We now briefly summarize the basic connection between differential privacy and generalization that is considered folklore. This connection follows from an observation that differential privacy implies stability to replacing a single sample in a dataset together with known connection between stability and on-average generalization. We first state the form of stability that is immediately implied by the definition of differential privacy. For simplicity, we state it only for $$-valued functions. The extension to any other bounded range is straightforward.

Let A{\mathcal{A}} be an (ϵ,δ)(\epsilon,\delta)-differentially private algorithm ranging over functions from X\mathcal{X} to $.Foranypairofadjacentdatasets. For any pair of adjacent datasetsSandandS^{\prime}andandx\in\mathcal{X}$:

Algorithms satisfying equation (1) are referred to as strongly-uniform-replace-one stable with rate (eε1+δ)(e^{\varepsilon}-1+\delta) by Shalev-Schwartz et al. [SSSSS10]. It is easy to show and is well-known that replace-one stability implies generalization in expectation, referred to as on-average generalization [SSSSS10, Lemma 11]. In our case this connection immediately gives the following corollary.

Let A{\mathcal{A}} be an (ϵ,δ)(\epsilon,\delta)-differentially private algorithm ranging over functions from X\mathcal{X} to $,let, let{\mathcal{P}}beadistributionoverbe a distribution over\mathcal{X}andletand let{\bm{S}}beanindependentrandomvariabledistributedaccordingtobe an independent random variable distributed according to{\mathcal{P}}^{n}$. Then

This corollary was observed in the context of functions expressing the loss of the hypothesis output by a (private) learning algorithm, that is, ϕ(x)=L(h(x),x)\phi(x)=L(h(x),x), where xx is a sample (possibly including a label), hh is a hypothesis function and LL is a non-negative loss function. When applied to such a function, Corollary 7 implies that the expected true loss of a hypothesis output by an (ε,δ)(\varepsilon,\delta)-differentially private algorithm is at most eε1+δe^{\varepsilon}-1+\delta larger than the expected empirical loss of the output hypothesis, where the expectation is taken over the random dataset and the randomness of the algorithm. A special case of this corollary is stated in a recent work of Bassily et al. [BST14]. More recently, Wang et al. [WLF15] have similarly used the stability of differentially private learning algorithms to show a general equivalence of differentially private learning and differentially private empirical loss minimization.

Differential Privacy and Preservation of Moments

We now prove that if a function ϕ{\bm{\phi}} is output by an (ε,δ)(\varepsilon,\delta)-differentially private algorithm A{\cal A} on input of a random dataset S{\bm{S}} drawn from Pn,{\mathcal{P}}^{n}, then the average of ϕ{\bm{\phi}} on S,{\bm{S}}, that is, ES[ϕ],{\cal E}_{{\bm{S}}}[{\bm{\phi}}], is concentrated around its true expectation P[ϕ].{\mathcal{P}}[{\bm{\phi}}].

Our proof is easier to execute when δ=0\delta=0 and we start with this case for the sake of exposition.

Our main technical tool relates the moments of the random variables that we are interested in.

Assume that A{\mathcal{A}} is an (ϵ,0)(\epsilon,0)-differentially private algorithm ranging over functions from X\mathcal{X} to .. Let S,T{\bm{S}},{\bm{T}} be independent random variables distributed according to Pn.{\mathcal{P}}^{n}. For any function ψ:X\psi:\mathcal{X}\rightarrow in the support of A(S){\cal A}({\bm{S}}),

We use II to denote a kk-tuple of indices (i1,,ik)[n]k(i_{1},\ldots,i_{k})\in[n]^{k} and use I\bm{I} to denote a kk-tuple chosen randomly and uniformly from [n]k[n]^{k}. For a data set T=(y1,,yn)T=(y_{1},\ldots,y_{n}) we denote by ΠTI(ψ)=j[k]ψ(yij)\Pi_{T}^{I}(\psi)=\prod_{j\in[k]}\psi(y_{i_{j}}). We first observe that for any ψ\psi,

For two datasets S,TXnS,T\in\mathcal{X}^{n}, let SITS_{I\leftarrow T} denote the data set in which for every j[k]j\in[k], element iji_{j} in SS is replaced with the corresponding element from TT. We fix II. Note that the random variable SIT{\bm{S}}_{I\leftarrow{\bm{T}}} is distributed according to Pn{\mathcal{P}}^{n} and therefore

Now for any fixed tt, SS and TT consider the event ΠTI(A(S))t\mboxandA(S)=ψ\Pi_{T}^{I}({\cal A}(S))\geq t\mbox{ and }{\cal A}(S)=\psi (defined on the range of A{\cal A}). Data sets SS and SITS_{I\leftarrow T} differ in at most kk elements. Therefore, by the ε\varepsilon-differential privacy of A{\cal A} and Lemma 24, the distribution A(S){\cal A}(S) and the distribution A(SIT){\cal A}(S_{I\leftarrow T}) satisfy:

Taking the probability over S{\bm{S}} and T{\bm{T}} we get:

Taking the expectation over I\bm{I} and using eq. (3) we obtain that

We now turn our moment inequality into a theorem showing that ES[ϕ]{\cal E}_{\bm{S}}[{\bm{\phi}}] is concentrated around the true expectation P[ϕ].{\mathcal{P}}[{\bm{\phi}}].

Consider an execution of A{\cal A} with ε=τ/2\varepsilon=\tau/2 on a data set S{\bm{S}} of size n12ln(4/β)/τ2n\geq 12\ln(4/\beta)/\tau^{2}. By Lemma 29 we obtain that RHS of our bound in Lemma 8 is at most eεkMk[B(n,P[ψ])]e^{\varepsilon k}\mathcal{M}_{k}[B(n,{\mathcal{P}}[\psi])]. We use Lemma 31 with ε=τ/2\varepsilon=\tau/2 and k=4ln(4/β)/τk=4\ln(4/\beta)/\tau (noting that the assumption n12ln(4/β)/τ2n\geq 12\ln(4/\beta)/\tau^{2} ensures the necessary bound on nn) to obtain that

This holds for every ψ\psi in the range of A{\cal A} and therefore,

We can apply the same argument to the function 1ϕ1-{\bm{\phi}} to obtain that

A union bound over the above inequalities implies the claim. ∎

2 Extension to δ>0𝛿0\delta>0

We use the notation from the proof of Theorem 9 and consider an execution of A{\cal A} with ε\varepsilon and δ\delta satisfying the conditions of the theorem.

We use the same decomposition of the kk-th moment as before:

Now for a fixed I[n]kI\in[n]^{k}, exactly as in eq. (4), we obtain

Taking the probability over S{\bm{S}} and T{\bm{T}} and substituting this into eq. (6) we get

Taking the expectation over I\bm{I} and using eq. (3) we obtain:

Apply the same argument to 1ϕ1-{\bm{\phi}} and use a union bound. We obtain the claim after rescaling τ\tau and β\beta by a factor 2.2.

Beyond statistical queries

Fix yZy\in Z. We first observe that by Jensen’s inequality,

Further, by definition of differential privacy, for two databases S,SS,S^{\prime} that differ in a single element,

and let B0{S  g(S)εnln(2/β)/2}.B_{0}\doteq\{S\ |\ g(S)\leq\varepsilon\sqrt{n\ln(2/\beta)/2}\}.

where the case of i=0i=0 follows from the assumptions of the lemma.

The condition εln(1/β)2n\varepsilon\leq\sqrt{\frac{\ln(1/\beta)}{2n}} implies that

Substituting this into inequality (10), we get

Clearly, i0Bi=X[n]\cup_{i\geq 0}B_{i}=\mathcal{X}^{[n]}. Therefore

Finally, let Y\cal Y denote the distribution of Y{\bm{Y}}. Then,

Our theorem gives a result for statistical queries that achieves the same bound as our earlier result in Theorem 9 up to constant factors in the parameters.

By the Chernoff bound, for any fixed query function ψ:X\psi:\mathcal{X}\rightarrow,

Now, by Theorem 11 for R(ψ)={SXn  P[ψ]ES[ψ]>τ}R(\psi)=\left\{S\in\mathcal{X}^{n}\ |\ |\mathcal{P}[\psi]-{\cal E}_{{\bm{S}}}[\psi]|>\tau\right\}, β=2e2τ2n\beta=2e^{-2\tau^{2}n} and any ετ2ln(2)/2n\varepsilon\leq\sqrt{\tau^{2}-\ln(2)/2n},

Applications

To obtain algorithms for answering adaptive statistical queries we first note that if for a query function ψ\psi and a dataset SS, P[ψ]ES[ψ]τ/2|{\mathcal{P}}[\psi]-{\cal E}_{S}[\psi]|\leq\tau/2 then we can use an algorithm that outputs a value vv that is τ/2\tau/2-close to ES[ψ]{\cal E}_{S}[\psi] to obtain a value that is τ\tau-close to P[ψ]{\mathcal{P}}[\psi]. Differentially private algorithms that for a given dataset SS and an adaptively chosen sequence of queries ϕ1,,ϕm\phi_{1},\ldots,\phi_{m} produce a value close to ES[ϕi]{\cal E}_{S}[\phi_{i}] for each query ϕi ⁣:X\phi_{i}\colon\mathcal{X}\to have been the subject of intense investigation in the differential privacy literature (see [DR14] for an overview). Such queries are usually referred to as (fractional) counting queries or linear queries in this context. This allows us to obtain statistical query answering algorithms by using various known differentially private algorithms for answering counting queries.

The results in Sections 3 and 4 imply that P[ψ]ES[ψ]τ|{\mathcal{P}}[\psi]-{\cal E}_{\bm{S}}[\psi]|\leq\tau holds with high probability whenever ψ\psi is generated by a differentially private algorithm M{\mathcal{M}}. This might appear to be inconsistent with our application since there the queries are generated by an arbitrary (possibly adversarial) adaptive analyst and we can only guarantee that the query answering algorithm is differentially private. The connection comes from the following basic fact about differentially private algorithms:

Let M:XnO{\mathcal{M}}:\mathcal{X}^{n}\rightarrow{\mathcal{O}} be an (ϵ,δ)(\epsilon,\delta) differentially private algorithm with range O{\mathcal{O}}, and let F:OO\cal F:{\mathcal{O}}\rightarrow{\mathcal{O}}^{\prime} be an arbitrary randomized algorithm. Then FM:XnO{\cal F}\circ{{\mathcal{M}}}:{\mathcal{X}}^{n}\rightarrow{\mathcal{O}}^{\prime} is (ϵ,δ)(\epsilon,\delta)-differentially private.

Hence, an arbitrary adaptive analyst A{\cal A} is guaranteed to generate queries in a manner that is differentially private in S{\bm{S}} so long as the only access that she has to S{\bm{S}} is through a differentially private query answering algorithm M{\mathcal{M}}. We also note that the bounds we state here give the probability of correctness for each individual answer to a query, meaning that the error probability β\beta is for each query ϕi\phi_{i} and not for all queries at the same time. The bounds we state in Section 1.2 hold with high probability for all mm queries and to obtain them from the bounds in this section, we apply the union bound by setting β=β/m\beta=\beta^{\prime}/m for some small β\beta^{\prime}.

We now highlight a few applications of differentially private algorithms for answering counting queries to our problem.

Applying our main generalization bound for (ϵ,0)(\epsilon,0)-differential privacy directly gives the following corollary.

We apply Theorem 9 with ϵ=τ/2\epsilon=\tau/2 and plug this choice of ϵ\epsilon into the definition of nLn_{L} in Theorem 14. We note that the stated lower bound on nn implies the lower bound required by Theorem 9. ∎

The corollary that follows the (ϵ,δ)(\epsilon,\delta) bound gives a quadratic improvement in mm compared with Corollary 15 at the expense of a slightly worse dependence on τ\tau and 1/β.1/\beta.

2 Multiplicative Weights Technique

The private multiplicative weights algorithm [HR10] achieves an exponential improvement in mm compared with the Laplacian mechanism. The main drawback is a running time that scales linearly with the domain size in the worst case and is therefore not computationally efficient in general.

We apply Theorem 9 with ϵ=τ/2\epsilon=\tau/2 and plug this choice of ϵ\epsilon into the definition of nMWn_{MW} in Theorem 17. We note that the stated lower bound on nn implies the lower bound required by Theorem 9. ∎

Under (ϵ,δ)(\epsilon,\delta) differential privacy we get the following corollary that improves the dependence on τ\tau and logX\log|\mathcal{X}| in Corollary 18 at the expense of a slightly worse dependence on β.\beta.

3 Sparse Vector Technique

In this section we give a computationally efficient technique for answering exponentially many queries ϕ1,,ϕm\phi_{1},\dots,\phi_{m} in the size of the data set nn so long as they are chosen using only o(n)o(n) rounds of adaptivity. We say that a sequence of queries ϕ1,,ϕmX\phi_{1},\ldots,\phi_{m}\in\mathcal{X}^{}, answered with numeric values a1,,ama_{1},\ldots,a_{m} is generated with rr rounds of adaptivity if there are rr indices i1,,iri_{1},\ldots,i_{r} such that the procedure that generates the queries as a function of the answers can be described by r+1r+1 (possibly randomized) algorithms f0,f1,,frf_{0},f_{1},\ldots,f_{r} satisfying:

We build our algorithm out of a differentially private algorithm called SPARSE that takes as input an adaptively chosen sequence of queries together with guesses of the answers to those queries. Rather than always returning numeric valued answers, it compares the error of our guess to a threshold TT and returns a numeric valued answer to the query only if (a noisy version of) the error of our guess was above the given threshold. SPARSE is computationally efficient, and has the remarkable property that its accuracy has polynomial dependence only on the number of queries for which the error of our guesses are close to being above the threshold.

We observe that the naïve method of answering queries using their empirical average allows us to answer each query up to accuracy τ\tau with probability 1β1-\beta given a data set of size n0ln(2/β)/τ2n_{0}\geq\ln(2/\beta)/\tau^{2} so long as the queries are non-adaptively chosen. Thus, with high probability, problems only arise between rounds of adaptivity. If we knew when these rounds of adaptivity occurred, we could refresh our sample between each round, and obtain total sample complexity linear in the number of rounds of adaptivity. The method we present (using (ϵ,0)(\epsilon,0)-differential privacy) lets us get a comparable bound without knowing where the rounds of adaptivity appear. Using (ϵ,δ)(\epsilon,\delta) privacy would allow us to obtain constant factor improvements if the number of queries was large enough, but does not get an asymptotically better dependence on the number of rounds rr (it would allow us to reuse the round testing set quadratically many times, but we would still potentially need to refresh the training set after each round of adaptivity, in the worst case).

The idea is the following: we obtain rr different estimation samples S1,,SrS_{1},\ldots,S_{r} each of size sufficient to answer non-adaptively chosen queries to error τ/8\tau/8 with probability 1β/31-\beta/3, and a separate round detection sample ShS_{h} of size nSV(τ/8,β/3,ϵ)n_{SV}(\tau/8,\beta/3,\epsilon) for ϵ=τ/16\epsilon=\tau/16, which we access only through a copy of SPARSE we initialize with threshold T=τ/4T=\tau/4. As queries ϕi\phi_{i} start arriving, we compute their answers ait=ES1[ϕi]a_{i}^{t}={\cal E}_{S_{1}}[\phi_{i}] using the naïve method on estimation sample S1S_{1} which we use as our guess of the correct value on ShS_{h} when we feed ϕi\phi_{i} to SPARSE. If the answer SPARSE returns is aih=a^{h}_{i}=\bot, then we know that with probability 1β/31-\beta/3, aita_{i}^{t} is accurate up to tolerance T+τ/8=3τ/8T+\tau/8=3\tau/8 with respect to ShS_{h}, and hence statistically valid up to tolerance τ/2\tau/2 by Theorem 9 with probability at least 12β/31-2\beta/3. Otherwise, we discard our estimation set S1S_{1} and continue with estimation set S2S_{2}. We know that with probability 1β/31-\beta/3, aiha_{i}^{h} is accurate with respect to ShS_{h} up to tolerance τ/8\tau/8, and hence statistically valid up to tolerance τ/4\tau/4 by Theorem 9 with probability at least 12β/31-2\beta/3. We continue in this way, discarding and incrementing our estimation set whenever our guess gig_{i} is incorrect. This succeeds in answering every query so long as our guesses are not incorrect more than rr times in total. Finally, we know that except with probability at most mβ/3m\beta/3, by the accuracy guarantee of our estimation set for non-adaptively chosen queries, the only queries ii for which our guesses gig_{i} will deviate from ESh[ϕi]{\cal E}_{S_{h}}[\phi_{i}] by more than Tτ/8=τ/8T-\tau/8=\tau/8 are those queries that lie between rounds of adaptivity. There are at most rr of these by assumption, so the algorithm runs to completion with probability at least 1mβ/31-m\beta/3. The algorithm is given in figure 1.

This algorithm yields the following theorem:

Note that the accuracy guarantee of SPARSE depends only on the number of incorrect guesses that are actually made. Hence, EffectiveRounds does not halt until the actual number of instances of over-fitting to the estimation samples SiS_{i} is larger than rr. This could be equal to the number of rounds of adaptivity in the worst case (for example, if the analyst is running the Dinur-Nissim reconstruction attack within each round [DN03]), but in practice might achieve a much better bound (if the analyst is not fully adversarial).

We would like to thank Sanjeev Arora, Nina Balcan, Avrim Blum, Dean Foster, Michael Kearns, Jon Kleinberg, Sasha Rakhlin, and Jon Ullman for enlightening discussions and helpful comments. We also thank the Simons Institute for Theoretical Computer Science at Berkeley where part of this research was done.

References

Appendix A Adaptivity in fitting a linear model

In this section, we give a very simple example to illustrate how a data analyst could end up overfitting to a dataset by asking only a small number of (adaptively) chosen queries to the dataset, if they are answered using the naïve method.

Not knowing the distribution the analyst decides to solve the corresponding optimization problem on her finite sample:

The analyst attempts to solve the problem using the following simple but adaptive strategy:

Intuitively, this natural approach first determines for each attribute whether it is positively or negatively correlated. It then aggregates this information across all dd attributes into a single linear model.

The next lemma shows that this adaptive strategy has a terrible generalization performance (if dd is large). Specifically, we show that even if there is no linear structure whatsoever in the underlying distribution (namely it is normally distributed), the analyst’s strategy falsely discovers a linear model with large objective value.

Now, (1/n)xDxi(1/n)\sum_{x\in D}x_{i} is distributed like a gaussian random variable gN(0,1/n),g\sim N(0,1/n), since each xix_{i} is a standard gaussian. It follows that

Appendix B Background on Differential Privacy

When applying (ϵ,δ)(\epsilon,\delta)-differential privacy, we are typically interested in values of δ\delta that are very small compared to nn. In particular, values of δ\delta on the order of 1/n1/n yield no meaningful definition of privacy as they permit the publication of the complete records of a small number of data set participants—a violation of any reasonable notion of privacy.

where the probability space is over the coin flips of the mechanism A{\cal A}.

Differential privacy also degrades gracefully under composition. It is easy to see that the independent use of an (ε1,0)(\varepsilon_{1},0)-differentially private algorithm and an (ε2,0)(\varepsilon_{2},0)-differentially private algorithm, when taken together, is (ε1+ε2,0)(\varepsilon_{1}+\varepsilon_{2},0)-differentially private. More generally, we have

Let Ai:XnRi{\cal A}_{i}:\mathcal{X}^{n}\rightarrow\mathcal{R}_{i} be an (εi,δi)(\varepsilon_{i},\delta_{i})-differentially private algorithm for i[k]i\in[k]. Then if A[k]:Xni=1kRi{\cal A}_{[k]}:\mathcal{X}^{n}\rightarrow\prod_{i=1}^{k}\mathcal{R}_{i} is defined to be A[k](S)=(A1(S),,Ak(S)){\cal A}_{[k]}(S)=({\cal A}_{1}(S),\ldots,{\cal A}_{k}(S)), then A[k]{\cal A}_{[k]} is (i=1kεi,i=1kδi)(\sum_{i=1}^{k}\varepsilon_{i},\sum_{i=1}^{k}\delta_{i})-differentially private.

A more sophisticated argument yields significant improvement when ε<1\varepsilon<1:

For all ε,δ,δ0\varepsilon,\delta,\delta^{\prime}\geq 0, the composition of kk arbitrary (ε,δ)(\varepsilon,\delta)-differentially private mechanisms is (ε,kδ+δ)(\varepsilon^{\prime},k\delta+\delta^{\prime})-differentially private, where

even when the mechanisms are chosen adaptively.

Theorems 25 and 26 are very general. For example, they apply to queries posed to overlapping, but not identical, data sets. Nonetheless, data utility will eventually be consumed: the Fundamental Law of Information Recovery states that overly accurate answers to too many questions will destroy privacy in a spectacular way (see [DN03] et sequelae). The goal of algorithmic research on differential privacy is to stretch a given privacy “budget” of, say, ε0\varepsilon_{0}, to provide as much utility as possible, for example, to provide useful answers to a great many counting queries. The bounds afforded by the composition theorems are the first, not the last, word on utility.

Appendix C Concentration and moment bounds

We will use the following statement of the multiplicative Chernoff bound:

Let Y1,Y2,,YnY_{1},Y_{2},\ldots,Y_{n} be i.i.d. Bernoulli random variables with expectation p>0p>0. Then for every γ>0\gamma>0,

C.2 Moment Bounds

and by using this in equality (11) we obtain that

For all integers nk1n\geq k\geq 1 and pp\in,

Let UU denote 1ni[n]Xi\frac{1}{n}\sum_{i\in[n]}X_{i}, where XiX_{i}’s are i.i.d. Bernoulli random variables with expectation p>0p>0 (the claim is obviously true if p=0p=0). Then

We substitute t=(1+γ)kpkt=(1+\gamma)^{k}p^{k} and observe that Lemma 27 gives:

Using this substitution in eq.(12) together with dtdγ=k(1+γ)k1pk\frac{dt}{d\gamma}=k(1+\gamma)^{k-1}\cdot p^{k} we obtain

We now find the maximum of g(γ)kln(1+γ)np((1+γ)ln(1+γ)γ)g(\gamma)\doteq k\ln(1+\gamma)-np((1+\gamma)\ln(1+\gamma)-\gamma). Differentiating the expression we get k1+γnpln(1+γ)\frac{k}{1+\gamma}-np\ln(1+\gamma) and therefore the function attains its maximum at the (single) point γ0\gamma_{0} which satisfies: (1+γ0)ln(1+γ0)=knp(1+\gamma_{0})\ln(1+\gamma_{0})=\frac{k}{np}. This implies that ln(1+γ0)ln(knp).\ln(1+\gamma_{0})\leq\ln\left(\frac{k}{np}\right). Now we observe that (1+γ)ln(1+γ)γ(1+\gamma)\ln(1+\gamma)-\gamma is always non-negative and therefore g(γ0)kln(knp)g(\gamma_{0})\leq k\ln\left(\frac{k}{np}\right). Substituting this into eq.(13) we conclude that

Finally, we observe that if p1/np\geq 1/n then clearly ln(1/p)lnn\ln(1/p)\leq\ln n and the claim holds. For any p<1/np<1/n we use monotonicity of Mk[B(n,p)]\mathcal{M}_{k}[B(n,p)] in pp and upper bound the probability by the bound for p=1/np=1/n that equals

kmax{4pln(2/β)/τ, 2loglogn}k\geq\max\{4p\ln(2/\beta)/\tau,\ 2\log\log n\},

Using the condition ετ/2\varepsilon\leq\tau/2 and τ1/3\tau\leq 1/3 we first observe that

Hence, with the condition that k4pln(2/β)/τk\geq 4p\ln(2/\beta)/\tau we get

Together with the condition kmax{4ln(2/β)/τ, 2loglogn}k\geq\max\{4\ln(2/\beta)/\tau,\ 2\log\log n\}, we have

since k/2loglognk/2\geq\log\log n holds by assumption and for k12ln(2/β)k\geq 12\ln(2/\beta), k/6log(2/β)k/6\geq\log(2/\beta) and k/3log(k+1)k/3\geq\log(k+1) (whenever β<2/3\beta<2/3). Therefore we get

Combining eq.(15) and (16) we obtain that

Substituting this into eq.(14) we obtain the claim. ∎