









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










One of the most useful tasks in data analysis is machine learning: the problem of automatically finding a simple rule to accurately predict cer- tain unknown characteristics of never before seen data. Many machine learning tasks can be performed under the constraint of differential pri- vacy. In fact, the constraint of privacy is not necessarily at odds with the goals of machine learning, both of which aim to extract informa- tion from the distribution from which the data was drawn, rather than from individual data points. In this section, we survey a few of the most basic results on private machine learning, without attempting to cover this large field completely. The goal in machine learning is very often similar to the goal in pri- vate data analysis. The learner typically wishes to learn some simple rule that explains a data set. However, she wishes this rule to general- ize — that is, it should be that the rule she learns not only correctly describes the data that she has on hand, but that it should also be able to correctly describe new data that is drawn from the same dis- tribution. Generally, this means that she wants to learn a rule that captures distributional information about the data set on hand, in a way that does not depend too specifically on any single data point. Of
course, this is exactly the goal of private data analysis — to reveal dis- tributional information about the private data set, without revealing too much about any single individual in the dataset. It should come as no surprise then that machine learning and private data analysis are closely linked. In fact, as we will see, we are often able to perform private machine learning nearly as accurately, with nearly the same number of examples as we can perform non-private machine learning. Let us first briefly define the problem of machine learning. Here, we will follow Valiant’s PAC (Or Probably Approximately Correct ) model of machine learning. Let X = { 0 , 1 } d^ be the domain of “unlabeled examples.” Think of each x ∈ X as a vector containing d boolean attributes. We will think of vectors x ∈ X as being paired with labels y ∈ { 0 , 1 }.
Definition 11.1. A labeled example is a pair ( x, y ) ∈ X ×{ 0 , 1 }: a vector paired with a label.
A learning problem is defined as a distribution D over labeled exam- ples. The goal will to be to find a function f : X → { 0 , 1 } that correctly labels almost all of the examples drawn from the distribution.
Definition 11.2. Given a function f : X → { 0 , 1 } and a distribution D over labeled examples, the error rate of f on D is:
err( f, D) = Pr ( x,y )∼D
[ f ( x ) 6 = y ]
We can also define the error rate of f over a finite sample D :
err( f, D ) =
|{( x, y ) ∈ D : f ( x ) 6 = y }|.
A learning algorithm gets to observe some number of labeled exam- ples drawn from D, and has the goal of finding a function f with as small an error rate as possible when measured on D. Two parameters in measuring the quality of a learning algorithm are its running time, and the number of examples it needs to see in order to find a good hypothesis.
Definition 11.3. An algorithm A is said to PAC-learn a class of func- tions C over d dimensions if for every α, β > 0 , there exists an
11.1 Sample complexity of differentially private machine learning 219
Note that an SQ learning algorithm does not get any access to D except through the SQ oracle. As with PAC learning, we can talk about an SQ learning algorithm operating in either the realizable or the agnostic setting, and talk about the computational efficiency of the learning algorithm. We say that a class C is SQ learnable if there exists an SQ learning algorithm for C.
Perhaps the first question that one might ask, with respect to the relationship between privacy and learning, is “When is it possible to privately perform machine learning”? In other words, you might ask for a PAC learning algorithm that takes as input a dataset (implic- itly assumed to be sampled from some distribution D), and then privately output a hypothesis f that with high probability has low error over the distribution. A more nuanced question might be, “How many additional samples are required to privately learn, as compared with the number of samples already required to learn without the con- straint of differential privacy?” Similarly, “How much additional run- time is necessary to privately learn, as compared with the run-time required to learn non-privately?” We will here briefly sketch known results for ( ε, 0)-differential privacy. In general, better results for ( ε, δ )- differential privacy will follow from using the advanced composition theorem. A foundational information theoretic result in private machine learning is that private PAC learning is possible with a polynomial num- ber of samples if and only if non-private PAC learning is possible with a polynomial number of samples, even in the agnostic setting. In fact, the increase in sample complexity necessary is relatively small — how- ever, this result does not preserve computational efficiency. One way to do this is directly via the exponential mechanism. We can instantiate the exponential mechanism with a range R = C , equal to the class of queries to be learned. Given a database D , we can use the quality score q ( f, D ) = − (^) | D^1 | |{( x, y ) ∈ D : f ( x ) 6 = y }|: i.e., we seek to minimize the fraction of misclassified examples in the private dataset. This is clearly
220 Differential Privacy and Machine Learning
a 1 /n sensitive function of the private data, and so we have via our utility theorem for the exponential mechanism that with probability 1 − β , this mechanism returns a function f ∈ C that correctly labels an
OPT −
2(log | C |+log (^) β^1 ) εn fraction of the points in the database correctly. Recall, however, that in the learning setting, we view the database D as consisting of n i.i.d. draws from some distribution over labeled examples D. Recall the discussion of sampling bounds in Lemma 4.3. A Chernoff bound combined with a union bound tells us that with high probability, if D consists of n i.i.d. samples drawn from D, then for all
f ∈ C : |err( f, D ) − err( f, D)| ≤ O (
√ log | C | n ). Hence, if we wish to find a hypothesis that has error within α of the optimal error on the distri- bution D, it suffices to draw a database D consisting of n ≥ log | C | /α^2 samples, and learn the best classifier f ∗^ on D. Now consider the problem of privately PAC learning, using the exponential mechanism as described above. Recall that, by Theorem 3.11, it is highly unlikely that the exponential mechanism will return a function f with utility score that is inferior to that of the optimal f ∗^ by more than an additive factor of O ((∆ u/ε ) log | C |), where in this case ∆ u , the sensitivity of the utility function, is 1 /n. That is, with high probability the exponential mechanism will return a function f ∈ C such that:
err( f, D ) ≤ min f ∗∈ C err( f ∗ , D ) + O
( (^) (log | C |) εn
)
≤ min f ∗∈ C err( f ∗ , D) + O
√ log | C | n
(^) + O
( (log | C |) εn
) .
Hence, if we wish to find a hypothesis that has error within α of the optimal error on the distribution D, it suffices to draw a database D consisting of:
n ≥ O
( max
( log | C | εα
log | C | α^2
)) ,
which is not asymptotically any more than the database size that is required for non-private learning, whenever ε ≥ α.
222 Differential Privacy and Machine Learning
private learning is immediate via the Laplace mechanism, and preserves computational efficiency!
In this section, we consider a slightly different learning problem, known as the problem of learning from expert advice. This problem will appear somewhat different from the classification problems that we discussed in the previous section, but in fact, the simple algorithm presented here is extremely versatile, and can be used to perform classification among many other tasks which we will not discuss here. Imagine that you are betting on horse races, but unfortunately know nothing about horses! Nevertheless, you have access to the opinions of some k experts , who every day make a prediction about which horse is going to win. Each day you can choose one of the experts whose advice you will follow, and each day, following your bet, you learn which horse actually won. How should you decide which expert to follow each day, and how should you evaluate your performance? The experts are not perfect (in fact they might not even be any good!), and so it is not reasonable to expect you to make the correct bet all of the time, or even most of the time if none of the experts do so. However, you might have a weaker goal: can you bet on horses in such a way so that you do almost as well as the best expert, in hindsight? Formally, an online learning algorithm A operates in the following environment:
(a) A chooses an expert at ∈ { 1 ,... , k } (b) A observes a loss ti_ ∈ [0 _,_ 1] for each expert _i_ ∈ { 1 _,... , k_ } and experiences loss _tat.
For a sequence of losses _ ≤ _T_^ ≡ { _t } Tt =1, we write:
Li ( ` ≤ T^ ) =
∑^ T
t =
`ti
11.2. Differentially private online learning 223
to denote the total average loss of expert i over all T rounds, and write
LA ( ` ≤ T^ ) =
∑^ T
t =
`tat
to denote the total average loss of the algorithm. The regret of the algorithm is defined to be the difference between the loss that it actually incurred, and the loss of the best expert in hindsight:
Regret( A, _ ≤ _T_^ ) = _LA_ ( _ ≤ T^ ) − min i Li ( ` ≤ T^ ).
The goal in online learning is to design algorithms that have the guaran- tee that for all possible loss sequences ` ≤ T^ , even adversarialy chosen, the regret is guaranteed to tend to zero as T → ∞. In fact, this is possible using the multiplicative weights algorithm (known also by many names, e.g., the Randomized Weighted Majority Algorithm, Hedge, Exponen- tiated Gradient Descent, and multiplicative weights being among the most popular).
Remark 11.1. We have already seen this algorithm before in Section 4 — this is just the multiplicative weights update rule in another guise! In fact, it would have been possible to derive all of the results about the private multiplicative weights mechanism directly from the regret bound we state in Theorem 11.1.
Algorithm 15 The Multiplicative Weights (or Randomized Weighted Majority (RWM)) algorithm, version 1. It takes as input a stream of losses _^1 _,^2 ,... and outputs a stream of actions a 1 , a 2 ,.... It is param- eterized by an update parameter η. RWM ( η ):
For each i ∈ { 1 ,... , k }, let wi ← 1. for t = 1 ,... do Choose action at = i with probability proportional to wi Observe t_^ and set _wi_ ← _wi_ · exp(− _ηti ), for each i ∈ [ k ] end for
It turns out that this simple algorithm already has a remarkable regret bound.
11.2. Differentially private online learning 225
Algorithm 16 The Multiplicative Weights (or Randomized Weighted Majority (RWM)) algorithm, rephrased. It takes as input a stream of losses _^1 _,^2 ,... and outputs a stream of actions a 1 , a 2 ,.... It is param- eterized by an update parameter η. RWM ( η ):
for t = 1 ,... do Choose action at = i with probability proportional to exp(− η
∑ t − 1 j =1 `
j i ) Observe `t end for
each round t , the randomized weighted majority algorithm chooses an action at in a way that preserves 2 η differential privacy, so to achieve privacy ε it suffices to set η = ε/ 2. Moreover, over the course of the run of the algorithm, it will choose an action T times. If we want the entire run of the algorithm to be ( ε, δ )-differentially private for some ε and δ , we can thus simply apply our composition theorems. Recall that by Theorem 3.20, since there are T steps in total, if each step of the algorithm is ( ε ′ , 0)-differentially private for ε ′^ = ε/
√ 8 T ln(1 /δ ), then the entire algorithm will be ( ε, δ ) differentially private. Thus, the following theorem is immediate by set- ting η = ε ′ / 2 :
Theorem 11.2. For a sequence of losses of length T , the algorithm RWM( η ) with η = √ 32 T ε ln(1 /δ ) is ( ε, δ )-differentially private.
Remarkably, we get this theorem without modifying the original randomized weighted majority algorithm at all , but rather just by set- ting η appropriately. In some sense, we are getting privacy for free! We can therefore use Theorem 11.1, the utility theorem for the RWM algorithm, without modification as well:
Theorem 11.3. For any adversarially chosen sequence of losses of length T , _ ≤ _T_^ = ( _^1 ,... , `T^ ) the Randomized Weighted Majority
226 Differential Privacy and Machine Learning
algorithm with update parameter η = √ 32 T ε ln(1 /δ ) has the guarantee
that:
E[Regret(RWM( η ) , ` ≤ T^ )] ≤
ε √ 32 T ln(1 /δ )
√ 32 ln(1 /δ ) ln k ε
√ 128 ln(1 /δ ) ln k ε
where k is the number of experts.
Since the per-round loss at each time step t is an independently chosen random variable (over the choices of at ) with values bounded in [− 1 , 1], we can also apply a Chernoff bound to get a high probability guarantee:
Theorem 11.4. For any adversarially chosen sequence of losses of length T , _ ≤ _T_^ = ( _^1 ,... , `T^ ) the Randomized Weighted Majority algo- rithm with update parameter η = √ 32 T ε ln(1 /δ ) produces a sequence of
actions such that with probability at least 1 − β :
Regret(RWM( η ) , ` ≤ T^ ) ≤
√ 128 ln(1 /δ ) ln k ε
√ ln k/β T
= O
( √ ln(1 /δ ) ln( k/β ) ε
) .
This bound is nearly as good as the best possible bound achievable even without privacy (i.e., the RWM bound) — the regret bound is
larger only by a factor of Ω(
ln( k ) ln(1 /δ ) ε ). (We note that by using a different algorithm with a more careful analysis, we can remove this extra factor of
ln k ). Since we are in fact using the same algorithm, efficiency is of course preserved as well. Here we have a powerful exam- ple in machine learning where privacy is nearly “free.” Notably, just as with the non-private algorithm, our utility bound only gets better the longer we run the algorithm, while keeping the privacy guarantee the same.^3 (^3) Of course, we have to set the update parameter appropriately, just as we have to do with the non-private algorithm. This is easy when the number of rounds T is known ahead of time, but can also be done adaptively when the number of rounds is not known ahead of time.
228 Differential Privacy and Machine Learning
Note that if we have a sample S from D of size | S | = T , then we can run the RWM algorithm on the sequence of losses as described above for a total of T rounds. This will produce a sequence of outputs a 1 ,... , aT , and we will define our final classifier to be θT^ ≡ (^) T^1 ∑ T i =1 ai. (Recall that each ai is a standard basis vector ai ∈ { e 1 ,... , ed }, and so we have ‖ θT^ ‖ 1 = 1). We summarize the algorithm below:
Algorithm 17 An algorithm for learning linear functions. It takes as input a private database of examples S ⊂ [− 1 , 1] d , S = ( x 1 ,... , xT ), and privacy parameters ε and δ. LinearLearner ( S, ε, δ ):
Let η ← √ 32 T ε ln(1 /δ ) for t = 1 to T = | S | do Choose vector at = ei with probability proportional to exp(− η ∑ t − 1 j =1 `
j i ) Let loss vector `t^ = (〈 e 1 , xt 〉 , 〈 e 2 , xt 〉 ,... , 〈 ed, xt 〉). end for Output θT^ = (^) T^1 ∑ T t =1 at.
We have already seen that LinearLearner is private, since it is sim- ply an instantiation of the randomized weighted majority algorithm with the correct update parameter η :
Theorem 11.5. LinearLearner ( S, ε, δ ) is ( ε, δ )-differentially private.
It remains to analyze the classification accuracy of LinearLearner, which amounts to considering the regret bound of the private RWM algorithm.
Theorem 11.6. If S consists of T i.i.d. samples x ∼ D, then with probability at least 1 − β , LinearLearner outputs a vector θT^ such that:
E x ∼D[〈 θT^ , x 〉] ≤ min θ ∗^ E x ∼D[〈 θ ∗ , x 〉] + O
( √ ln(1 /δ ) ln( d/β ) ε
) ,
where d is the number of experts.
11.3. Empirical risk minimization 229
Proof. By Theorem 11.4, we have the following guarantee with proba- bility at least 1 − β/ 2 :
1 T
∑^ T
t =
〈 at, xt 〉 ≤ min i ∈{ 1 ,...,d }
〈 ei,
∑^ T
t =
xt
〉
( √ ln(1 /δ ) ln( d/β ) ε
)
= min θ ∗∈[0 , 1] d :‖ θ ∗‖ 1 =
〈 θ ∗ ,
∑^ T
t =
xt
〉
( √ ln(1 /δ ) ln( d/β ) ε
) .
In the first equality, we use the fact that the minimum of a linear func- tion over the simplex is achieved at a vertex of the simplex. Noting that each xt ∼ D independently and that each 〈 xt, ei 〉 is bounded in [− 1 , 1], we can apply Azuma’s inequality twice to bound the two quantities with probability at least 1 − β/ 2 :
∣∣ ∣∣ ∣
∑^ T t =
〈 at, xt 〉 −
∑^ T t =
E x ∼D〈 at, x 〉
∣∣ ∣∣ ∣
∣∣ ∣∣ ∣
∑^ T
t =
〈 at, xt 〉 − E x ∼D〈 θT^ , x 〉
∣∣ ∣∣ ∣ ≤^ O
√ ln(1 /β ) T
and
max i ∈{ 1 ,...,d }
∣∣ ∣∣ ∣
〈 ei,
∑^ T
t =
xt
〉 − E x ∼D〈 ei, x 〉
∣∣ ∣∣ ∣ ≤^ O
√ ln( d/β ) T
(^).
Hence we also have:
max θ ∗∈[0 , 1] d :‖ θ ∗‖ 1 =
∣∣ ∣∣ ∣
〈 θ ∗ ,
∑^ T
t =
xt
〉 − E x ∼D〈 θ ∗ , x 〉
∣∣ ∣∣ ∣ ≤^ O
√ ln d/β T
(^).
Combining these inequalities gives us our final result about the output of the algorithm θT^ :
E x ∼D〈 θT^ , x 〉 ≤ min θ ∗∈[0 , 1] d :‖ θ ∗‖ 1 =
E x ∼D〈 θ ∗ , x 〉 + O
( √ ln(1 /δ ) ln( d/β ) ε
) .