Once we have designed some basic differentially private algorithms, it is a natural idea to combine them and analysis the privacy loss. We begin with an illustrative example that sets up the mathematical model step by step.

Image yourself in front of the door of a safe vault protected by a password lock. To open the door, you need the correct password PP. If tried with the wrong password, the lock would destroy itself automatically.

Luckily, you know two candidate passwords P1P_1 and P2P_2, with one of them being the correct one. Further, you notice that the designer of the lock left a collection of boxes near the door, which contain information on how they decide the correct passwords. Obtaining complete information of anyone of them gives you the correct password.

But the boxes are also protected and you don't have legally access to them. However, you can hack into the boxes. Hacking into the box won't give you all its information, but a random message. In particular, each box BB is associated with a set RB\mathcal{R}_B, which is a finite collection of messages (in English). When BB is hacked, it returns a message YBY_B generated randomly from RB\mathcal{R}_B, whose distribution depends on the correct password PP.

Let DB,P1\mathcal{D}_{B, P_1} be the distribution of YBY_B if the correct password is P1P_1, and DB,P2\mathcal{D}_{B, P_2} be the one if the correct password is P2P_2. If there is a huge difference between DB,P1\mathcal{D}_{B, P_1} and DB,P2\mathcal{D}_{B, P_2}, then you might be able to guess the correct password.

E.g., suppose RB=\mathcal{R}_B = { "Dog bites.", "Cat scratches." } and the distributions are given as

DB,P1\mathcal{D}_{B, P_1} DB,P2\mathcal{D}_{B, P_2}
"Dog bites." 0.99 0.01
"Cat scratches." 0.01 0.99

Hence, when you get YB=Y_B= "Dog bites.", you prefer P1P_1 over P2P_2 and vice versa.

Anticipating such potential information leakage, the designer of the lock equips the boxes with a defense mechanism, called (ϵ,0)(\epsilon, 0)-mechanism. It guarantees the distributions DB,P1\mathcal{D}_{B, P_1} and DB,P2\mathcal{D}_{B, P_2} are similar so that it is hard for you to infer the correct password from the message. In particular, ∀S⊂RB\forall S \subset \mathcal{R}_B, if SS is measurable, it holds that

Pr⁡[YB∈S ∣ P=P1]≤eϵ⋅Pr⁡[YB∈S ∣ P=P2]Pr⁡[YB∈S ∣ P=P2]≤eϵ⋅Pr⁡[YB∈S ∣ P=P1] \Pr[ Y_B \in S \ | \ P = P_1 ] \le e^\epsilon \cdot \Pr[ Y_B \in S \ | \ P = P_2 ] \\ \Pr[ Y_B \in S \ | \ P = P_2 ] \le e^\epsilon \cdot \Pr[ Y_B \in S \ | \ P = P_1 ] \\

When these inequalities are satisfied, we say that DB,P1\mathcal{D}_{B, P_1} and DB,P2\mathcal{D}_{B, P_2} are (ϵ,0)(\epsilon, 0) close. The inequalities require DB,P1\mathcal{D}_{B, P_1} and DB,P2\mathcal{D}_{B, P_2} to have the same support on RB\mathcal{R}_B. Therefore, throughout our discussion below, we assume that both DB,P1\mathcal{D}_{B, P_1} and DB,P2\mathcal{D}_{B, P_2} assign positive probability to each element in RB\mathcal{R}_B. Otherwise, we can just replace RB\mathcal{R}_B with the support of DB,P1\mathcal{D}_{B, P_1} (which is also the support of DB,P2\mathcal{D}_{B, P_2}).

Now, hacking one box is unlikely to help you to guess the correct password. You want to hack more boxes, with the hope that the information combined will assist you. Due to resource limit, you can't hack all boxes but only a finite number of them. You choose the first box randomly. Then you choose every new box based on the information obtained from the hacked boxes. The figure below shows an example of hacking five boxes.

Suppose that your resource enables you to hack nn boxes and let Y⃗n=(Y1,Y2,...,Yn)\vec Y_n = (Y_1, Y_2, ..., Y_n) be the output messages you obtained. Similar to the situation of hacking one box, if the distribution of Y⃗n\vec Y_n, conditioned on P=P1P = P_1, is utterly distant from that conditioned on P=P2P = P_2, then there could be some cases when you can confidently infer the true password. Conversely, to prevent severe information leakage, the designer needs to ensure there isn't such case, i.e., the two distributions should be similar.

What makes things even more complicated is that, the distribution of Y⃗n\vec Y_n depends not only on the output distributions of the boxes, but also on your strategy of choosing the boxes to hack. Let's use symbol AA to denote your strategy. Whatever AA is, the designer need to guarantee that the distribution of Y⃗n\vec Y_n conditioned P=P1P = P_1 should be similar to that conditioned on P=P2P = P_2.

Surprisingly, this is in some sense achievable, as long as for each box, its output distribution conditioned on P=P1P = P_1 is (ϵ,0)(\epsilon, 0) close to that conditioned on P=P2P = P_2.

Let R\mathcal{R} be the set of possible possible messages of all boxes.

Theorem. ∀A\forall A, ∀S⊂Rn\forall S \subset \mathcal{R}^n, it holds that ∀δ′∈(0,1)\forall \delta' \in (0, 1),

Pr⁡[Y⃗n∈S ∣ P=P1,A]≤eϵ′⋅Pr⁡[Y⃗n∈S ∣ P=P2,A]+δ′Pr⁡[Y⃗n∈S ∣ P=P2,A]≤eϵ′⋅Pr⁡[Y⃗n∈S ∣ P=P1,A]+δ′ \Pr[ \vec Y_n \in S \ | \ P = P_1, A] \le e^{\epsilon'} \cdot \Pr[ \vec Y_n \in S \ | \ P = P_2, A] + \delta' \\ \Pr[ \vec Y_n \in S \ | \ P = P_2, A] \le e^{\epsilon'} \cdot \Pr[ \vec Y_n \in S \ | \ P = P_1, A] + \delta'

where ϵ′=kϵ(eϵ−1)+ϵ2nlog⁡1δ′\epsilon' = k\epsilon(e^\epsilon - 1) + \epsilon \sqrt{2 n \log \frac{1}{\delta'} }.

If we view ϵ\epsilon as the privacy loss of a single box, then the theorem states that the privacy loss grows to O(nϵ)O(\sqrt {n} \epsilon ) is nn boxes are hacked.

To prove the theorem, we need a rigorous model for the problem.

Definitions.

  1. I\mathcal{I}: the index set.

  2. {Bα:α∈I}\{ B_\alpha : \alpha \in \mathcal{I} \}: the collection of boxes.

  3. {Rα:α∈I}\{ \mathcal{R}_{\alpha} : \alpha \in \mathcal{I} \}: the ranges of the outputs of the boxes.

  4. R≐∪α∈IRα\mathcal{R} \doteq \cup_{\alpha \in \mathcal{I} } R_\alpha: the range of any possible output by any box.

  5. {Dα,P1:α∈I}\{ \mathcal{D}_{\alpha, P_1} : \alpha \in \mathcal{I} \} ({Dα,P2:α∈I}\{ \mathcal{D}_{\alpha, P_2} : \alpha \in \mathcal{I} \}): the set of output distribution when the correct password is P1P_1 (P2P_2). Without loss of generality, we assume that for a fixed α∈I\alpha \in \mathcal{I}, the distribution Dα,P1\mathcal{D}_{\alpha, P_1} (Dα,P2\mathcal{D}_{\alpha, P_2}) assigns positive probability to each element in Rα\mathcal{R}_\alpha. Moreover, Dα,P1\mathcal{D}_{\alpha, P_1} and Dα,P2\mathcal{D}_{\alpha, P_2} are (ϵ,0)(\epsilon, 0) close.

  6. nn: the number of boxes you can hack.

  7. i⃗k≐(i1,i2,...,ik)\vec i_k \doteq (i_1, i_2, ..., i_k): the index sequence of boxes you have chosen to hack up to time kk, where k∈[0,n]k \in [0, n]. When k=0k = 0, i⃗0\vec i_0 corresponds to a empty sequence.

  8. Y⃗k=(Y1,Y2,...,Yk):\vec Y_k = (Y_1, Y_2, ..., Y_k): the random variables that represent messages outputted by the chosen boxes up to time k∈[1,n]k \in [1, n], where Yt∈Rit⊂RY_t \in \mathcal{R}_{i_t} \subset \mathcal{R} for t∈[1,k]t \in [1, k]. Therefore, Y⃗k\vec Y_k can be view as random vector in Rk\mathcal{R}^k.

  9. x⃗k=(x1,x2,...,xk)∈Rk:\vec x_k = (x_1, x_2, ..., x_k) \in \mathcal{R}^k: a point in Rk\mathcal{R}^k, where k∈[0,n]k \in [0, n]. When k=0k = 0, we define x⃗0=∅\vec x_0 = \emptyset.

  10. h⃗k=<i⃗k,x⃗k>=<(i1,i2,i3,...,ik),(x1,x2,...,xk)>:\vec h_k = \left< \vec i_k, \vec x_k \right> = \left< (i_1, i_2, i_3, ..., i_k), (x_1, x_2, ..., x_k) \right>: the history up to k∈[0,n]k \in [0, n], which consists of the chosen indexes and observations up to time kk. We use h⃗0\vec h_0 to denote the empty history.

  11. A:A: your strategy (policy) for choosing boxes. It works as follows: for any fixed history h⃗k=<i⃗k,x⃗k>\vec h_k = \left< \vec i_k, \vec x_k \right>, A is associated with a fixed distribution DA,h⃗k\mathcal{D}_{A, \vec h_k} over I∖i⃗k\mathcal{I} \setminus \vec i_k, the set of indexes of the unchosen boxes. When inputted with h⃗k\vec h_k, AA returns a random variable A(h⃗k)A(\vec h_k) that follows the distribution DA,h⃗k\mathcal{D}_{A, \vec h_k}.

We will show that, no matter what strategy you use, it is unlikely that you distinguish via the output Y⃗n\vec Y_n whether the correct password is P1P_1 or P2P_2. This is because whether P=P1P = P_1 or not, the output distributions of Y⃗n\vec Y_n are similar.

Proof of the theorem. We will just prove the first inequality, and the second one follows from symmetry. We consider a bad set in Rn\mathcal{R}^n:

W≐{x⃗n∈Rn:Pr⁡[Y⃗n=x⃗n ∣ P=P1,A]≥eϵ′⋅Pr⁡[Y⃗n=x⃗n ∣ P=P2,A]} \mathcal{W} \doteq \{ \vec x_n \in \mathcal{R}^n : \Pr[ \vec Y_n = \vec x_n \ | \ P = P_1, A] \ge e^{\epsilon'} \cdot \Pr[ \vec Y_n = \vec x_n \ | \ P = P_2, A] \}

and will use the following lemma.

Lemma. Pr⁡[Y⃗n∈W ∣ P=P1,A]≤δ′\Pr[ \vec Y_n \in \mathcal{W}\ | \ P = P_1, A] \le \delta'.

Hence,

Pr⁡[Y⃗n∈S ∣ P=P1,A]=Pr⁡[Y⃗n∈S∩Wˉ ∣ P=P1,A]+Pr⁡[Y⃗n∈S∩W ∣ P=P1,A]≤Pr⁡[Y⃗n∈S∩Wˉ ∣ P=P1,A]+Pr⁡[Y⃗n∈W ∣ P=P1,A]≤Pr⁡[Y⃗n∈S∩Wˉ ∣ P=P1,A]+δ′=∑x⃗n∈S∩WˉPr⁡[Y⃗n=x⃗n ∣ P=P1,A]+δ′<∑x⃗n∈S∩Wˉeϵ′⋅Pr⁡[Y⃗n=x⃗n ∣ P=P2,A]+δ′=eϵ′⋅Pr⁡[Y⃗n∈S ∣ P=P2,A]+δ′ \begin{aligned} \Pr[ \vec Y_n \in S \ | \ P = P_1, A] &= \Pr[ \vec Y_n \in S \cap \bar{\mathcal{W} } \ | \ P = P_1, A] + \Pr[ \vec Y_n \in S \cap \mathcal{W} \ | \ P = P_1, A] \\ &\le \Pr[ \vec Y_n \in S \cap \bar{\mathcal{W} } \ | \ P = P_1, A] + \Pr[ \vec Y_n \in \mathcal{W} \ | \ P = P_1, A] \\ &\le \Pr[ \vec Y_n \in S \cap \bar{\mathcal{W} } \ | \ P = P_1, A] + \delta' \\ &= \sum_{ \vec x_n \in S \cap \bar{\mathcal{W} } } \Pr[ \vec Y_n = \vec x_n \ | \ P = P_1, A] + \delta' \\ &< \sum_{ \vec x_n \in S \cap \bar{\mathcal{W} } } e^{\epsilon'} \cdot \Pr[ \vec Y_n = \vec x_n \ | \ P = P_2, A] + \delta' \\ &= e^{\epsilon'} \cdot \Pr[ \vec Y_n \in S \ | \ P = P_2, A] + \delta' \end{aligned}

The first inequality follows from monotonicity of probability, the second one from the lemma, and the final one from the definition of W\mathcal{W}.

Proof of the lemma. To prove the lemma, we need only to consider those point x⃗n\vec x_n with

Pr⁡[Y⃗n=x⃗n ∣ P=P1,A]>0. \Pr[ \vec Y_n = \vec x_n \ | \ P = P_1, A] > 0.

Otherwise, x⃗n\vec x_n contributes to 0 probability to the set W\mathcal{W} (whether it belongs to W\mathcal{W} or not).

Now, we expand the probability Pr⁡[Y⃗n=x⃗n ∣ P=P1,A]\Pr[ \vec Y_n = \vec x_n \ | \ P = P_1, A]. To obtain the kk-th output, there are two steps

  1. AA generates a index iki_k of a box based on the known history h⃗k−1\vec h_{k - 1}.
  2. The box BikB_{i_k} is hacked, and output a random message xkx_k sampled from its distribution Dik,P1D_{i_k, P_1}.

Let H⃗k\vec H_k be a random variable that represents the history up to kk. By chain rule, we have

Pr⁡[Y⃗n=x⃗n ∣ P=P1,A]=∏k=1nPr⁡Yk∼Dik,P1[Yk=xk ∣A(h⃗k−1)=ik,H⃗k−1=h⃗k−1, P=P1,A]  ⋅∏k=1nPr⁡A(h⃗k−1)∼DA,h⃗k−1[A(h⃗k−1)=ik∣H⃗k−1=h⃗k−1, P=P1,A] \begin{aligned} \Pr[ \vec Y_n = \vec x_n \ | \ P = P_1, A] &= \prod_{k = 1}^n \Pr_{Y_k \sim \mathcal{D}_{i_k, P_1} } [ Y_k = x_k \ | A(\vec h_{k - 1} ) = i_k, \vec H_{k - 1} = \vec h_{k - 1}, \ P = P_1, A ] \\ &\ \ \cdot \prod_{k = 1}^n \Pr_{ A(\vec h_{k - 1} ) \sim \mathcal{D}_{A, \vec h_{k - 1} } } [ A(\vec h_{k - 1} ) = i_k \mid \vec H_{k - 1} = \vec h_{k - 1}, \ P = P_1, A ] \end{aligned}

By Pr⁡[Y⃗n=x⃗n ∣ P=P1,A]>0\Pr[ \vec Y_n = \vec x_n \ | \ P = P_1, A] > 0, each term in the expansion are positive. Similarly,

Pr⁡[Y⃗n=x⃗n ∣ P=P2,A]=∏k=1nPr⁡Yk∼Dik,P2[Yk=xk ∣A(h⃗k−1)=ik,H⃗k−1=h⃗k−1, P=P2,A]  ⋅∏k=1nPr⁡A(h⃗k−1)∼DA,h⃗k−1[A(h⃗k−1)=ik∣H⃗k−1=h⃗k−1, P=P2,A] \begin{aligned} \Pr[ \vec Y_n = \vec x_n \ | \ P = P_2, A] &= \prod_{k = 1}^n \Pr_{Y_k \sim \mathcal{D}_{i_k, P_2} } [ Y_k = x_k \ | A(\vec h_{k - 1} ) = i_k, \vec H_{k - 1} = \vec h_{k - 1}, \ P = P_2, A ] \\ &\ \ \cdot \prod_{k = 1}^n \Pr_{ A(\vec h_{k - 1} ) \sim \mathcal{D}_{A, \vec h_{k - 1} } } [ A(\vec h_{k - 1} ) = i_k \mid \vec H_{k - 1} = \vec h_{k - 1}, \ P = P_2, A ] \end{aligned}

As both Dik,P1\mathcal{D}_{i_k, P_1} and Dik,P2\mathcal{D}_{i_k, P_2} assign positive probability to each point in Rik\mathcal{R}_{i_k}, we know Pr⁡[Y⃗n=x⃗n ∣ P=P2,A]>0\Pr[ \vec Y_n = \vec x_n \ | \ P = P_2, A] > 0.

We are ready to consider the ratio:

ln⁡Pr⁡[Y⃗n=x⃗n ∣ P=P1,A]Pr⁡[Y⃗n=x⃗n ∣ P=P2,A]=∑k=1nln⁡Pr⁡Yk∼Dik,P1[Yk=xk ∣A(h⃗k−1)=ik,H⃗k−1=h⃗k−1, P=P1,A]Pr⁡Yk∼Dik,P2[Yk=xk ∣A(h⃗k−1)=ik,H⃗k−1=h⃗k−1, P=P2,A]. \begin{aligned} \ln \frac{ \Pr[ \vec Y_n = \vec x_n \ | \ P = P_1, A] }{ \Pr[ \vec Y_n = \vec x_n \ | \ P = P_2, A] } = \sum_{k = 1}^n \ln \frac{ \Pr_{Y_k \sim \mathcal{D}_{i_k, P_1} } [ Y_k = x_k \ | A(\vec h_{k - 1} ) = i_k, \vec H_{k - 1} = \vec h_{k - 1}, \ P = P_1, A ] }{ \Pr_{Y_k \sim \mathcal{D}_{i_k, P_2} } [ Y_k = x_k \ | A(\vec h_{k - 1} ) = i_k, \vec H_{k - 1} = \vec h_{k - 1}, \ P = P_2, A ] }. \end{aligned}

If we replace xkx_k by a random variable Xk∼Dik,P1X_k \sim \mathcal{D}_{i_k, P_1}, then

Ck≐ln⁡Pr⁡Yk∼Dik,P1[Yk=Xk ∣A(h⃗k−1)=ik,H⃗k−1=h⃗k−1, P=P1,A]Pr⁡Yk∼Dik,P2[Yk=Xk ∣A(h⃗k−1)=ik,H⃗k−1=h⃗k−1, P=P2,A] C_k \doteq \ln \frac{ \Pr_{Y_k \sim \mathcal{D}_{i_k, P_1} } [ Y_k = X_k \ | A(\vec h_{k - 1} ) = i_k, \vec H_{k - 1} = \vec h_{k - 1}, \ P = P_1, A ] }{ \Pr_{Y_k \sim \mathcal{D}_{i_k, P_2} } [ Y_k = X_k \ | A(\vec h_{k - 1} ) = i_k, \vec H_{k - 1} = \vec h_{k - 1}, \ P = P_2, A ] }

is a random variable. As Dik,P1\mathcal{D}_{i_k, P_1} and Dik,P2\mathcal{D}_{i_k, P_2} are (ϵ,0)(\epsilon, 0) close, we have

Ck≤ϵ. C_k \le \epsilon.

Further, we have

Fact 1. For any α∈I\alpha \in \mathcal{I}, it holds that

EX∼Dα,P1[ln⁡Pr⁡Y∼Dα,P1[Y=X]Pr⁡Y∼Dα,P2[Y=X]]=∑x∈RαPr⁡X∼Dα,P1[X=x]⋅ln⁡Pr⁡Y∼Dα,P1[Y=x]Pr⁡Y∼Dα,P2[Y=x]≤∑x∈RαPr⁡X∼Dα,P1[X=x]⋅ln⁡Pr⁡Y∼Dα,P1[Y=x]Pr⁡Y∼Dα,P2[Y=x]+∑x∈RαPr⁡X∼Dα,P2[X=x]⋅ln⁡Pr⁡Y∼Dα,P2[Y=x]Pr⁡Y∼Dα,P1[Y=x]=∑x∈Rα[Pr⁡X∼Dα,P1[X=x]−Pr⁡X∼Dα,P2[X=x]]⋅ln⁡Pr⁡Y∼Dα,P1[Y=x]Pr⁡Y∼Dα,P2[Y=x]≤(eϵ−1)ϵ \begin{aligned} \mathbb{E}_{ X \sim \mathcal{D}_{\alpha, P_1} } \left[ \ln \frac{ \underset{ Y \sim \mathcal{D}_{\alpha, P_1} }{ \Pr } [ Y = X] } { \underset{ Y \sim \mathcal{D}_{\alpha, P_2} }{ \Pr } [ Y = X] } \right] &= \sum_{x \in \mathcal{R}_\alpha } \underset{ X \sim \mathcal{D}_{\alpha, P_1} }{ \Pr } [ X = x] \cdot \ln \frac{ \underset{ Y \sim \mathcal{D}_{\alpha, P_1} }{ \Pr } [ Y = x] } { \underset{ Y \sim \mathcal{D}_{\alpha, P_2} }{ \Pr } [ Y = x] } \\ &\le \sum_{x \in \mathcal{R}_\alpha } \underset{ X \sim \mathcal{D}_{\alpha, P_1} }{ \Pr } [ X = x] \cdot \ln \frac{ \underset{ Y \sim \mathcal{D}_{\alpha, P_1} }{ \Pr } [ Y = x] } { \underset{ Y \sim \mathcal{D}_{\alpha, P_2} }{ \Pr } [ Y = x] } \\ &+ \sum_{x \in \mathcal{R}_\alpha } \underset{ X \sim \mathcal{D}_{\alpha, P_2} }{ \Pr } [ X = x] \cdot \ln \frac{ \underset{ Y \sim \mathcal{D}_{\alpha, P_2} }{ \Pr } [ Y = x] } { \underset{ Y \sim \mathcal{D}_{\alpha, P_1} }{ \Pr } [ Y = x] } \\ &= \sum_{x \in \mathcal{R}_\alpha } \left[ \underset{ X \sim \mathcal{D}_{\alpha, P_1} }{ \Pr } [ X = x] - \underset{ X \sim \mathcal{D}_{\alpha, P_2} }{ \Pr } [ X = x] \right] \cdot \ln \frac{ \underset{ Y \sim \mathcal{D}_{\alpha, P_1} }{ \Pr } [ Y = x] } { \underset{ Y \sim \mathcal{D}_{\alpha, P_2} }{ \Pr } [ Y = x] } \\ &\le (e^\epsilon - 1) \epsilon \end{aligned}

Therefore, E[Ck]≤(eϵ−1)ϵ\mathbb{E} [C_k] \le (e^\epsilon - 1) \epsilon.

Fact 2. (Azuma Inequality). Let C1,....,CnC_1, ...., C_n be random variables such that ∀k∈[n]\forall k \in [n], Pr⁡[∣Ck∣≤ϵ]=1\Pr[ |C_k| \le \epsilon ] = 1, and for every (c1,...,ck−1)∈Supp(C1,...,Ck−1)(c_1, ..., c_{k -1} ) \in \text{Supp} (C_1, ..., C_{k - 1} ), we have

E[Ci∣C1=c1,...,Ck−1=ck−1]≤β, \mathbb{E}[ C_i \mid C_1 = c_1, ..., C_{k -1} = c_{k - 1} ] \le \beta,

Then for every z>0z > 0, we have

Pr⁡[∑k=1nCi−nβ>z]≤exp⁡(−z22nϵ2) \Pr[ \sum_{k = 1}^n C_i - n \beta > z] \le \exp(- \frac{z^2}{ 2 n\epsilon^2 } )

Finally, applying Azuma Inequality with z=2nlog⁡1δ′z = \sqrt{ 2n \log \frac{1}{\delta'} } and β=(eϵ−1)ϵ\beta = (e^\epsilon - 1) \epsilon, we get the desired result.

■\blacksquare

Reference.

[1] C. Dwork and A. Roth, “The Algorithmic Foundations of Differential Privacy,” Foundations and Trends® in Theoretical Computer Science, vol. 9, no. 3–4, pp. 211–407, 2013