Given a set of nn elements SS that belongs to some finite domain X={x1,x2,...,xm}\mathcal{X}= \{ x_1, x_2, ..., x_m \}, we want to release the (normalized) histogram in a differentially private manner. Define ∀xi∈X\forall x_i \in \mathcal{X}:

  1. FS(xi)≐F_S(x_i) \doteq the number of times xix_i appears in SS;
  2. fS(xi)≐FS(xi)∣S∣=FS(xi)nf_S(x_i) \doteq \frac{F_S(x_i) }{ |S| } = \frac{F_S(x_i) }{ n }, the frequency of xix_i in SS.

The (normalized) histogram of hSh_S is a frequency vector:

hS≐<fS(x1),fS(x2),...,fS(xm)>∈Rm h_S \doteq \left< f_S(x_1), f_S(x_2), ..., f_S(x_m) \right> \in \mathbb{R}^m

Consider another set S′S' obtained by replacing an element xkx_k in SS to another element xlx_l, such that

  1. FS′(xk)=FS(xk)−1F_{S'} (x_k) = F_{S} (x_k) - 1;
  2. FS′(xl)=FS(xl)+1F_{S'} (x_l) = F_{S} (x_l) + 1;
  3. FS′(xi)=FS(xi),∀i∉{k,l}F_{S'} (x_i) = F_{S} (x_i), \forall i \notin \{k, l\}.

Let hS′h_{S'} be the histogram of S′S'. Our goal is to design some mechanism MM that adds noise to the normalized so that the output distribution of M(hS)M(h_S) and M(hS′)M(h_{S'}) are indistinguishable.

Naive Laplacian

One way is to add Laplacian noise directly to each dimension of the histogram. For any vector v∈Rmv \in \mathbb{R}^m, MM outputs a new perturbed vector:

M(v)≐v+L M(v) \doteq v + L

where L≐<l1,l2,...,lm>L \doteq \left< l_1, l_2, ..., l_m\right> and each lil_i is sampled independently from Lap(2nϵ)Lap( \frac{2 }{ n \epsilon } ).

Privacy

We claim this mechanism is (ϵ,0)(\epsilon, 0)-differentially private. For u∈Rnu \in \mathbb{R}^n, we have

p(M(hS)=u)p(M(hS′)=u)=∏i∈[m]p(fS(xi)+li=ui)∏i∈[m]p(fS′(xi)+li=ui)=∏i∈{k,l}p(fS(xi)+li=ui)∏i∈{k,l}p(fS′(xi)+li=ui)≤exp⁡(−(∣uk−fS(xk)∣−∣uk−fS′(xk)∣)nϵ2)⋅exp⁡(−(∣ul−fS(xl)∣−∣ul−fS′(xl)∣)nϵ2)≤exp⁡(∣fS(xk)−fS′(xk)∣nϵ2)⋅exp⁡(∣fS(xl)−fS′(xl)∣nϵ2)=exp⁡(1nnϵ2)⋅exp⁡(1nnϵ2)=exp⁡(ϵ). \begin{aligned} \frac{ p(M(h_S) = u) }{ p(M(h_{S'}) = u) } &= \frac{ \prod_{i \in [m] } p( f_S (x_i) + l_i = u_i) }{ \prod_{i \in [m] } p( f_{S'} (x_i) + l_i = u_i) } \\ &= \frac{ \prod_{i \in \{k, l\} } p( f_S (x_i) + l_i = u_i) }{ \prod_{i \in \{k, l\} } p( f_{S'} (x_i) + l_i = u_i) } \\ &\le \exp( - (|u_k - f_S(x_k)| - |u_k - f_{S'} (x_k) |) \frac{n\epsilon}{2} ) \\ &\quad \cdot \exp( - (|u_l - f_S(x_l)| - |u_l - f_{S'} (x_l) |) \frac{n\epsilon}{2} ) \\ &\le \exp( |f_S(x_k) - f_{S'} (x_k) | \frac{n\epsilon}{2} ) \cdot \exp( |f_S(x_l) - f_{S'} (x_l) | \frac{n\epsilon}{2} ) \\ &= \exp( \frac{1}{n} \frac{ n \epsilon}{2} ) \cdot \exp( \frac{1}{n} \frac{n\epsilon}{2} ) \\ &= \exp( \epsilon). \end{aligned}
Accuracy

We prove that ∣M(hS)−hS∣∞=O(1nϵlog⁡mδ)|M(h_S) - h_S |_\infty = O (\frac{1}{ n \epsilon } \log \frac{m}{\delta}) with probability at least 1−δ1 - \delta.

Let b=2nϵb = \frac{2 }{ n \epsilon }. For a failure probability δ\delta,

Pr⁡[∣fS(xi)+li−fS(xi)∣≥blog⁡mδ]=∫blog⁡mδ∞1bexp⁡(−x/b) dx=exp⁡(−log⁡mδ)=δm \Pr[ |f_S(x_i) + l_i - f_S(x_i) | \ge b \log \frac{m}{\delta} ] = \int_{ b \log \frac{m}{\delta} }^\infty \frac{1}{b} \exp( - x / b ) \ dx = \exp(- \log \frac{m}{\delta} ) = \frac{\delta}{m}

By union bound, it holds that

Pr⁡[∣M(hS)−hS∣∞≥blog⁡mδ]≤δ. \Pr[ |M(h_S) - h_S |_\infty \ge b \log \frac{m}{\delta} ] \le \delta.

□\square

Rounding Small Values

When ∣X∣=m≫n|\mathcal{X}| = m \gg n, we could improve the release mechanism. As shown in the previous section, we would like to achieve error O(1n)O(\frac{1}{n}). This inspire to round the small frequencies (roughly O(1n)O(\frac{1}{n})) to zero. Of course, we should carry out this in a differentially private manner.

Mechanism MM
==============================================================
INPUT: a set SS of nn elements.
OUTPUT: a histogram of SS in differentially private manner.
−−−−−−−−−−−−−−−−−−−−−−−−------------------------
For i∈[m]i \in [m] do
\qquad If fS(xi)=0f_S(x_i) = 0, then M(hS)i←0M(h_S)_i \leftarrow 0
\qquad Else
\qquad \qquad M(hS)i←fS(xi)+liM(h_S)_i \leftarrow f_S(x_i) + l_i, where li∼Lap(2nϵ)l_i \sim Lap(\frac{2}{n \epsilon} ).
\qquad \qquad If M(hS)i<1n+2log⁡2/δϵnM(h_S)_i < \frac{1}{n} +\frac{2 \log 2 / \delta }{ \epsilon n}, then M(hS)i←0M(h_S)_i \leftarrow 0.
Release M(hS)≐<M(hS)1,M(hS)2,...,M(hS)n>M(h_S) \doteq \left< M(h_S)_1, M(h_S)_2, ... , M(h_S)_n \right>
−−−−−−−−−−−−−−−−−−−−−−−−------------------------

Privacy

We claim this mechanism is (ϵ,δ)(\epsilon, \delta)-differentially private.

  • Case 1. If SS and S′S' have the same set of supports, i.e., fS(xi)>0↔fS′(xi)>0f_S(x_i) > 0 \leftrightarrow f_{S'}(x_i) > 0, then MM is (ϵ,0)(\epsilon, 0) differentially private.

  • Case 2.

    1. FS(xk)=1F_{S} (x_k) = 1, then FS′(xk)=FS(xk)−1=0F_{S'} (x_k) = F_{S} (x_k) - 1 = 0. For S′S', it is guaranteed that M(hS′)k=0M(h_{S'})_k = 0. For SS, as fS(xk)=1nf_S(x_k) = \frac{1}{n},Pr⁡[M(hS)k≠0]=Pr⁡[M(hS)k≠M(hS′)k]=δ2 \Pr[ M(h_S)_k \neq 0 ] = \Pr[ M(h_S)_k \neq M(h_{S'})_k ] = \frac{\delta}{2}
    2. FS(xl)=0F_{S} (x_l) = 0, then FS′(xl)=FS(xl)+1=1F_{S'} (x_l) = F_{S} (x_l) + 1 = 1. For SS, it is guaranteed that M(hS)k=0M(h_S)_k = 0. For S′S', by similar argument, we have Pr⁡[M(hS′)k≠0]=Pr⁡[M(hS)k≠M(hS′)k]=δ2\Pr[ M(h_{S'})_k \neq 0 ] = \Pr[ M(h_S)_k \neq M(h_{S'})_k ] = \frac{\delta}{2}.

    There are three combinations such that either FS(xk)=1F_S(x_k) = 1 or FS(xl)=0F_{S} (x_l) = 0 holds, namely

    1. FS(xk)=1,FS(xl)=0F_S(x_k) = 1, F_{S} (x_l) = 0,
    2. FS(xk)=1,FS(xl)>0F_S(x_k) = 1, F_{S} (x_l) > 0,
    3. FS(xk)>1,FS(xl)=0F_S(x_k) > 1, F_{S} (x_l) = 0.

    We give a proof for the first case. The proofs for the other two are similar. Now, for ∀\forall measurable E⊂RnE \subset \mathbb{R}^n,

    Pr⁡[M(hS)∈E]=Pr⁡[M(hS)∈E∣M(hS)k=0,M(hS′)l=0] +Pr⁡[M(hS)∈E∣M(hS)k≠0∨M(hS′)l≠0]≤Pr⁡[M(hS)∈E∣M(hS)k=0,M(hS′)l=0] +Pr⁡[M(hS)k≠0]+Pr⁡[M(hS′)l≠0]=Pr⁡[M(hS′)∈E∣M(hS)k=0,M(hS′)l=0]+δ≤Pr⁡[M(hS′)∈E]+δ \begin{aligned} \Pr[ M(h_S) \in E] &= \Pr[ M(h_S) \in E \mid M(h_S)_k = 0, M(h_{S'})_l = 0] \\ &\ + \Pr[ M(h_S) \in E \mid M(h_S)_k \neq 0 \vee M(h_{S'})_l \neq 0] \\ &\le \Pr[ M(h_S) \in E \mid M(h_S)_k = 0, M(h_{S'})_l = 0] \\ &\ + \Pr[M(h_S)_k \neq 0 ] + \Pr[ M(h_{S'})_l \neq 0] \\ &= \Pr[ M(h_{S'}) \in E \mid M(h_S)_k = 0, M(h_{S'})_l = 0] + \delta \\ &\le \Pr[ M(h_{S'}) \in E] + \delta \end{aligned}
Accuracy

We prove that ∣M(hS)−hS∣∞=O(1nϵlog⁡1δ)|M(h_S) - h_S |_\infty = O (\frac{1}{ n \epsilon } \log \frac{1}{\delta}) with probability at least 1−δ1 - \delta, if δ≤1n\delta \le \frac{1}{n}.

  1. If fS(xi)=0f_S(x_i) = 0, then there is no error.
  2. Otherwise, if M(hS)iM(h_S)_i is not truncated, with probability at most δn\frac{\delta}{n}, it ∣M(hS)i−fS(xi)∣≤2log⁡1/δnϵ|M(h_S)_i - f_S(x_i)|\le \frac{2\log 1 / \delta}{n\epsilon}. If it is truncated, this will introduce an additional error of at most 1n+2log⁡2/δϵn\frac{1}{n} +\frac{2 \log 2 / \delta }{ \epsilon n}. The overall error is at most 1n+4log⁡2/δϵn\frac{1}{n} +\frac{4 \log 2 / \delta }{ \epsilon n}, which is O(log⁡1/δϵn)O( \frac{ \log 1 / \delta }{ \epsilon n}) if ϵ≤log⁡n\epsilon \le \log n.

□\square

Reference

[1] S. Vadhan, “The Complexity of Differential Privacy,” in Tutorials on the Foundations of Cryptography, Y. Lindell, Ed. Cham: Springer International Publishing, 2017, pp. 347–450.