Anonymized Histograms in Intermediate Privacy Models
Abstract
We study the problem of privately computing the anonymized histogram (a.k.a. unattributed histogram ), which is defined as the histogram without item labels.
Previous works have provided algorithms with ℓ 1 and ℓ 22 -errors of O ε ( √ n ) in the central model of differential privacy (DP).
In this work, we provide an algorithm with a nearly matching error guarantee of (cid:101)
O ε ( √ n ) in the shuffle DP and pan-private models.
Our algorithm is very simple: it just post-processes the discrete Laplace-noised histogram!
Using this algorithm as a subroutine, we show applications in privately estimating symmetric properties of distributions such as entropy, support coverage, and support size.
Introduction
Computing histograms is among the most well-studied tasks in data analytics and machine learning.
Suppose that there is a domain [ D ] := { 1 , . . .
, D } , where the i th user’s input is z
i ∈
[ D ] .
The histogram of the users’ inputs { z 1 , . . .
z n } is defined as h :
= ( h 1 , . .
. , h D )
where h j := |{ i ∈ [ n ] | z i = j }| , i.e., the number of users who contribute item j ∈
[ D ] .
For many tasks, however, the different items themselves are not important and it instead suffices to consider the anonymized histogram (a.k.a. unattributed histogram ) corresponding to h , which is defined as n h :=
( n (1) , . . . , n ( D ) ) where n ( ℓ ) denotes the ℓ th largest element among the h j ’s.
Whenever h is clear from context, we will skip the subscript and denote the anonymized histogram as simply n .
Anonymized histograms have several applications including estimating symmetric properties of discrete distributions [11, 2, 16, 31], privately releasing the degree-distributions in social networks [34, 33, 40], and anonymizing password frequency lists [13, 14].
For more details, we refer the reader to [44] and the references therein.
In this work, we study private anonymized histograms.
The notion of privacy we study is differential privacy (DP) [24, 23], which has emerged as a very popular notion of private data analysis leading to numerous practical deployments [27, 43, 30, 8, 21, 1, 36, 41].
Multiple works have studied the problem of computing private anonymized histogram, with the focus so far being on the central model of DP.
Moreover, two measures of error have been studied: ℓ 1 -error and ℓ 22 -error 2 .
For the ℓ 22 case, Hay et al.
[34] give an ε -DP algorithm with an expected error
Defined as ∥ n − ˆ n ∥ 1 = (cid:80) j ∈
{+[ D ] | n ( j ) − ˆ n ( j ) | and ∥ n − ˆ n ∥ 
+}
=
(cid:80) j ∈ [ D ] ( n ( j ) − ˆ n ( j ) ) ˆ n of (cid:101) O ( √ n/ε 2 ) 3 .
As for the ℓ 1 -error, Blocki et al.
[13] observed that the exponential mechanism yields an expected ℓ 1 -error of O ( √ n/ε ) since there are at most exp( O ( √ n )) anonymized histograms in total [32]; recently, this bound was improved to O ( (cid:112) n log(1 /ε )
/ε ) by Suresh [44].
On the lower bound front, Alda and Simon [5] proved a bound of Ω( (cid:112) n/ε ) for the expected ℓ 1 -error; recently, this was improved to Ω( (cid:112) n log(1 /ε )
/ε ) by Manurangsi [37], matching the aforementioned upper bound of [44] to within a constant factor.
The latter lower bound also applies to ( ε, δ ) -DP algorithms for any sufficiently small δ (depending only on ε ).
The anonymized histogram problem generalizes the C OUNT -D ISTINCT problem, which asks for the number of items j such that h j > 0 .
C OUNT -D ISTINCT can be easily solved in the central DP model by applying the discrete Laplace mechanism.
In the (non-interactive) local DP setting, Chen et al.
[17] proved a lower bound of Ω ε ( n ) , which means that one cannot asymptotically beat the trivial algorithm that always outputs zero.
The strong lower bounds on the error incurred by protocols in the local setting generally motivate the study of intermediate models of privacy including the panprivate [25] and shuffle DP [12, 26, 18] models.
In these models, it turns out that C OUNT -D ISTINCT can be solved to within (cid:101)
O ε ( √ n ) -error while lower bounds of Ω ε ( √ n ) are known [38, 9].
In this work, we show that, surprisingly, the anonymized histogram problem (which seems much harder than C OUNT -D ISTINCT ) can in fact be solved with essentially the same asymptotic error of (cid:101)
O ε ( √ n ) as C OUNT -D ISTINCT , in both the pan-private and shuffle DP models.
On the other hand, the aforementioned lower bound [17] for C OUNT -D ISTINCT also implies an Ω ε ( n ) lower bound for the expected ℓ 1 -error of anonymized histogram in the more challenging local DP model.
In other words, in the typical case where ε is an absolute constant, it is impossible to achieve any asymptotic advantage over the trivial algorithm that always outputs the all-zeros histogram.
1.1 Our Results
A prominent approach for computing private histograms in the central DP model is to add discrete
Laplace noise to each histogram entry.
We show that there is a post-processing algorithm that takes such a noised histogram and produces an accurate estimate of the anonymized histogram:
Theorem 1 (Informal; Theorems 9 and 21) .
There is an algorithm that takes in a noisy histogram, where an independent discrete Laplace noise of parameter 1 /ε is added to each entry, and outputs an approximate anonymized histogram such that the expected ℓ 1 and ℓ 22 -errors are 5 (cid:101)
O ε ( √ n + D ) .
Note that there is a dependency of √ D in the error bound in Theorem 1; when the domain size is large, this can dominate the √ n term.
Fortunately, we show that this can be overcome by first randomly hashing into B buckets before computing the histogram.
By picking B to be O ( n ) , we show that one can achieve an error that is (cid:101)
O ε ( √ n ) without any dependency on D :
Theorem 2 (Informal; Corollary 13 and Theorem 22) .
There is an algorithm that takes in a noisy hashed histogram, where an independent discrete Laplace noise of parameter 1 /ε is added to each bucket after hashing, and outputs an approximate anonymized histogram such that the expected ℓ 1error is (cid:101) O ε ( √ n ) .
A similar algorithm holds, which uses two noisy hashed histograms and achieves expected ℓ 22 -error of (cid:101)
O ε ( √ n ) .
Random hashing and computing discrete Laplace-noised histograms can be implemented in the panprivate 6 and shuffle DP settings [29, 10], where in the latter case we have to concede δ > 0 in the privacy parameter.
Thus, the theorem above yields:
Corollary 3.
For any ε > 0 , δ ∈ (0 , 1] , there is an ε -DP algorithm for anonymized histogram in the pan-private model and an ( ε, δ ) -DP algorithm in the shuffle DP model, with expected ℓ 1 and ℓ 22 -errors of (cid:101)
O ε ( √ n ) .
Our results can be adapted to continuous Laplace noise [24] with only a constant factor overhead in the
We use discrete since it can be applied in the shuffle DP model (which nature)
As an immediate application of the above, we get algorithms for estimating symmetric properties of distributions; a distribution property is said to be symmetric if it remains unchanged under relabeling of the domain symbols.
For any (non-private) symmetric estimator with low sensitivity, we get a private estimator in the pan-private and shuffle DP models.
Theorem 4 (Informal;Theorem 17) .
For all ε > 0 , δ ∈ (0 , 1] , and distributions D , for any symmetric distribution property f , and any symmetric estimator ˆ f , there exists an ε -DP mechanism M in the pan-private model and an ( ε, δ ) -DP mechanism M in the shuffle DP model, such that M outputs an α -approximation to f ( D ) with high probability.
The sample complexity of the mechanism
M is given as C ˆ f ( f, α ) + D ˆ f ( α, ε ) , where the first term is the non-private sample complexity of ˆ f and the second term depends on the sensitivity of ˆ f .
In particular, in Section 5, we apply the above result to estimate the Shannon entropy, support coverage and support size of discrete distributions, which, to the best of our knowledge, is the first such sample complexity bound in the pan-private and shuffle DP models.
1.2 Overview of Techniques
We now describe the high-level ideas of our algorithms and proofs.
For ease of exposition, we will occasionally be informal; all details are formalized in later sections.
To describe our algorithm, we need definitions of prevalence and cumulative prevalence.
Definition 5 (Prevalence and Cumulative Prevalence) .
The prevalence of a histogram h is defined as φ h :=
( φ h 0 , . .
. , φ h n ) , where φ h r :=
|{ j ∈
[ D ] : h j = r }| is the number of entries with value r .
The cumulative prevalence of a histogram h is defined as φ h ≥ :
= ( φ h ≥ 1 , . .
φ h ≥ n ) , where φ h ≥ r := |{ j ∈
[ D ] : h j ≥ r }| is the number of entries with value at least r .
Prevalence and cumulative prevalence can be similarly defined for an anonymized histogram n ; note that φ h = φ n h and φ h ≥ =
φ n h ≥ .
An important property of cumulative prevalence is that it preserves the ℓ 1 -distance.
Observation 6.
For all anonymized histograms n , ˆ n , it holds that ∥ φ n ≥ − φ ˆ n ≥ ∥ 1 = ∥ n − ˆ n ∥ 1 .
We stress that, while cumulative prevalence has been used before in DP algorithms for computing anonymized histograms [44, 37], these algorithms require access to the true anonymized histogram first and therefore will only work in the central DP model.
Algorithm for ℓ 1 -error.
For each j ∈ [ D ] , using the discrete Laplace-noised count, we produce an unbiased estimate for whether h j ≥ r for each r ∈ [ n ] .
Adding these up over all j ∈ [ D ] gives an unbiased estimate for φ h ≥ r .
We then “project” the estimated φ ≥ back so that it corresponds to a valid anonymized histogram.
It can be seen that this last step can at most double the error.
While the algorithm described above is simple, it is unclear why it incurs an error of (cid:101)
O ε ( √ n + D ) .
The analysis turns out to be quite delicate.
The key is that the unbiased estimator we use has variance that decreases exponentially with | h j − r | .
(In other words, the uncertainty is high only when h j is close to r .)
Roughly speaking, this means that the total error is dominated by the error in the case where h j = r .
Suppose for simplicity that we only focus on this case.
Since there are φ h r entries satisfying the condition, the expected ℓ 1 -error for φ ≥ r will be (cid:101)
O ε ( (cid:112) φ h r ) .
Thus, in total, the ℓ 1 -error of the estimated cumulative prevalence is dominated by (cid:101)
O ε ( (cid:80) r ∈ [ n ] (cid:112) φ h r ) .
We can now apply the Cauchy–Schwarz inequality to yield (cid:80) r ∈ [ n ] (cid:112) φ h r ≤ (cid:113)(cid:80) r ∈
[ n ] 1 /r · (cid:113)(cid:80) r ∈ [ n ] r · φ h r = Θ( √ n log n ) , where the last equality follows from the fact that (cid:80) r ∈ [ n ] r · φ h r is simply the total counts in the histogram. This concludes our proof sketch.
The full proof can be found in Section 3.
Handling Large Domain Sizes.
When D ≫ n , we randomly hash into B = (cid:101)
O ( n ) buckets and compute the noisy “reduced” histogram on these B buckets.
We can use our approach above to compute the anonymized histogram on these B buckets with ℓ 1 -error at most (cid:101)
O ε ( √ n ) .
While this is a reasonable approach, it does not yet give a good estimate for the original anonymized histogram: the reason is that there could be as many as (cid:101) Ω( n ) collisions due to hashing.
To handle this, we define a function that “inverts” the reduced anonymized histogram to the original anonymized histogram.
We then show that (i) this inverse has “sensitivity” O (1) and (ii) the reduced histogram is concentrated around its mean with an ℓ 1 -deviation of (cid:101) O ( √ n ) .
Combining these two allows us to conclude that the inverse of the noisy anonymized histogram has expected ℓ 1 -error of (cid:101) O ε ( √ n ) as desired.
See
Section 4 for details.
Privately Computing Symmetric Properties of Distributions.
A large body of work starting with [2] has shown that plug-in estimators using the so-called profile maximum likelihood (PML) distribution achieve nearly optimal sample complexity for many symmetric distribution properties.
At the core of these works is an important fact that many symmetric distribution properties have estimators (based on the anonymized histogram) with low sensitivity.
Our algorithms then apply these estimators on our private anonymized histogram.
The sensitivity of the estimator, together with the ℓ 1 -error bound we have shown for our anonymized histogram, immediately yield bounds on the errors of the estimators.
See Section 5 for details.
Algorithm for ℓ 22 -error.
Adapting the algorithm for ℓ 22 -error proceeds as follows: recall (e.g., by
H¨older’s inequality) that ∥ n − ˆ n ∥ 22 ≤ ∥ n − ˆ n ∥ 1 · ∥ n − ˆ n ∥ ∞ .
Notice also that the concentration of the noise implies that each discrete Laplace-noised count is within O (log D/ε ) of the true value.
Due to this, we may only change the last (i.e., “projection”) step by adding an extra constraint that each entry of the output estimated anonymized histogram is within O (log D/ε ) of the corresponding entry of the noisy histogram.
This way we have ensured that ∥ n − ˆ n ∥ ∞ ≤ O (log D/ε ) .
Combining this with our earlier bound on the expected ℓ 1 -error immediately yields the desired bound on the ℓ 22 -error.
See Appendix B for details.
1.3 Other Related Work
The original paper on the pan-private model [25] also studies the problem of estimating φ n r .
However, their focus is on algorithms with small space complexity, and, if one were to sum up their error bounds for all r directly, it would yield a trivial bound of Ω( n ) on the total error in the anonymized histogram.
Several recent works have studied the testing/estimation/learning of symmetric and other properties of distributions under privacy constraints, mostly in the central DP model [3, 4, 6, 15, 20, 35] and some in the local DP model [22].
In particular, Acharya et al.
[3] study privately computing symmetric distribution properties in the central model.
Indeed, they also exploit the fact that the estimators have low sensitivity.
However, in the central DP model, low sensitivity allows one to get a private estimate by adding Laplace noise directly to the non-private estimate, whereas we need to compute the estimator from our approximate anonymized histogram.
Differential Privacy
In this section, we review the basics of differential privacy (DP) and the shuffle DP and the panprivate models.
Let [ n ] denote the set { 1 , . . . , n } and let 1 [ · ] denote the binary indicator function.
Two datasets S = { z 1 , . . . , z n } and S ′ =
{ z ′ 1 , . . .
, z ′ n } are said to be neighboring , denoted S ∼ S ′ , if there is an index i ∈ [ n ] such that z
j = z ′ j for all j ∈ [ n ] \ { i } .
We recall the following definition [24, 23]:
Definition 7 (Differential Privacy (DP)) .
Let ε > 0 and δ ∈
A randomized algorithm M :
Z n → R is ( ε, δ ) -differentially private ( ( ε, δ ) -DP ) if, for all S ∼ S ′ and all (measurable) outcomes
E ⊆ R , we have that Pr[ M ( S ) ∈ E ] ≤ e ε · Pr[ M ( S ′ )
∈ E ] + δ .
We denote ( ε, 0) -DP as ε -DP or pure -DP.
The case when δ > 0 is referred to as approximate -DP.
In the central DP model, all the inputs are stored and processed by an analyzer and the privacy is enforced only on the output of the analyzer.
Shuffle DP [12, 26, 18].
In the shuffle DP model, there are three algorithms, namely, a local randomizer R , a shuffler S , and an analyzer A .
Let S
= { z 1 , . .
, z n } be the input dataset.
The randomizer R takes z ∈ S as input and outputs a multiset of messages.
The shuffler S takes the multiset of messages obtained from R applied to each z ∈ S and permutes them randomly.
The analyzer A takes this permuted multiset and computes the final output.
The privacy in the shuffle model is enforced on the output of the shuffler S , when a single input is changed.
Pan-privacy [25].
In the pan-private model, there is an algorithm that takes in a data stream of unbounded length consisting of elements in the domain.
It is required that the internal state of the algorithm after any number of steps satisfies ε -DP over the data stream prefix until that step.
We consider two data streams to be neighboring iff they differ by a single entry.
This is sometimes referred to as the “event-level” or “record-level” setting [7], in contrast to the “user-level” setting which was the focus of the original work on pan-privacy [25].
We remark that the “user-level” setting is not appropriate for our notions of error as it allows for changing an entry of the histogram arbitrarily, meaning that we cannot achieve any non-trivial error guarantees.
Furthermore, our definition above (which allows us to directly implements discrete Laplace-noised histogram) is different from the origin definition in [25], because the latter requires that revealing both the internal state and the final output simultaneously is DP. Nonetheless, our algorithm can be easily adapted for this more restricted model, but with a worse dependency on ε . We explain this in more detail in Appendix E. Histograms in Central DP.
For a distribution D , let x ∼ D denote that the random variable x is chosen from D .
For p ∈ (0 , 1) , the discrete Laplace distribution (aka symmetric geometric distribution), denoted by DLap( p ) , is the distribution supported on Z whose probability mass at i ∈
Z is 1 − p 1+ p · p | i | .
We use the following well-known fact about central DP and histograms.
Fact 8.
The algorithm that adds DLap( e − ε/ 2 ) noise to each entry of a histogram is ε -DP in the central model.
We refer to the output of this algorithm as the discrete Laplace-noised histogram.
For a histogram h , we use n h to denote the anonymized histogram corresponding to h , often dropping the subscript whenever h is clear from context.
Post-Processing Noised Histogram
In this section we describe our main algorithm, which obtains an anonymized histogram by suitably post-processing a noised histogram.
We first define the following function f : Z → R , which is used in our post-processing method described in Algorithm 1.
[Equation]
Input: Discrete Laplace-noised , h j h
+ DLap( ) for r ∈ [ n ] do ˆ φ ≥ r ← (cid:80) j ∈
[ D ] f ( h ′ j − r ) , where f is defined in (1) return ˆ n that minimizes ∥
φ ˆ n ≥ − ˆ φ ≥ ∥ 1 .
We give an efficient implementation of the above algorithm in Algorithm 5 (Appendix D.1), which runs in time O
( D + n log n ) .
The main idea is to compute ˆ n that minimizes ∥
φ ˆ n ≥ − ˆ φ ≥ ∥ 1 using ℓ 1 -isotonic regression.
We now state the main guarantee of the post-processing method.
Theorem 9.
For all histograms h with ∥ h ∥ 1 = n , the estimate ˆ n returned by Algorithm 1 satisfies
[Equation]
where, C p :=
p 2 (1 − p ) 5 + p 1 − p .
From Fact 8, for ε -DP, we may set p =
e − ε/ 2 .
Theorem 9 then gives a bound of
O ( (cid:112) ( n + D ) log n/ε 2 . 5 ) on the expected ℓ 1 -error.
The crucial result needed in our analysis is the guarantee of the individual estimator f .
We show that f ( h ′ j − r ) is an unbiased estimator of 1 [ h j ≥ r ] and furthermore its variance decreases (exponentially) as | h j − r | increases.
Lemma 10.
For all h, r ∈ N ∪ { 0 } , if h ′ ∼ h + DLap( p ) , then it holds that [Equation] and
[Equation]
Proof.
Let τ := h − r, τ ′ :
= h ′ − r , and x := p/ (1 − p ) 2 .
Consider g : Z → R defined by g ( m ) :
= f ( m ) − 1 / 2 .
Notice that (2) is equivalent to E
[ g ( τ ′ )]
= 1 [ τ ≥ 0] − 1 / 2 .
Due to symmetry, it suffices to consider the case where τ ≥ 0 .
In this case, we have
E [ g ( τ ′ )]
= E Z ∼ DLap( p ) [ g ( τ + Z )] = Pr[ Z > − τ ] · (1 / 2) + Pr[ Z ≤ − τ ] · E [ g ( τ + Z ) | Z ≤ − τ ] .
The last term can be expanded as follows:
[Equation]
Combining the two equations above, we arrive at E [ g ( τ ′ )]
=
Pr[ Z > − τ ] · (1 / 2) + Pr[ Z ≤ − τ ] · (1 / 2) = 1 / 2 , thereby proving (2).
To prove (3), notice again that Var[ f ( τ ′ )]
=
Var[ g ( τ ′ )] .
Again, due to symmetry, we may only consider the case τ ≥ 0 .
Here, we have
[Equation]
[Equation]
∼ DLap
[Equation]
Similar to before, we can expand the last term as
[Equation]
Plugging this into the above, we get Var[ g ( τ ′ )] {+≤ 4 p τ +
+}
( p/ (1 − p )
+ (1 − p )) as desired.
The following is an immediate consequence of Lemma 10, by summing over all j ∈ [ D ] .
Observation 11.
For all r ∈ [ n ] , and κ := 4 p (cid:16) p (1 − p ) 3 + (1 − p ) (cid:17) it holds that
[Equation]
and
[Equation]
Proof of Theorem 9.
The expected ℓ 1 -error is bounded as
[Equation]
[Equation] where we use that ∥ φ ˆ n ≥ − ˆ φ ≥ ∥ 1 ≤ ∥ ˆ φ ≥ − φ n ≥ ∥ 1 by our choice of ˆ n .
From Observation
[Equation]
we have
[Equation]
Combining this with (4), we have
[Equation]
Reducing Domain Size via Hashing
In this section we propose an algorithm to handle the case where D ≫ n .
The approach in this case is to hash the domain into something smaller.
Let B ∈
N be the number of hash values.
The distribution of the anonymized histogram produced after random hashing into B buckets is equivalent to the following process: ▶ Let n = ( n (1) , . . . , n ( D ) ) be the starting anonymized histogram.
▶ Pick a uniformly random hash function H :
[ D ] → [ B ] .
▶ Let h red :
= ( h red1 , . .
. , h red B ) denote the reduced histogram given by h red i
[Equation]
n [Equation]
▶ Let n red denote the corresponding anonymized histogram.
Let Γ B be the mapping from n to E [ φ n red ≥ ] where n red is generated as above, and the expectation is over the choice of random hash functions H .
With this notation, we present Algorithm 2.
{+Algorithm 
 Anonymized Histogram Estimator w.r.t. ℓ 1 loss, for large domains. Input: Discrete Laplace-noised histogram ˜ h red , i.e., ˜ h red j+} ∼ h red j + DLap( p )
Compute an estimate ˆ n red of n red using Algorithmreturn ˆ n that minimizes ∥ Γ B ( ˆ n ) − φ ˆ n red ≥ ∥ 1 , s.t.
∥ ˆ n ∥ 1 = n
We give an efficient implementation of (a variant of) the above algorithm in Algorithm 7 (Appendix D.2), which runs in time (cid:101)
O ε ( D + n log n ) .
The main result of this section is the following:
Theorem 12.
For all B > 4 n and histograms h with ∥ h ∥ 1 ≤ n , the estimate ˆ n returned by
Algorithm 2 satisfies
[Equation]
(using Theorem 9).
By setting B = n √ log n , we get the following corollary.
Corollary 13.
For all 0 < ε ≤ O (1) , Algorithm 2 for p =
e − ε/ 2 and B = n √ log n is an ε -DP algorithm, and achieves an expected ℓ 1 -error of E ( n, ε ) =
O ( √ n (log n ) 3 / 4 /ε 2 . 5 ) .
We describe the main steps in the proof of Theorem 12.
Lipschitzness of Inverse of Γ B .
We start by showing that the “inverse” of Γ B is O (1) -Lipschitz:
Lemma 14.
[Proof in Appendix A.1] For B > 4 n and all anonymized histograms n , n ′ with ∥ n ∥ 1 , ∥ n ′ ∥ 1 ≤ n ,
[Equation]
Concentration of n red .
We now bound the expected ℓ 1 -distance between φ n red ≥ and its expectation Γ B ( n ) .
Lemma 15.
Assume that B ≥ 2 n .
Then, E [ ∥ φ n red ≥
[Equation]
Proof.
We have
[Equation]
We next use the following bound on the variance.
Lemma 16.
[Proof in Appendix A.2]
For all r ∈ [ n ] , Var
[Equation]
φ n red
[Equation]
[Equation]
Plugging Lemma 16 into (5), we have
[Equation]
(Cauchy–Schwarz)
[Equation]
Putting things together.
With all the components ready
[Equation]
we can now prove Theorem
[Equation]
Proof of Theorem 12.
By Lemma
[Equation]
we have
[Equation]
( By [Equation] (cid:17) ≤ O ( E [ ∥ n red − ˆ n red ∥ 1 ] + n log n/ √ B ) ( From Lemma 15 ) .
Estimating Symmetric Properties of Discrete Distributions
In this section we show how to use Theorem 12 for the task of estimating symmetric properties of discrete distributions over [ k ] .
Here, a distribution property is symmetric if it remains unchanged under relabeling of the domain symbols.
For example, a notable such property is the Shannon entropy of a distribution D defined as H ( D ) :
= (cid:80) x D ( x ) log 1 D ( x ) , a central object in information theory, machine learning, and statistics.
If the support is unbounded, estimating H ( D ) is impossible with any finite number of samples.
Our goal is to estimate the entropy of a distribution D ∈ ∆ k
up to an additive ± α error, where ∆ k denotes the set of all distributions over [ k ] .
One of the key ideas in the literature (e.g., [3]) is to design low sensitivity estimators ˆ f : X n → R for the desired symmetric distribution property f :
∆ k
→ R .
The (non-private) sample complexity of a property f : ∆ k
→ R using estimator ˆ f , denoted by C ˆ f ( f, α ) , is the smallest number of samples n needed to estimate f ( D ) upto accuracy α with probability at least 0 .
9 , that is, Pr[ | ˆ f ( S ) − f ( D ) | > α ] < 0 .
The sensitivity of an estimator ˆ f is ∆ n, ˆ f , which is the smallest value for which it holds for adjacent datasets S ∼ S ′ each with n elements, that | ˆ f ( S ) − ˆ f ( S ′ )
| ≤ ∆ n, ˆ f .
Let
D ˆ f ( α, ε ) :
= min { n | ∆ n, ˆ f ≤ 0 .
1 α/E ( n, ε ) } , for E ( n, ε ) defined in Corollary 13.
We will only consider symmetric estimators ˆ f , for which we will abuse notation to use ˆ f ( n ) to denote ˆ f ( S ) for any dataset S that corresponds to the anonymized histogram n .
Theorem 17.
For all 0 < ε ≤ O (1) , δ ∈ (0 , 1] , for any symmetric distribution property f , and any symmetric estimator ˆ f , there exists an ε -DP mechanism in the pan-private model and ( ε, δ ) -DP mechanism in the shuffle DP model, such that Pr S ∼D n [ |M ( S )
− f
( D ) | > α ] < 0 .
2 with sample complexity
[Equation]
Proof.
Let n denote the anonymized histogram corresponding to the sampled dataset S .
The mechanism M simply outputs ˆ f ( ˆ n ) for ˆ n returned by Algorithm 2.
Clearly the mechanism M is DP due to the post-processing property.
We have that for a suitable n = O (cid:16) C ˆ f (cid:0) f, α 2 (cid:1) + D ˆ f (cid:0) α 2 , ε (cid:1)(cid:17) , it holds that
[Equation]
and
[Equation]
where the first inequality holds by definition of C ˆ f ( f, α/ 2) , and the second inequality holds because | ˆ f ( ˆ n ) − ˆ f ( n ) | ≤ ∆ n, ˆ f · ∥ ˆ n − n ∥ 1 and by the guarantee of Theorem 12 and Markov’s inequality
Pr[ ∥ ˆ n − n ∥ 1 > 10 E ( n, ε )] ≤ 0 .
By a union bound, we have Pr[ | ˆ f ( ˆ n ) − ˆ f ( n ) | > α ] ≤ 0 . 44 .
We get the following sample complexity bounds for private estimation of Shannon entropy in the pan-private and shuffle DP models, as an immediate application of Theorem 17.
Corollary 18 (Proof in Appendix C) .
For all 0 < ε ≤ O (1) , δ ∈ (0 , 1] , there exists an ε -DP mechanism in the pan-private model and ( ε, δ ) -DP mechanism in the shuffle DP model, that can estimate the entropy of D ∈ ∆ k
up to an additive error of ± α with a sample complexity of min
[Equation]
These bounds have the same dependence on k as in the work of Acharya et al.
The dependence on α and ε is slightly worse due to a higher cost of sensitivity in our setting, and the worse dependence on ε in our guarantees in Corollary 13.
We also derive sample complexity bounds for private estimation of support coverage and support size .
The support coverage of a distribution D and an integer m is defined as S m ( D ) :
= (cid:80) x ∈ supp( D ) (1 − (1 − D ( x )) m ) , i.e., the expected number of distinct elements seen if we draw m i.i.d.
samples from D .
Here we would like to estimate S m ( D ) to within an additive error of ± αm .
The support size of a discrete distribution D is the number of atoms x such that D ( x ) > 0 .
In general, this is impossible with finite sample since some atom of D might have an arbritrarily small probability mass.
To avoid this, we follow prior work and consider only probability distributions in ∆ ≥ 1 /K :
= {D | ∀ x ∈ supp( D ) , D ( x ) ≥ 1 /K } , i.e., those with non-zero mass of at least 1 /K at every atom, for some K .
We defer the details of the exact sample complexity bounds and the proofs to Appendix C.
Conclusions and Future Directions
In this paper, we give simple algorithms for privately computing anonymized histograms.
Our algorithms can be implemented in the shuffle and pan-private models.
There are several immediate open questions as discussed below.
Our upper bounds have a dependency of O (1 /ε 2 . 5 ) in the ℓ 1 -error case and O (1 /ε 3 . 5 ) in the ℓ 22error case; it is unclear if these are tight.
Similarly, there is a lower order multiplicative term of
O (log n ) and O (log 2 n ) in our ℓ 1 and ℓ 22 -error bounds respectively.
Closing these gaps would be an interesting next step; these would also lead to improvements to the sample complexity bounds on private estimation of symmetric distribution properties, such as the Shannon entropy (Corollary 18).
While our analysis of the large domain case relies on the hash function being uniformly random, it is conceivable that this is not required for the approach to work.
It will be interesting if this approach, perhaps with some modifications, can also work with a weaker family of hash functions such as a pairwise independent hash family.
Note also that our shuffle DP algorithm has δ > 0 , i.e., approximate-DP.
This may not be necessary: there are a couple of recent algorithms for computing histogram shuffle DP =[-
-]
Our post-processing approach does not immediately apply to these algorithms because the noise to each count is not a discrete Laplace noise (and in fact is not even an independent additive noise).
Adapting our approach to their setting is another interesting research direction.
A Missing Proofs from SectionA.1 Proof of Lemma
Lemma 14.
[Proof in Appendix A.1] For B > 4 n and all anonymized histograms n , n ′ with ∥ n ∥ 1 , ∥ n ′ ∥ 1 ≤ n ,
[Equation]
We start with the following observation that Γ B ( n ) ℓ := E [ φ n red ≥ ℓ ] only depends on φ n ≥ 1 , . .
, φ n ≥ ℓ .
This is simply because changing an entry of value at least ℓ to some other value at least ℓ does not change whether, after hashing, the corresponding hash bucket exceeds ℓ .
Observation 19.
Γ B ( n ) ℓ does not depend on φ n ≥ r for any r > ℓ .
Before can prove Lemma 14, we will also need to show the following lemma, which is even stronger than Lipschitzness.
Lemma 20.
Let ¯ n , ˜ n be anonymized histograms such that ∥ ˜ n − ¯ n ∥ 1 = 1 , ∥ ¯ n ∥ 1 = n , ∥ ˜ n ∥ 1 = n +1 , and r ∈ [ n ] be such that φ ˜ n ≥ r = φ ¯ n ≥ r + 1 .
Then, we have ▶ Γ
[Equation]
for all
[Equation]
< r
[Equation]
▶
[Equation]
≥
[Equation]
− n [Equation] B
[Equation]
▶ [Equation] < [Equation]
B [Equation] Specifically, these also imply that ∥ Γ B ( ˜ n ) − Γ B ( ¯ n ) ∥ 1 ≤ 1 .
Proof.
Let ¯ n red and ˜ n red be the random variables as defined at the beginning of Section 4, but with starting anonymized histograms ¯ n , ˜ n respectively.
Furthermore, let j be the entry such that ˜ n ( j ) =
¯ n ( j ) + 1 .
Recall that H is our random hash function.
Consider ¯ n red ( H ) and ˜ n red ( H ) resulting from the same hash function H .
By definition, we have Γ B ( ˜ n ) − Γ B ( ¯ n ) =
E H [ φ ˜ n red ( H ) ≥ − φ ¯ n red ( H ) ≥ ] .
Furthermore, we have φ ˜ n red ( H ) ≥ − φ ¯ n red ( H ) ≥ = 1 ˜ n red H ( j ) , where ˜ n red H ( j ) is the value of the bucket H ( j ) to which j gets hashed.
Note that with probability at least 1 − n/B , there is no collision with j and therefore ˜ n red H ( j )
= r .
Otherwise, with probability at most n/B , there is a collision and ˜ n red H ( j ) > r .
This implies the desired bounds.
We are now ready to prove Lemma 14.
Proof of Lemma 14.
Let n min be such that φ n min ≥ r = min { φ n ≥ r , φ n ′ ≥ r } for all r ∈ N .
Note that ∥ n
[Equation]
∥ n
[Equation]
n ′ ∥ 1 .
Assume w.l.o.g. that ∥ n min − n ∥ 1 ≥ ∥ n min − n ′ ∥ 1 .
The previous inequality implies that ∥ n min − n ∥ 1 ≥ ∥ n − n ′ ∥ 1 / 2 .
Now, let S :
= { r | φ n ≥ r > φ n min ≥ r } .
Consider the following hybrids for j = 0 , . .
. , n : let n j be such that φ n j ≥ =
( φ n ≥ 1 , . . φ n ≥ j , φ n min ≥ j +1 , .
φ n min ≥ n ) .
By Lemma 20 and the definition of S , we have
[Equation]
since ∥ n min ∥ 1 ≤ ∥ n ∥ 1 ≤ n .
By summing the above over all j = 0 , . . . , n − 1 , we have (cid:88)
[Equation]
Similarly, we can consider the following hybrids for j = 0 , . . .
, n : let n ′ j be such that φ n ′ j ≥ =
( φ n ′ ≥ 1 , . .
. , φ n ′ ≥ j , φ n min ≥ j +1 , . .
, φ n min ≥ n ) .
By Lemma 20 and the definition of S (which implies that φ n ′ ≥
[Equation]
=
[Equation]
for all r ∈ S ), we have
[Equation]
Again, by summing the above over all j = 0 , . . . , n − 1 , we have
[Equation]
Subtracting (7) from (6), we complete the proof as follows:
[Equation]
A.2 Proof of Lemma
Lemma 16.
[Proof in Appendix A.2]
For all r ∈ [ n ] , Var[ φ n red ≥ r ]
[Equation]
[Equation]
Proof of Lemma 16.
Note that φ n red ≥ r is the number of hash buckets whose total value is at least r .
Let X denote the number of hash buckets whose maximum value hashed to it is at least r , i.e.,
X := |{ i ∈ [ B ] | max j ∈ H − 1 ( i ) n ( j ) ≥ r }| .
Furthermore, for t ∈ [ r − 1] , let Y t denote the number of buckets whose total value is at least r and the maximum value hashed to it is equal to t , i.e., Y t := |{ i ∈ [ B ] | max j ∈ H −
[Equation]
It is easy to see that X, Y 1 , . . .
, Y r − 1 are negatively correlated.
Therefore,
[Equation]
We will next bound each term in the RHS above.
Bounding Var[ X ] .
To bound Var[ X ] , further note that X
= φ n ≥ r − (cid:80) i ∈
[ B ] Z i where Z i :=
max { 0 , |{ j ∈ H − 1 ( i ) | n ( j ) ≥ r }| − 1 } .
It is again easy to see that Z i ’s are negatively correlated.
Therefore,
[Equation]
It is also easy to verify that, for any k ∈ N , Pr[ Z i
[Equation]
k ]
[Equation]
( φ n ≥ r /B )
k +1 /
( k + 1)! .
Therefore, we have
[Equation]
Plugging this back into the previous inequality, we have
[Equation]
Bounding Var[ Y t ] .
We may write Y t as (cid:80) i ∈
[ B ] W i where W i := 1 [max j ∈ H − 1 ( i ) n ( j )
=
t, (cid:80) j ∈ H − 1 ( i ) n ( j ) ≥ r ] .
Again, the W i ’s are negatively correlated.
Therefore, we have
Var
[Equation]
where the last inequality uses the fact that W i is a Bernoulli r.v.
For each t , let S t ⊆
N denote the set of indices j for which n ( j )
=
t .
Furthermore, let S ≤ t :=
S 1 ∪ · · · ∪ S t .
Notice that
[Equation]
and (cid:88) j ∈
[Equation]
( i ) [Equation] ( j ) [Equation]
 [Equation] 
[Equation]
max j
[Equation]
H − 1 ( i ) n ( j ) =
t and (cid:88) j ∈ H − 1 ( i ) ∩ S ≤ t n ( j ) ≥ r   =
Pr  
∃ j ∗ ∈ S t s.t H ( j ∗ )
=
i and (cid:88) j ∈ H − 1 ( i ) ∩ S ≤ t n ( j ) ≥ r   ( Union bound ) ≤ (cid:88)
j ∗ ∈ S t
Pr  
H ( j ∗ )
=
i and (cid:88) j ∈ H − 1 ( i ) ∩ S ≤ t n ( j ) ≥ r   = (cid:88)
j ∗ ∈ S t
Pr  
H ( j ∗ )
=
i and (cid:88) j ∈ H − 1 ( i ) ∩ ( S ≤ t \{ j ∗ } ) n ( j ) ≥
[Equation]
( Independence of hash values ) =
[Equation]
where U j denote the indicator
[ H ( j ) = i ] [Equation]
We will next bound the last term based on two cases: ▶ Case I: t ≥ r/ 2 .
Note that
[Equation] Therefore
[Equation]
we may apply Markov’s inequality to get Pr
[Equation]
where the latter inequality follows from t ≥ r/ 2 .
▶ Case II: t < r/ 2 .
Since U j ’s are independent, we can also compute the variance of the sum as
[Equation]
Note also that we have r − t − n/B > ( r − t ) / 2 ≥ r/ 4 , where we used t < r/ 2 .
We may now apply Chebyshev’s inequality to get
[Equation]
Therefore, in both cases, we have Pr (cid:104)(cid:80) j ∈ S ≤ t n ( j ) · U j ≥ r − t (cid:105) ≤ 16 nB · tn − t .
Combining this with (8) and (9), we get
[Equation]
By summing up our bounds on X and Y t ’s, we arrive at the desired bound
[Equation]
B Extension to ℓ 22 -error
A different error measure used in [34] is the ℓ 22 -error, defined as ∥ n − ˆ n [-(cid:107) 
-]∥ 22 = (cid:80)
j ∈
[ D ] ( n ( j ) − ˆ n ( j ) ) 2 .
In this section, we show the flexibility of our method by showing that we can get an error of (cid:101)
O ε ( √ n ) , nearly matching that of [34].
B.1 Small Domain Case
We start with the setting D ≤ (cid:101) O ( n ) which does not require hashing.
The idea is to constrain our estimate anonymized histogram such that the ℓ ∞ -distance from the discrete Laplace-noised histogram is not too large.
A full description is presented in Algorithm 3.
{+Algorithm 
 Anonymized Histogram Estimator w.r.t. ℓ 22 loss.+} Input: Discrete Laplace-noised histogram h ′ , i.e., h ′ j ∼ h
j + DLap( p )
Parameter: γ = 10 log(2 nD ) / log(1 /p ) for r ∈ [ n ] do ˆ
φ ≥ r ← (cid:80) j ∈ [ D ] f ( h ′ j − r ) , where f is defined in (1) return ˆ n that minimizes ∥ φ ˆ n ≥ − ˆ φ ≥ ∥ 1 subject to ∥ n h ′ − ˆ n ∥ ∞ ≤ γ and ∥ ˆ n ∥ 1 = n .
(If no such ˆ n exists, output the all-zeros histogram.)
Theorem 21.
Let ˆ n be the output of Algorithm 3.
We have
[Equation]
Plugging in p =
e − ε/ 2 (sufficient for ε -DP), we have the bound of O ( (cid:112) ( n + D ) log n · log( nD ) /ε 3 . 5 ) for ε ≤ 1 .
Proof.
First, the standard concentration of the noise implies that
[Equation]
We thus have
[Equation]
Now, recall that ∥ n − ˆ n ∥ 22 ≤ ∥ n − ˆ n ∥ ∞ · ∥ n − ˆ n ∥ 1 .
Plugging this into the above
[Equation]
we get
[Equation]
where the second inequality follows from the constraint on ˆ n and the last inequality follows from our analysis in the ℓ 1 -error case (Theorem 9)
[Equation]
B.2 Large Domain Case
We next move on to the case D ≫ n , which will require random hashing.
B.2.1 Barrier to Extending to the ℓ 22 -error
It turns out that, unlike the ℓ 1 -error case, using a single noisy hashed histogram with B = (cid:101) O ( n ) is not sufficient for us to get (cid:101) O ( √ n ) ℓ 22 -error.
Before we provide the fix for this, let us briefly sketch why this is the case.
Let c = ⌈ 10 √ B ⌉ and q = ⌊ n/c ⌋ .
Consider the following two datasets (before hashing):
▶ There are c items, each with value q .
▶ There are c − 2 items each with value q and one additional item with value 2 q .
It is not hard to see (from birthday paradox) that, after randomly hashing into B buckets, it is impossible to distinguish the two cases with advantage more than 0.1 (even without any discrete
Laplace noise).
This implies that the expected ℓ 22 -error must be at least Ω( q 2 ) =
Ω( n 2 /B ) .
For
B = (cid:101) O ( n ) , this is at least (cid:101) Ω( n ) .
B.2.2 Two-Hash Approach
We now sketch an approach for large D .
Here we would use two hashes.
The first is with B 1 = (cid:101) O ( n ) buckets similar to before and but the second with a much larger, say, B
= O ( n 4 ) buckets.
We then use the ℓ 1 approach on the first hash with the additional ℓ ∞ constraint on the second hash.
The main point here is that w.h.p.
there would be no collision at all in the second hash; therefore, the ℓ ∞ constraint will be valid.
A similar analysis to the small domain case shows that this only adds
O ε (log n ) multiplicative overhead on the expected ℓ 22 -error (compared to the ℓ 1 -error).
More precisely, our approach is presented in Algorithm 4.
Theorem 22.
Let ˆ n be the output of Algorithm 4.
We have
[Equation]
Plugging in p = e − ε/ 4 (sufficient for ε -DP), B 1 = n √ log n and B 2 = n 4 , we have the bound of O ( √ n (log n ) 7 / 4 /ε 3 . 5 ) for ε ≤ 1 .
Parameter: γ = 10 log(2 nB 2 ) / log(1 /p )
Compute an estimate ˆ n 1 by running Algorithm 2 on ˜ h 1 .
return ˆ n that minimizes ∥ ˆ n − ˆ n 1 ∥ 1 subject to ∥ n ˜ h 2 , red − ˆ n ∥ ∞ ≤ γ and ∥ ˆ n ∥ 1 = n .
(If no such ˆ n exists, just output the all-zero histogram.)
Proof.
The probability that there is any collision in the second hash is at most n 2 /B 2 .
Furthermore, standard concentration inequality of the noise implies that the noise added to any of h 2 , red j is greater than γ is at most 0 .
1 /n 2 .
Therefore, by a union bound, we have
[Equation]
The remaining analysis is now similar to that of Theorem 21.
Specifically, we have
E
[Equation]
where the last inequality follows from Theorem 12.
C Missing Proof from Section
In this section, we prove sample complexity bounds for estimating symmetric distribution properties.
In addition to entropy (Corollary 18), we also show sample complexity bounds for support coverage (Corollary 23) and support size (Corollary 24).
C.1 Entropy
Proof of Theorem 17.
Acharya et al.
[3] consider two estimators for entropy estimation.
▶
The first estimator ˆ H they study is the entropy of the empirical distribution.
This has a nonprivate sample complexity of C ˆ H ( H, α ) =
O (cid:16) kα + log 2 k α 2 (cid:17) .
The sensitivity of this estimator is
O (log n/n ) .
Thus, we have D ˆ H ( α, ε ) is the smallest n that satisfies [Equation] ε [Equation]
≲ α.
And so, D ˆ H ( α, ε ) ≤ O ( log 3 . 5 (1 / ( αε ))
α 2 ε) .
Thus, plugging this into Theorem 17 gives rise to a sample complexity of O (cid:16)
[Equation]
▶
The second estimator ˆ H they study is based on the prior work of [2], which for any λ ∈ (0 , 1) has a non-private sample complexity of C ˆ H ( H, α ) =
O (cid:16) k
[Equation]
k
[Equation]
[Equation]
The sensitivity of this estimator is 1 /n 1 − λ .
Thus, we have D ˆ H ( α, ε ) is the smallest n that satisfies n 1 − λ · √ n (log n ) 3 /ε 2 .≲
α.
And so, D
[Equation]
Thus, plugging this into Theorem 17 gives rise to a sample complexity of O
[Equation]
C.2 Support Coverage
The support coverage of a distribution D and an integer m is defined as S m ( D ) :
= (cid:80) x ∈ supp
( D ) (1 − (1 − D ( x )) m ) , i.e., the expected number of distinct elements seen if we draw m i.i.d.
samples from
D .
Here we would like to estimate S m ( D ) to within an additive error of ± αm .
Our bounds are stated below.
Note that, in the case of large m , our sample complexity is asymptotically the same as that of [3] but our dependency on α, ε is worse in the case of smaller m .
Corollary 23 (Support Coverage) .
For all 0 < ε ≤ O (1) , δ ∈ (0 , 1] , there exists an ( ε, δ ) -DP mechanism, in the pan-private and shuffle DP models, that can estimate S m ( D ) up to an additive error of ± αm with a sample complexity of
[Equation]
Proof.
Throughout the proof, it will be simpler to think of estimating S m ( D ) m to within an additive error of ± α .
Acharya et al.
[3] consider two estimators for support coverage estimation.
▶ Sparse Case.
Assuming that m ≥ Ω (cid:16) log 2 (1 / ( αε )
[Equation]
(cid:17) .
When m ≥ 2 n , Acharya et al.
[3] (based on an earlier work [39]) gave an estimator ˆ S m , parameterized by r = log(3 /α ) and t
= m/n − 1 , that has a non-private sample complexity of C ˆ S n ( S m , α ) =
O (cid:16) m log(1 /α ) log m (cid:17) .
The sensitivity of this estimator is 1+ e r ( t − 1) m
[Equation]
Thus, we have D ˆ S m ( α, ε ) is the smallest n that satisfies
[Equation]
And so, D ˆ S m ( α, ε ) ≤ O (cid:16) m log
[Equation]
[Equation]
log
[Equation]
αmε ) (cid:17) .
Thus, plugging this into Theorem 17 gives rise to a sample complexity of O (cid:16)
m log(1 /α ) log( αmε ) (cid:17) .
▶ Dense Case.
The second estimator ˆ S
m they study works when n is a multiple of m .
We remark that, although the estimator as described in [3] does not seem to fit our setting, it can be viewed in our framework as follows.
The examples are divided in to n/m batches each of size m .
We then build a histogram h on supp( D ) ×
[ n/m ] where each example in batch i appends i to its original item.
The final estimate is then φ h ≥ 1 /n .
It was shown in [3] that the non-private sample complexity is C ˆ S m ( S m , α ) = O [Equation]
[Equation]
(cid:1) .
The sensitivity of this estimator is 1 /n .
Thus, we have D ˆ S m ( α, ε ) is the smallest n that satisfies
[Equation]
And so, D ˆ S m ( α, ε ) ≤ O
[Equation]
(cid:17) .
Thus, plugging this into Theorem 17 gives rise to a sample complexity of O (cid:16) max (cid:110) m, [Equation] [Equation]
αε [Equation] [Equation] (cid:111)(cid:17) , where the m part comes from our constraint that n ≥ m .
C.3 Support Size
Finally, we consider the problem of estimating the support size of D .
In general, this is impossible with finite sample since some atom of D might have an arbritrarily small probability mass.
To avoid this, we follow prior work and consider only probability distributions in ∆ ≥ 1 /K :
= {D | ∀ x ∈ supp( D ) , D ( x ) ≥ 1 /K } , i.e., those with non-zero mass of at least 1 /K at every atom, for some K .
Orlitsky et al.
[39] proved that the support coverage with m ≥ Ω( K · log(3 /α )) is a good estimate to the support size of any D ∈ ∆ ≥ 1 /K to within an error of ± αK .
In particular, they showed that if m ≥ K log(3 /α ) , then for any D ∈ ∆ 1 /K , it holds that | S m ( D ) − S ( D ) | ≤ αK/ 3 .
Combining this with Corollary 24, we immediately get the following bounds for the latter.
Corollary 24 (Support Size) .
For all 0 < ε ≤ O (1) , δ ∈ (0 , 1] , there exists an ( ε, δ ) -DP mechanism, in the pan-private and shuffle DP settings, that can estimate the support size of D ∈ ∆ ≥ 1 /K up to an additive error of ± αK with a sample complexity of
[Equation]
D Fast Post-Processing Algorithms
So far we have not focused on the running time of our post-processing algorithms.
Nonetheless, it is not hard to see that our algorithms run in polynomial time.
Below, we show that our algorithms can even be made to run in (cid:101)
O ε ( D + n ) -time for the ℓ 1 -error case.
D.1 Small Domain Case
We start with how to implement Algorithm 1 in O ( D + n log n ) time.
The first observation is that the expression for each ˆ φ ≥ r can be easily computed in constant time if we precompute the number of buckets above a certain threshold beforehand.
The second observation is that the last step is exactly the same as the so-called ℓ 1 -isotonic regression problem (by viewing the cumulative prevalence φ ≥ 1 , . . . , φ ≥ n as the variables), for which an O ( n log n ) -algorithm is known [42].
A full description is given in Algorithm 5.
Algorithm
Input: Discrete Laplace-noised histogram h ′ , i.e., h ′ j ∼ h
j + DLap( p ) c 0 , . . c n ←{ Counts for hash values } for j ∈ [ D ] do v ← max { min { h ′ j , n } , 0 } { Clip so that the value is between 0 , n } c v ← c v +c ≥ 0 , . .
c ≥ n +1 ←{ Counts for hash values above a certain threshold.
} for r = n, . .
, 0 do c ≥ r ← c ≥ r +1 + c r for r ∈ [ n ] do ˆ [Equation]
←
[Equation]
Find ˆ n that minimizes ∥
φ ˆ n ≥ − ˆ φ ≥ ∥ 1 using ℓ 1 -isotonic regression algorithm return ˆ n
D.2 Large Domain Case
The large domain case is more complicated, as solving the optimization problem ∥ Γ B ( ˆ n ) − φ ˆ n red ≥ ∥does not seem to be as simple as isotonic regression.
Nonetheless, we give a modified algorithm below that takes (cid:101)
O ε ( D + n log n ) time and has a similar error bound (within a polylogarithmic factor).
The idea is to use two noisy histograms in a similar manner as we did for ℓ 22 loss (Algorithm 4): One noisy histogram (without hashing) is used to determine the high-value counts, whereas the other noisy histogram, with hashing, is used to determine the low-value counts.
D.2.1 Computing Γ B
Recall from Observation 19 that Γ B ( n ) ℓ does not depend on φ n ≥ r for any r > ℓ .
Therefore, we may view Γ B ( n ) ℓ as a function of φ n ≥ 1 , . .
φ n ≥ ℓ .
We overload the notion and write Γ B ( φ n ≥ 1 , . . .
, φ n ≥ ℓ ) ℓ to denote Γ B ( n ) ℓ of a corresponding histogram n .
We start by giving an algorithm for computing such a value.
Recall that Γ B ( n ) ℓ is defined as the expected number of hash buckets whose total value is at least ℓ .
Let Ξ ≥ i ( n ) denote the probability that a fixed hash bucket has total value at least i .
By linearity of expectation, we have Γ B ( n ) ℓ = B · Ξ ≥ ℓ ( n ) .
Below, we keep updating Ξ ≥ i as we include one more histogram value, using the fact that the hash function puts this histogram value in a random hash bucket.
Input: φ ≥ 1 , . . . , φ ≥ ℓ , cumulative prevalence of a histogram φ ≥ ℓ +1 ← 0 .
{ For notational convenience.
Ξ ≥ 0 ← 1 and Ξ ≥ 1 , . . .
, Ξ ≥ ℓ ←{ Initialize Ξ values } for r = 1 , . . . , ℓ do for j = 1 , . .
. , φ ≥ r − φ ≥ r +1 do { Add a new histogram entry of value r } for k = ℓ, . .
. , 0 do Ξ ≥ k ← B − 1 B · Ξ ≥ k + 1 B · Ξ ≥ max { k − r, 0 } return B · Ξ ≥ ℓ
Since φ n ≥ 1 ≤ n , there are at most n pairs ( r, j ) considered by the algorithm.
Therefore, the total runtime of Algorithm 6 is O ( nℓ ) .
D.2.2 Fast Post-processing Algorithm
Our fast post-processing algorithm for large domains is stated below (Algorithm 7).
For convenience, we use the convention that φ n ≥ 0 = n .
Input: Two discrete Laplace-noised histograms ˜ h 1 and ˜ h 2 , red given as ▶ ˜ h
1 j ∼ h
j + DLap( p ) (without any hashing), and ▶ ˜
h 2 , red j ∼ h 2 , red j + DLap( p ) where the random hash has B buckets.
Parameter: m = ⌈ 10 log D/ log(1 /p
Compute an estimate ˆ n 1 of n using Algorithm
Compute an estimate ˆ n 2 , red of n 2 , red using Algorithmˆ φ ≥ 0 ← n for r ∈ [ m ] do lb = 0 , ub = ˆ φ ≥ r −{ Binary search to find ˆ φ ≥ r } while ub > lb + 1 do mid ← ⌊ ( ub + lb ) / 2 ⌋ v ← Γ B ( ˆ φ ≥ 1 , . . .
, ˆ φ ≥ r − 1 , mid ) r { See Algorithm 6 } if v ≥ φ ˆ n 2 , red ≥ r then ub ← mid else lb ← mid v ub ← Γ B ( ˆ φ ≥ 1 , . . .
, ˆ φ ≥ r − 1 , ub ) r v lb ← Γ B ( ˆ φ ≥ 1 , . . .
, ˆ φ ≥ r − 1 , lb ) r if | v lb − φ ˆ n 2 , red ≥ r | ≤ | v ub − φ ˆ n 2 , red ≥ r | then ˆ φ ≥ r ← lb else ˆ φ ≥ r ← ub
Find ˆ n that minimizes (cid:80) mr =1 | ˆ φ ≥ r − φ ˆ n ≥ r | + (cid:80) nr = m +1 | φ ˆ n 1 ≥ r − φ ˆ n ≥ r | using ℓ 1 -isotonic regression algorithm return ˆ n
Run Time Analysis.
Recall that Algorithm 1 runs in O
( D + n log n ) time.
In binary search, we call Algorithm 6 for a total of at most O ( m log n ) =
O (log D log n/ε ) times; since each call runs in
O ( nr ) =
O ( n log D/ε ) time, the total running time of this step is O ( n log n (log D/ε ) 2 ) .
Finally, note that the last step is again an ℓ 1 -isotonic regression problem and therefore can be solved in
O ( n log n ) time.
Thus, in total the running time is (cid:101)
O ε ( D + n ) as desired.
Note that we may assume without loss of generality that D ≤ n O (1) as otherwise we may first hash to, e.g., B ′
=
O ( n 2 ) buckets, which results in an increase in the expected ℓ 1 -error of at most O (1) .
Error Analysis.
We now prove the error guarantee of the algorithm, which is stated precisely below.
Theorem 25.
Suppose that B > 3 nm .
Then, we have
[Equation]
Note that, since taking p =
e − ε/ 4 makes the algorithm ε -DP, we get the following:
Corollary 26.
For all ε > 0 , Algorithm 7 for p =
e − ε/ 4 and B = 10 nm is ε -DP, and achieves an expected ℓ 1 -error of O ( √ n (log( nD )) /ε 3 ) .
The quantitative bound above matches Corollary 13 to within a factor of (log n ) 1 / 4 /ε 0 .
5 (recall that we can assume without loss of generality that D ≤ n O (1) ).
To prove Theorem 25, we will need the following auxiliary lemma, whose proof is given later in this section.
Lemma 27.
Suppose that B > 3 nm .
Then,
[Equation]
We are now ready to prove Theorem 25.
Proof of Theorem 25.
First, the expected ℓ 1 -error can be written as
[Equation]
(cid:35)(cid:33) , where the last step follows from the triangle inequality and our choice of ˆ n [Equation]
We now plug in Lemma
[Equation]
which yields:
[Equation]
To bound the last term
[Equation]
we use Observation
[Equation]
which gives:
[Equation]
[Table]
The second term (cid:80) nℓ =1 φ n ℓ · (cid:0)(cid:80) nr =1 r · p | ℓ − r | (cid:1) can be bounded in the exact same way as in Theorem 9, which gives an upper bound of O ( (cid:112) n/ (1 − p ) 2 ) .
The first term (cid:0) φ n 0 · (cid:80) nr = m +1 r · p r (cid:1) can be bounded as follows:
[Equation]
Putting the four inequalities above together, we arrive at
[Equation]
Proof of Lemma 27.
Let σ := B/n .
We will prove by induction that
[Equation]
for all ℓ = 0 , . . .
, m .
The base case ℓ = 0 is trivial.
We will next prove the inductive step.
Suppose that the bound (11) holds for ℓ − 1 .
We will now show that it also holds for ℓ .
Recall from Lemma 20 that Γ B ( ˆ φ ≥ 1 , . . .
, ˆ φ ≥ ℓ ) ℓ is increasing in ˆ φ ≥ ℓ when ˆ φ ≥ 1 , . . .
, ˆ φ ≥ ℓ − 1 are held fixed.
This means that our binary search algorithm finds the optimum, which implies
[Equation]
Applying the third inequality in Lemma 20 repeatedly
[Equation]
we have
[Equation]
Again applying the second inequality in Lemma
[Equation]
we get | ˆ φ ≥ ℓ − φ n ≥ ℓ | ≤
[Equation] [Equation]
[Equation]
σ
[Equation]
using
[Equation]
Therefore, we have ℓ (cid:88)
[Equation]
Plugging in the inductive hypothesis, we can conclude that (12) also holds for ℓ .
Finally, plugging in ℓ = m and using the fact that σ ≥ 3 ℓ , we arrive at the claimed bound. E On Pan-Privacy
In the main body of our work, we only consider the notion of pan-privacy where, for every t ∈ [ n ] , the internal state of the algorithm after the t -th step must be ε -DP.
This can be achieved for discrete
Laplace-noised histogram as follows: start with h j drawn from DLap( p ) for p =
e − ε/ 2 for all j ∈
[ D ] .
Then, at each step, increment the corresponding entry
h j .
While this algorithm suffices for our more relaxed notion, it does not satisfy the original notion of pan-privacy as defined in [25], which requires that, for every t ∈ [ n ] , both the internal state of the algorithm after the t -th step and the final output must be ε -DP.
A possible adaptation of the above algorithm to satisfy this notion of pan-privacy is to also add a noise drawn from DLap( p ) to each entry of the histogram after the last element in the stream (before computing the final output).
It is simple to see that this satisfies ε -DP in the more restricted notion when we set p =
e − ε/ 4 .
Unfortunately, this adaptation does not result in a discrete Laplace-noised histogram.
Instead, the final histogram is noised by two i.i.d.
discrete Laplace random variables (one from the initialization, and one from the final step).
Due to this, we have to also adapt our estimation algorithm.
Specifically, in Algorithm 1, we replace f by 9 f ∗ g where g is defined by
[Equation]
It is not hard to check that this results in an unbiased estimator, and an analogue of Theorem 9 can be proved but with C p
=
O
(1 / (1 − p ) 9 ) .
This in turn results in a worse error of
O ( (cid:112) ( n + D ) log n/ε 4 . 5 ) instead of O ( (cid:112) ( n + D ) log n/ε 2 . 5 ) for the model considered in the main body.
Other algorithms can be adapted similarly, again with worse dependency of ε in the error bounds.