August 07, 2018
We study the problem of distribution testing when the samples can only be accessed using a locally differentially private mechanism and focus on two representative testing questions of identity (goodness-of-fit) and independence testing for discrete distributions. We are concerned with two settings: First, when we insist on using an already deployed, general-purpose locally differentially private mechanism such as the popular Rappor or the recently introduced Hadamard Response for collecting data, and must build our tests based on the data collected via this mechanism; and second, when no such restriction is imposed, and we can design a bespoke mechanism specifically for testing. For the latter purpose, we introduce the Randomized Aggregated Private Testing Optimal Response (Raptor) mechanism which is remarkably simple and requires only one bit of communication per sample.
We propose tests based on these mechanisms and analyze their sample complexities. Each proposed test can be implemented efficiently. In each case (barring one), we complement our performance bounds for algorithms with information-theoretic lower bounds and establish sample optimality of our proposed algorithm. A peculiar feature that emerges is that our sample-optimal algorithm based on Raptor uses public-coins, and any test based on Rappor or Hadamard Response, which are both private-coin mechanisms, requires significantly more samples.
Locally differentially private (LDP) mechanisms have gained prominence as methods of choice for sharing sensitive data with untrusted curators. This strong notion of privacy, introduced in [1] (see also [2]) as a variant of differential privacy [3], [4], requires each user to report only a noisy version of its data such that the distribution of the reported data does not change multiplicatively beyond a prespecified factor when the underlying user data changes. With the proliferation of user data accumulated using such locally private mechanisms, there is an increasing demand for designing data analytics toolkits for operating on the collated user data. In this paper, we consider the design of algorithms aimed at providing a basic ability to such a toolkit, namely the ability to run statistical tests for the underlying user data distribution. At a high-level, we seek to address the following question.
How should one conduct statistical testing on the (sensitive) data of users, such that each user maintains their own privacy both to the outside world and* to the (untrusted) curator performing the inference?*
In particular, we consider two fundamental statistical inference problems for a discrete distribution over a large alphabet: identity testing (goodness-of-fit) and independence testing. A prototypical example of the former is testing whether the user data was generated from a uniform distribution; the latter tests if two components of user data vectors are independent. Our main focus is the uniformity testing problem and most of the other results are obtained as an extension using similar techniques. We seek algorithms that are efficient in the number of LDP user data samples required and can be implemented practically. These two problems are instances of distribution testing, a sub-area of statistical hypothesis testing focusing on small-sample analysis introduced by Batu et al. [5] and Goldreich, Goldwasser, and Ron [6].
Our results are comprehensive, and organized along two axes: First, we consider tests that use existing LDP data release mechanisms to collect inputs at the center and perform a post-processing test on this aggregated data. Specifically, we consider the popular Rappor mechanism of [7] and the recently introduced the Hadamard Response mechanism (HR) of [8]. Because these mechanisms have utility beyond our specific use-case of distribution testing – Rappor, for instance, is already deployed in many applications – it is natural to build a more comprehensive data analytics toolkit using the data accumulated by these mechanisms. To this end, we provide uniformity testing algorithms with optimal sample complexity for both mechanisms; further, for HR, we also provide an independence testing algorithm and analyze its performance.
Second, we consider the more general class of public-coin mechanisms for solving testing problems which are allowed to use public randomness. We present a new response mechanism, Randomized Aggregated Private Testing Optimal Response (Raptor), that only requires users to send a single privatized bit indicating whether their data point is in a (publicly known) random subset of the domain. Using Raptor, we obtain simple algorithms for uniformity and independence testing that are sample-optimal even among public-coin mechanisms.
We next provide a detailed description of our results, followed by a discussion of the relevant literature to put them in perspective. At the outset we mention that the problems studied here have been introduced earlier in [9], [10]. Our algorithms outperform their counterparts from these papers, and we complement them with information-theoretic lower bounds establishing their optimality (except for the proposed HR-based independence test).
The privacy level of a locally private mechanism is often parameterized by a single parameter \(\varepsilon>0\). Specifically, an \(\varepsilon\)-LDP mechanism (\(cf.\) Duchi et al. [1]) ensures that for any two distinct values of user data, the distribution of the output reported to the curator is within a multiplicative factor of \(e^{\varepsilon}\); smaller values of \(\varepsilon\) indicate stronger privacy guarantees. In this work, we focus on the high-privacy regime, and assume throughout that \(\varepsilon\in(0,1]\); however, our choice of \(1\) as an upper bound is to set a convention and can be replaced with any constant.
In uniformity testing, the user data comprises independent samples from an unknown \(k\)-ary distribution. These samples are then made available to the curator through an \(\varepsilon\)-LDP mechanism, and she seeks to determine if the underlying distribution was uniform or \(\gamma\)-far from uniform in total variation distance. How many locally private samples must the curator access?
First, we consider two representative locally private mechanisms, Rappor and HR. We briefly describe these mechanisms here informally and provide a more complete definition in 2. In Rappor, the \(k\)-ary observation of the user is first converted to a \(k\)-length vector using one-hot encoding, and then each bit of this vector is independently flipped with probability \(1/(1+e^\varepsilon)\). HR, on the other hand, is a generalization of the classic Randomized Response (RR) [11] which roughly maps each \(k\)-ary observation \(x\) to either a randomly chosen \(+1\) entry of the \(x\)-th row of the \(k\times k\) Hadamard matrix with probability \(e^\varepsilon/(1+e^\varepsilon)\), or to a randomly chosen \(-1\) entry with probability \(1/(1+e^\varepsilon)\). Interestingly, both these mechanisms have been shown recently to be sample-optimal for learning \(k\)-ary distributions; see [7], [8], [12]–[15]. Further, note that both Rappor and HR are private-coin mechanisms, and are symmetric across users.
We propose the following algorithm to enable uniformity testing using data obtained via Rappor. Once again, the description here is brief and a formal description is provided in 3.1.
We analyze the sample complexity of the above test and show that it is order-wise optimal among all tests that use Rappor.
The uniformity test described above requires \(O(k^{3/2}/(\gamma^2\varepsilon^2))\) samples. Furthermore, any test using Rappor must use \(\Omega(k^{3/2}/(\gamma^2\varepsilon^2))\) samples.
Moving now to HR, denote by \(q^*\) the output distribution of HR when the underlying samples are generated from the uniform distribution. (Note that \(q^*\) can be computed explicitly.) Invoking Parseval’s theorem, we show that the \(\ell_{2}\) distance between the \(q^\ast\) and the output distribution of \(\mathrm{\small HR}\) is roughly \(\varepsilon/\sqrt{k}\) times the \(\ell_{2}\) distance between the uniform and the user data distributions. This motivates the following test.
Our next result shows that this test is indeed sample-optimal among all tests using HR.
The uniformity test described above requires \(O(k^{3/2}/(\gamma^2\varepsilon^2))\) samples. Furthermore, any test using HR must use \(\Omega(k^{3/2}/(\gamma^2\varepsilon^2))\) samples.
Both tests proposed above thus provably cannot be improved beyond this barrier of \(\Omega(k^{3/2}/(\gamma^2\varepsilon^2))\) samples. Interestingly, this was conjectured by Sheffet to be the optimal sample complexity of locally private uniformity testing [9], although no algorithm achieving this sample complexity was provided. Yet, our next result shows that one can achieve the same guarantees with much fewer samples when public randomness is allowed.
Specifically, we describe a new mechanism Raptor, described below:
The key observation is that when the underlying distribution is \(\gamma\)-far from uniform, the bias of \(B_i\) is \(1/2 + \Omega(\gamma/\sqrt{k})\) with constant probability (over the choice of \(S\)); while clearly, under uniform the bits \(B_i\) are unbiased. Thus, we can simply test for uniformity by learning the bias of the bit up to an accuracy of \(\gamma/\sqrt{k}\), which can be done using \(O(k/(\gamma^2\varepsilon^2))\) samples from Raptor. In fact, we further show that (up to constant factors) this number of samples cannot be improved upon.
Uniformity testing using Raptor requires \(O(k/(\gamma^2\varepsilon^2))\) samples. Furthermore, any public-coin mechanism for locally private uniformity testing requires \(\Omega(k/(\gamma^2\varepsilon^2))\) samples.
Although we have stated the previous three results for uniformity testing, our proofs extend easily to identity testing, \(i.e.\), the problem of testing equality of the underlying distribution to a fixed known distribution \(q\) which is not necessarily uniform. In fact, if we allow simple preprocessing of user observations before applying locally private mechanisms, a reduction argument due to Goldreich [16] can be used to directly convert identity testing to uniformity testing.
Our final set of results are for independence testing, where user data consists of two-dimensional vectors \((X_i, Y_i)\) from \([k]\times[k]\). We seek to ascertain if these vectors were generated from an independent distribution \(p_1\otimes p_2\) or a distribution that is \(\gamma\)-far in total variation distance from every independent distribution. For this problem, a natural counterpart of Raptor which simply applies Raptor to each of the two coordinate using independently generated sets yields a sample optimal test – indeed, we then simply need to test if the pair of indicator-bits are independent or not. This can be done using \(O(k^2/(\gamma^2\varepsilon^2))\), leading to the following result.
The sample complexity of locally private independence testing is \(\Theta(k^2/(\gamma^2\varepsilon^2))\) and is achieved by a simple public-coin mechanism that applies Raptor to each coordinate of user data.
For completeness, we also present a private-coin mechanism for independence testing based on HR which requires \(O(k^{3}/(\gamma^2\varepsilon^4))\) samples. The proposed test builds on a technique introduced in Acharya, Daskalakis, and Kamath [17] and relies on learning in \(\chi^2\) divergence. Although this result is suboptimal in the dependence on the privacy parameter \(\varepsilon\), it improves on both [9] and the testing-by-learning baseline approach by a factor of \(k\). We summarize all our results in 1 and compare them with the best known prior bounds from [9].
| This work | Previous [9] | ||
| Private-Coin | Public-Coin | Private-Coin | |
| Uniformity Testing | \(O\left(\frac{k^{3/2}}{\gamma^2\varepsilon^2} \right)\) \(\circlearrowright\)\(\star\) | \(\Theta\left(\frac{k}{\gamma^2\varepsilon^2} \right)\) \(\circlearrowright\) | \(O\left(\frac{k^{2}}{\gamma^2\varepsilon^2} \right)\) \(\not\circlearrowright\) |
| Independence Testing | \(O\left(\frac{k^{3}}{\gamma^2\varepsilon^4} \right)\) \(\circlearrowright\) | \(\Theta\left(\frac{k^{2}}{\gamma^2\varepsilon^2} \right)\) \(\circlearrowright\) | \(O\left(\frac{k^{4}}{\gamma^2\varepsilon^2} \right)\) \(\not\circlearrowright\) |
We start by describing the analysis of our tests based on existing \(\varepsilon\)-LDP mechanisms. Recall that a standard (non-private) uniformity test entails estimating the \(\ell_{2}\) norm of the underlying distribution by counting the number of collisions in the observed samples. When applying the same idea on the data collected via Rappor, we can naively try to estimate the number of collisions by adding the number of pairs of output vectors with \(1\)s in the \(x\)-th coordinate, for each \(x\). However, the resulting statistic has a prohibitively high variance stemming from the noise added by Rappor. We fix this shortcoming by considering a bias-corrected version of this statistic that closely resembles the classic \(\chi^2\) statistic. However, analyzing the variance of this new statistic turns out to be rather technical and involves handling the covariance of quadratic functions of correlated binomial random variables. Our main technical effort in this part goes into analyzing this covariance, which may find further applications.
For our second test that builds on HR, we follow a different approach. In this case, we exploit the structure of Hadamard transform and take recourse to Parseval’s theorem to show that the \(\ell_{2}\) distance to uniformity of the original distribution \(p\) is equal, up to an \(\varepsilon/\sqrt{k}\) factor, to the \(\ell_{2}\) distance of the Fourier transform \(H(p)\) to some (explicit) fixed distribution \(q\); further, it can be shown that \({\lVert q{\rVert}}_2 = O(1/\sqrt{k})\). With this structural result in hand, we can test identity of \(H(p)\) to \(q\) in the Fourier domain, by invoking the non-private \(\ell_{2}\) tester of Chan et al. [18] with the corresponding distance parameter \(\gamma\varepsilon/\sqrt{k}\). Exploiting the fact that \(q\) has a small \(\ell_{2}\) norm leads to the stated sample complexity.
Our private-coin mechanism for independence testing uses HR as well, and once again hinges on the idea that testing and learning in the Fourier domain can be done efficiently. To wit, we adapt the “testing-by-learning” framework of Acharya, Daskalakis, and Kamath [17] (which they show can be applied to many testing problems, including independence testing) to our private setting. The main insight here is that instead of using HR to learn and test the original distribution \(p\) in \(\chi^2\) distance, we perform both operations directly in the transformed domain to the distribution at the output of HR. Namely, we first learn the transform of \(p_1\otimes p_2\), then test whether the outcome is close to the transform of \(p\). The main challenge here is to show that the variant of Hadamard transform that we use preserves (as was the case for uniformity testing) the \(\ell_{2}\) distance from independence. We believe this approach to be quite general, as was the case in [17], and that it can be used to tackle many other distribution testing questions such as locally private testing of monotonicity or log-concavity.
As mentioned above, our main results – the optimal public-coin mechanisms for identity and independence testing – are remarkably simple. The key heuristic underlying both can be summarized as follows: If \(p\) is \(\gamma\)-far from uniform, then with constant probability a uniformly random subset \(S\subseteq[k]\) of size \(k/2\) will satisfy \(p(S) = 1/2 \pm \Omega(\gamma/\sqrt{k})\); on the other hand, if \(p\) is uniform then \(p(S)=1/2\) always holds. Thus, one can reduce the original testing problem (over alphabet size \(k\)) to the much simpler question of estimating the bias of a coin. This latter task is very easy to perform optimally in a locally private manner – for instance it can be completed via RR – and requires each player to send only one bit to the server. Hence, the main technical difficulty is to prove this quite intuitive claim. We do this by showing anticoncentration bounds for a suitable random variable by bounding its fourth moment and invoking the Paley–Zygmund inequality. As a byproduct, we end up establishing a more general version, 6, which we believe to be of independent interest.
Our information-theoretic lower bounds are all based on a general approach introduced recently by Acharya, Canonne, and Tyagi [19] (in a non-private setting) that allows us to handle the change in distances between distributions when information constraints are imposed on samples. We utilize the by-now-standard “Paninski construction” [20], a collection \(\mathcal{C}\) of \(2^{k/2}\) distributions obtained by adding a small pointwise perturbation to the \(k\)-ary uniform distribution. In order to obtain a lower bound for the sample complexity of locally private uniformity testing, following [19], we identify such a mechanism to the \(n\) noisy channels \((W_j\colon [k]\to\{0,1\}^\ast)_{j\in[n]}\) (that is, the randomized mappings used by the \(n\) players) it induces on the samples and consider the distribution \(\mathcal{W}(p)\) of the tuple of \(n\) messages when the underlying distribution of the samples is \(p\). The key step then is to bound the \(\chi^2\) divergence between (i) \(\mathcal{W}(u)\), the distribution of the messages under the uniform distribution; and (ii) \(\mathbb{E}_{p\in\mathcal{C}}[\mathcal{W}(p)]\), the average distribution of the messages when \(p\) is chosen uniformly at random among the “perturbed distributions.”
Using the results of [19], this in turn is tantamount to obtaining an upper bound the Frobenius norm of specific \([k/2]\times[k/2]\) matrices \(\mathbf{H}_1,\dots,\mathbf{H}_n\) that capture the information constraints imposed by \(W_j\)’s. Deriving these bounds for Frobenius norms constitutes the main technical part of the lower bounds and relies on a careful analysis of the underlying mechanism and of the LDP constraints it must satisfy.
As pointed out earlier, in this work we focus on the high-privacy regime, \(i.e.\), the case when the privacy parameter \(\varepsilon\) is small and the privacy constraints on the mechanisms are the most stringent. From a technical standpoint, this allows us to rewrite the expressions such as \(\frac{e^\varepsilon-1}{e^\varepsilon+1}\) and \(\frac{e^{\varepsilon/2}-1}{e^{\varepsilon/2}+1}\), which appear frequently, as simply \(\Theta(\varepsilon)\) and greatly simplifies the statements of our results. However, our results carry through to the general setting of large \(\varepsilon\), with \(\frac{e^\varepsilon-1}{e^\varepsilon+1}\) replacing \(\Theta(\varepsilon)\) term; the former is \(\Theta(1)\) for large \(\varepsilon\).
Testing properties of a distribution by observing samples from it is a central problem in statistics and has been studied for over a century. Motivated by applications arising from algorithms dealing with massive amounts of data, it has seen renewed interest in the computer science community under the broad title of distribution testing, with a particular focus on sample-optimal algorithms for discrete distributions. This literature itself is over two decades old; we refer an interested reader to surveys and books [21]–[24] for a comprehensive review. Here, we only touch upon works that are related directly to our paper.
Sample complexity for uniformity testing was settled in [20], following a long line of work. The related, and more general, problem of identity testing has seen revived interest lately. The sample complexity for this problem was shown to be \(\Theta(k^{1/2}/\gamma^2)\) in [25], and by now even the optimal dependence on the error probability is known (\(cf.\) [26], [27]). Moreover, a work of Goldreich [16] further shows that any uniformity testing algorithm implies an identity testing one with similar sample complexity. Another variant of this problem, termed “instance-optimal” identity testing and introduced in [25], seeks to characterize the dependence of the sample complexity on the distribution \(q\) we are testing identity to, instead of the alphabet size. As pointed out in [19], the reduction from [16] can be used in conjunction with results from [28] to go through even for the instance-optimal setting. This observation allows us to focus on uniformity testing only, even when local privacy constraints are imposed.
The optimal sample complexity for the independence testing problem where both observations are from the same set5 \([k]\) was shown to be \(\Theta(k/\gamma^2)\) in [17], [29].
Moving now to distribution testing settings with privacy constraints, the setting of differentially private (DP) testing has by now been extensively studied. Here the algorithm itself is run by a trusted curator who has access to all the user data, but needs to ensure that the output of the test maintains differential privacy. Private identity testing in this sense has been considered in [30], [31], with a complete characterization of sample complexity derived in [32]. Interestingly, in several parameter ranges of interest the sample complexity here matches the sample complexity for the non-private case discussed earlier, showing that “privacy often comes at no additional cost” in this setting. As we show in this work, this is in stark contrast to what can be achieved in the more stringent locally private setting.
We are not aware of any existing private algorithm for DP independence testing. While the literature on DP testing includes several interesting mechanisms, for instance the works [33]–[35] which contain mechanisms for both identity and independence testing, finite-sample guarantees are not available and the results hold only in the asymptotic regime.
Finally, coming to the literature most closely related to our work, locally private hypothesis testing was considered first by Sheffet in [9] where, too, both identity and independence testing were considered. This work characterized the sample complexity of LDP independence and uniformity testing when using Randomized Response, and introduced more general mechanisms. However, as pointed-out in 1, the algorithms proposed in [9] require significantly more samples than our sample-optimal algorithms for those questions. Moreover, the overall sample complexity without restricting to any specific class of mechanisms has not been considered.
An interesting concern studied in Sheffet’s work is the distinction between symmetric and asymmetric mechanisms. Broadly speaking, the latter are locally private mechanisms where each player applies the same randomized function \(W\) to its data, where asymmetric mechanisms allow different behaviors, with player \(i\) using its own \(W_i\). While we mention this distinction in our results (see 1), we observe in 1 that allowing asymmetric mechanisms can only improve the sample complexity by at most a logarithmic factor.
Another class of problems of statistical inference requires learning the unknown distribution up to a desired accuracy of \(\gamma\) in total variation distance. Clearly, the testing problems we consider can be solved by privately learning the distributions (to accuracy \(\gamma\)). The optimal sample complexity of locally private learning discrete \(k\)-ary distributions is known to be \(\Theta(k^2/(\gamma^2\varepsilon^2))\); see [7], [8], [12], [14], [15]. (Furthermore, all these sample-optimal learning schemes are symmetric.) This readily implies a sample complexity upper bound of \(O(k^2/(\gamma^2\varepsilon^2))\) for locally private identity testing, and of \(O(k^4/(\gamma^2\varepsilon^2))\) for independence testing. In this respect the theoretical guarantees from [9] are either implied or superseded by this “testing-by-learning” approach.
We write \([k]\) for the set of integers \(\{1,2,\dots,k\}\), and denote by \(\log\) and \(\ln\) the binary and natural logarithms, respectively. We make extensive use of the standard asymptotic \(O(\cdot)\), \(\Omega(\cdot)\), and \(\Theta(\cdot)\) notation; moreover, we shall sometimes use \(a_n \lesssim b_n\), \(a\gtrsim b_n\), and \(a_n \asymp b_n\) for their non-asymptotic counterparts (i.e., \(a_n \lesssim c_1 b_n\), \(a\gtrsim c_1 b_n\), and \(c_1 a_n \leq b_n \leq c_2 a_n\) for every \(n\), where \(c_1,c_2>0\) are absolute constants).
Following the standard setting of distribution testing, we consider probability distributions over a discrete (and known) domain \(\Omega\). Denote by \(\Delta\mleft(\Omega\mright)\) the set of all such distributions, \[\Delta\mleft(\Omega\mright) = \left\{\; p\colon [k] \to [0,1] \;\colon\; \sum_{x\in\Omega} p(x) = 1 \; \right\} ,\] endowed with the total variation distance (statistical distance) as a metric, defined as \({\operatorname{d}_{\rm TV}^{}\!\left({p, q}\right)} = \sup_{S\subseteq \Omega}(p(S)-q(S))\). It is easy to see that \({\operatorname{d}_{\rm TV}^{}\!\left({p, q}\right)} = \frac{1}{2}{\lVert p-q{\rVert}}_1\), where \({\lVert p-q{\rVert}}_1\) is the \(\ell_{1}\) distance between \(p\) and \(q\) as probability mass functions. For a distance parameter \(\gamma\in(0,1]\), we say that \(p,q\in\Delta\mleft(\Omega\mright)\) are \(\gamma\)-far if \({\operatorname{d}_{\rm TV}^{}\!\left({p, q}\right)}>\gamma\); otherwise, they are \(\gamma\)-close. We denote by \(p_1\otimes p_2\) the product distribution over \([k_1]\times[k_2]\) defined by \((p_1\otimes p_2)(x_1,x_2)=p_1(x_1) \cdot p_2(x_2)\), for \(p_1\in\Delta\mleft([k_1]\mright)\), \(p_2\in \Delta\mleft([k_2]\mright)\).
In distribution testing, for a prespecified set of distributions \(\mathcal{C}\subseteq\Delta\mleft(\Omega\mright)\) and given independent samples from an unknown \(p\in\Delta\mleft(\Omega\mright)\), our goal is to distinguish between the cases (i) \(p\in \mathcal{C}\) and (ii) \(p\) is \(\gamma\)-far from every \(q\in\mathcal{C}\) with constant probability6. The sample complexity of testing \(\mathcal{C}\) is defined as the minimum number of samples required to achieve this task in the worst case over all \(p\in\Delta\mleft(\Omega\mright)\) (as a function of \(\gamma\), \(\left\lvert \Omega \right\rvert\), and all other relevant parameters of \(\mathcal{C}\)).
The specific problem of identity testing corresponds to \(\Omega=[k]\) and \(\mathcal{C} = \{q\}\) for some fixed and known \(q\in\Delta\mleft([k]\mright)\). Uniformity testing is the special case of identity testing with \(q\) being the uniform distribution, i.e., \(q(x) = 1/k\) for all \(x \in [k]\). Lastly, independence testing corresponds to \(\Omega=[k]\times[k]\) and \(\mathcal{C} := \left\{\; p_1\otimes p_2 \;\colon\; p_1,p_2\in\Delta\mleft([k]\mright) \; \right\}\).
We consider the standard setting of \(\varepsilon\)-local differential privacy, which we recall below. A \(1\)-user mechanism is simply a randomized mapping which, given as input user data \(x\in {\cal X}\), outputs a random variable \(Z\) taking values in \({\cal Z}\). We represent this mechanism by a channel \(W\colon {\cal X}\to {\cal Z}\) where \(W(z\mid x)\) denotes the probability that the mechanism outputs \(z\) when the user input is \(x\). Similarly, an \(n\)-user mechanism is represented by \(W=(W_j\colon{\cal X}\to{\cal Y})_{j\geq 0}\) where \(W_j\) denotes the channel used for the \(j\)-th user; when \(n\) is clear from context, we will simply use mechanism for an \(n\)-user mechanism. For our purposes, \({\cal X}\) will be the domain of our discrete probability distributions, \([k]\), and \({\cal Z}\) will be identified with \(\{0,1\}^\ell\), for some integer \(\ell\geq 0\).
Note that each channel \(W_j\) is applied independently to each user’s data. In particular, for independent samples \(X_1,\dots, X_n\), the outputs \(Z_1, \dots, Z_n\) of \(W\) are independent, too. The mechanisms described above are private-coin mechanisms: they only require independent, local randomness at each user to implement the local channels \(W_1,\dots,W_n\). A private-coin mechanism is further said to be symmetric if \(W_j\) is the same for all \(j\), in which case, with an abuse of notation, we denote it \(W\colon{\cal X}\to{\cal Z}\). A broader class of mechanisms of interest to us are public-coin mechanisms, where the output of each user may depend additionally on shared public randomness \(U\) (independent of the users’ data); when the shared randomness takes the value \(u\), the mechanism uses channels \(W^u_j\). Clearly, private-coin mechanisms are a special case, corresponding to constant \(U\). The above distinction between symmetric and asymmetric mechanisms applies to public-coin mechanisms as well.
A public-coin mechanism \(W\) is an \(\varepsilon\)-locally differentially private (\(\varepsilon\)-LDP) mechanism if it satisfies the following: \[\max_{u}\max_{z\in {\cal Y}}\max_{x,x'\in {\cal X}}\frac{W_j^u(z\mid x')}{W_j^u(z\mid x)} \leq e^{\varepsilon}, \quad \forall \,1\leq j\leq n.\]
Three LDP mechanisms will be of interest to us: randomized response, Rappor, and Hadamard response.
The \(k\)-randomized response (\(k\)-RR) mechanism [11] is an \(\varepsilon\)-LDP mechanism, \(W_{\mathrm{\small RR}}\), with \({\cal Z}={\cal X}=[k]\), such that \[\label{eq:rr} W_\mathrm{\small RR}(z \mid x) :=\begin{cases} \frac{e^\varepsilon}{e^\varepsilon+k-1} & \text{if z=x},\\ \frac{1}{e^\varepsilon+k-1} & \text{otherwise.} \end{cases}\tag{1}\] Originally introduced for the binary case (\(k=2\)), it is one of the simplest and most natural response mechanisms.
The randomized aggregatable privacy-preserving ordinal response (Rappor) is an \(\varepsilon\)-LDP mechanism introduced in [1], [7]. Its simplest implementation, \(k\)-Rappor, maps \({\cal X}=[k]\) to \({\cal Z}=[2^k]\) in two steps. First, a one-hot encoding is applied to the input \(x\in[k]\) to obtain a vector \(y\in\{0,1\}^k\) such that \(y_{j}=1\) for \(j=x\) and \({\boldsymbol{y}}_j=0\) for \(j\ne x\). The privatized output, \(z \in {\cal Z}\), of \(k\)-Rappor is represented by a \(k\)-bit vector obtained by independently flipping each bit of \(y\) independently with probability \(\frac{1}{e^{\varepsilon/2}+1}\).
Note that if \(x\) is drawn from \(p\in\Delta\mleft(k\mright)\), this leads to \(z\in\{0,1\}^k\) such that the coordinates are (non-independent) Bernoulli random variables with \(z_i\) distributed as \(\operatorname{Bern}\mleft( \alpha_{R}\cdot p(i)+\beta_{R} \mright)\) where \(\alpha_{R}, \beta_{R}\) are defined as \[\label{eq:rappor:parameters} \alpha_{R} :=\frac{e^{\varepsilon/2}-1}{e^{\varepsilon/2}+1} = \frac{\varepsilon}{4}+o(\varepsilon), \qquad \beta_{R} := \frac{1}{e^{\varepsilon/2}+1} = \frac{1}{2} + o(1).\tag{2}\]
Hadamard response is a symmetric, communication- and time-efficient mechanism, proposed in [8].
In order to define the Hadamard response mechanism, we first define a general family of \(\varepsilon\)-LDP mechanisms that include RR as a special case. Let \(s\leq K\) be two integers, and for each \(x\in {\cal X}=[k]\) let \(C_x \subseteq {\cal Z}=[K]\) be a subset of size with \(|C_x|=s\). Then, the general privatization scheme is described by \[\label{eq:general:asz} \forall z\in[K],\qquad W(z\mid x) :=\begin{cases} \frac{e^\varepsilon}{se^\varepsilon+K-s} & \text{if z\in C_x},\\ \frac{1}{se^\varepsilon+K-s} & \text{if z\in{\cal Z}\setminus C_x} \end{cases}\tag{3}\] which can easily be seen to be \(\varepsilon\)-LDP. Further, note that \(k\)-RR corresponds to the special case with \(K=k\), \(s=1\), and \(C_x = \{x\}\) for all \(x\).
The Hadamard Response mechanism (HR), is obtained by choosing \(s=K/2\), and a collection of sets \((C_x)_{x\in[k]}\) such that
(A) For every \(x\in[k]\), \(|C_{x}|= s = \frac{K}{2}\).
(B) For every distinct \(x, x'\in[k]\), the symmetric difference \(\Delta(C_{x}, C_{x'})\) satisfies \(\left\lvert \Delta(C_{x}, C_{x'}) \right\rvert = s\).
For these parameters, we get that \[\label{eq:hr:asz} W(z\mid x) = \begin{cases} \frac{2}{K}\cdot \frac{e^\varepsilon}{e^\varepsilon+1} & \text{if z\in C_x},\\ \frac{2}{K}\cdot\frac{1}{e^\varepsilon+1} & \text{if z\in{\cal Z}\setminus C_x}, \end{cases} \quad \forall z\in[K].\tag{4}\] Let \(q(p, C_x)\) denote the probability that the privatized output \(z\) lies in \(C_x\), when the input distribution is \(p\). Then, from [item:condition:size] and [item:condition:diff] it can be seen that \[\begin{align} \Pr\mleft[\, Z \in C_x \;\middle\vert\; Z=x \, \mright] &= \sum_{z\in C_x}W(z\mid x) \frac{e^\varepsilon}{e^\varepsilon+1}, \qquad \Pr\mleft[\, Z \in C_x \;\middle\vert\; Z\neq x \, \mright] = \frac{1}{2} \end{align}\] and combining these two \[\label{eqn:pcx2px} q(p, C_x) = \frac{1}{2}+ \frac{e^\varepsilon-1}{2(e^\varepsilon+1)} p(x)\,.\tag{5}\]
A method for constructing sets \((C_x)_{x\in [k]}\) that also allows efficient implementation of the resulting mechanism was proposed in [8] using Hadamard codes (hence the name Hadamard Response). Specifically, let \[\label{eqn:choice:K} K :=2^{{\lceil{\log(k+1)}\rceil}}\tag{6}\] so that \(k+1\leq K\leq 2(k+1)\), and let \(H_K\in \{-1,1\}^{K\times K}\) be the Hadamard matrix of order \(K\) (see 2.3 for more details). Hereafter, we identify each row of \(H_K\) to a subset of \([K]\). As \(K\geq k+1\), we can pick an injection \(\phi\colon[k]\to\{2,\dots,K\}\) and map each \(x\in[k]\) to a distinct subset \(C_x\subseteq[K]\) defined by the \(\phi(x)\)-th row of \(H_K\). By [fact:hadamard:matrix] in the next section, this family \((C_x)_{x\in[k]}\) satisfies [item:condition:size] and [item:condition:diff].
Next, we recall some useful properties of Hadamard matrices which will be needed for our analysis of HR-based tests.
Definition 1. Let \(M\geq 1\) be any power of two. The Hadamard matrix of order \(M\), denoted \(H_{M}\), is the matrix of size \(M\times M\) defined recursively by Sylvester’s construction: (i) \(H_1:=\begin{bmatrix}1\end{bmatrix}\), and (ii) for \(m \geq 1\), \[H_{2^m} :=\begin{bmatrix} H_{2^{m-1}} & H_{2^{m-1}} \\ H_{2^{m-1}} & -H_{2^{m-1}} \end{bmatrix}\,.\]
Note that all entries of \(H_M\) are in \(\{-1,1\}\).
Let \(m\geq 1\) be any integer. Then, the Hadamard matrix \(H_{2^m}\) has the following properties:
(i) The first row of \(H_{2^m}\) is the all-one vector.
(ii) For every \(j\geq 2\), the \(j\)-th row of \(H_{2^m}\) is balanced, i.e, contains exactly \(2^{m-1}\) entries equal to \(1\).
(iii) Every two distinct rows are orthogonal; that is, for every \(1\leq i<j\leq 2^m\), the \(i\)-th and \(j\)-th row agree (resp. disagree) on exactly \(2^{m-1}\) entries.
Fix any \(m\geq 1\). The Hadamard matrix \(H_{2^m}\) corresponds to the Walsh–Hadamard transform (or Fourier transform; see, for example, [36]). Specifically, for any two functions \(f,g\colon \{0,1\}^m\to \mathbb{R}\), define the inner product \(\mleft\langle f, g \mright\rangle\) over \(\mathbb{R}^{\{0,1\}^m}\) as \[\mleft\langle f, g \mright\rangle :=\frac{1}{2^m}\sum_{x\in\{0,1\}^m} f(x)g(x),\] and let \(\lVert\cdot{\rVert}\) denote the norm induced by this inner product. Moreover, the functions \(\chi_S\colon \{0,1\}^m\to\mathbb{R}\) defined for every \(S\subseteq [m]\) by \(\chi_S(x) = (-1)^{ \mleft\langle x, S \mright\rangle } = \prod_{i\in S} (-1)^{x_i}\) form an orthonormal basis, whereby every \(f\colon\{0,1\}^m \to \mathbb{R}\) can be uniquely written as \[\forall x\in\{0,1\}^m, \qquad f(x) = \sum_{x\in\{0,1\}^m} \hat{f}(S) \chi_S(x)\] where \(\hat{f}(S) := \mleft\langle f,\chi_S \mright\rangle\). The Walsh–Hadamard matrix specifies this transformation of basis. Specifically, we note following standard fact:
Let \(m\geq 1\). Then, for every \(x\in\{0,1\}^m\) and subset \(S\subseteq[m]\) identified to its characteristic vector \(s\in\{0,1\}^m\), we have that \[(H_{2^m})_{s,x} = (H_{2^m})_{x,s} = \chi_S(x)\,.\]
This spectral view of Walsh–Hadamard matrix leads to Parseval’s Theorem, which is instrumental in design of our tests based on HR.
Theorem 1 (Parseval’s Theorem). For every function \(f\colon\{0,1\}^m\to\mathbb{R}\), \[\lVert f{\rVert}^2 = \sum_{S\subseteq [m]} \hat{f}(S)^2\,.\]
While all the LDP mechanisms underlying our proposed sample-optimal tests in this paper can be cast as symmetric mechanisms, the next result shows that asymmetric mechanisms can in any case yield at most a logarithmic-factor improvement in sample complexity over symmetric ones.
Lemma 1. Suppose that there exists a private-coin (respectively public-coin) LDP mechanism for some task \(\mathcal{T}\) with \(n\) users and probability of success \(5/6\). Then, there exists a private-coin (respectively public-coin) symmetric* LDP mechanism for \(\mathcal{T}\) with \(n'=O(n\log n)\) users and probability of success \(2/3\).*
Proof. Let \(W=(W_i)_{i\in[n]}\) be the purported mechanism, with \(W_i\colon {\cal X}\to{\cal Y}\) being the mapping of the \(i\)-th user. We create a symmetric (randomized) mechanism \(\tilde{W}\colon{\cal X}\to[n]\times{\cal Y}\) as follows: On input \(x\in{\cal X}\), use private (respectively public) randomness to generate \(I\in[n]\) uniformly at random (and independently of everything else); and output \((I, W_I(x))\).7
Clearly, the resulting mechanism is symmetric. Further, by a standard coupon-collector argument, for \(n'=O(n\log n)\) we have that with probability at least \(5/6\), each \(i\in[n]\) will be drawn at least once. Whenever this is the case, upon gathering all the outputs, the referee can then select a subset of \(n\) outputs and simulate the original mechanism, having received the output of \(W_1,\dots, W_n\). Overall, the probability of failure is at most \(1/6+1/6=1/3\) by a union bound. ◻
We conclude this section with simple algorithms for identity and independence testing for the case when \(\Omega = \{0,1\}\), i.e, for support size \(k= 2\). These algorithms will be used later in our optimal tests based on Raptor.
First, we deal with the problem of estimating the bias of a coin up to an additive accuracy of \(\pm\gamma\), when the outcomes of coin tosses can be accessed via an \(\varepsilon\)-LDP mechanism. Note that this yields as a corollary an algorithm for identity testing over \(\{0,1\}\). Indeed, to test if the generating distribution \(p\) equals \(q\in \Delta(\{0,1\})\) or is \(\gamma\)-far from it, we estimate probability \(p(0)\) to additive \(\pm \gamma/2\) and compare it with \(q(0)\). The following result is a folklore and is included for completeness.
Lemma 2 (Locally Private Bias Estimation, Warmup). For \(\varepsilon\in(0,1]\), an estimate of the bias of a coin with an additive accuracy of \(\gamma\) can be obtained using \(O\!\left(1/(\gamma^2\varepsilon^2)\right)\) samples via \(\varepsilon\)-LDP RR. Moreover, any estimate of bias obtained via \(\varepsilon\)-LDP RR must use \(\Omega\!\left(1/(\gamma^2\varepsilon^2)\right)\) samples.
Proof. Recall from 1 that an \(\varepsilon\)-LDP RR is described by the channel \(W_{\mathrm{\small RR}}(0\mid 0)=W(1\mid 1) = \frac{e^\varepsilon}{e^\varepsilon+1}\). When a \(\operatorname{Bern}\mleft( \rho \mright)\) random variable passes through this channel, the output is a Bernoulli random variable with mean \[\rho' :=\rho\frac{e^\varepsilon}{e^\varepsilon+1}+(1-\rho)\frac{1}{e^\varepsilon+1} = \frac{1}{e^\varepsilon+1} + \rho \frac{e^\varepsilon-1}{e^\varepsilon+1}.\] Therefore, estimating \(\rho\) to \(\pm\gamma\) using this mechanism is equivalent to estimating \(\rho'\) to an additive \(\gamma':= \frac{e^\varepsilon+1}{e^\varepsilon-1}\gamma\), which can be done with \(O(1/{\gamma'}^2) = O(1/(\gamma^2\varepsilon^2))\) samples (the second as \(\varepsilon \lesssim 1\)).
It remains to prove optimality. For \(k=2\), it can shown that any \(\varepsilon\)-LDP scheme can be obtained by passing output of an \(\varepsilon\)-LDP RR through another channel. Therefore, RR will require the least number of samples for estimating the bias, and it suffices to show the claimed bound of \(\Omega\!\left(1/(\gamma^2\varepsilon^2)\right)\) for RR. To that end, suppose we provide as input a Bernoulli random variable with bias \(1/2+\gamma\) to RR. Then, the output has bias \(\frac{1}{2} +\gamma\frac{e^\varepsilon-1}{e^\varepsilon+1} = \frac{1}{2}+O(\gamma\varepsilon)\). On the other hand, when the input is \(\operatorname{Bern}\mleft( 1/2 \mright)\), then the output is \(\operatorname{Bern}\mleft( 1/2 \mright)\) as well. Therefore, distinguishing between a \(\operatorname{Bern}\mleft( 1/2 \mright)\) and a \(\operatorname{Bern}\mleft( 1/2+\gamma \mright)\) using samples from an \(\varepsilon\)-LDP RR is at least as hard as distinguishing \(\operatorname{Bern}\mleft( 1/2 \mright)\) and \(\operatorname{Bern}\mleft( 1/2 +O(\gamma\varepsilon) \mright)\) without privacy constraints. This latter task is known to require the stated number of samples. ◻
As a corollary of 2, we obtain an algorithm for locally private independence testing for \(k=2\), which, too, will be used later in the paper.
Corollary 1. For \(\varepsilon\in (0,1]\), there exists a symmetric, private-coin \(\varepsilon\)-LDP mechanism that tests whether a distribution over \(\{0,1\}\times\{0,1\}\) is a product distribution or \(\gamma\)-far from any product distribution using \(O\!\left(1/(\gamma^2\varepsilon^2)\right)\) samples.
Proof. Consider a distribution \(p\) over \(\{0,1\} \times \{0,1\}\) with marginals \(p_1\) and \(p_2\). Note that \[\left\lvert p(0,0)-p_1(0)p_2(0)|=|p(x,y)-p_1(x)p_2(y) \right\rvert, \quad x,y\in \{0,1\}.\] Thus, if \(p\) is \(\gamma\)-far in total variation distance from any product distribution, it must hold that \({\operatorname{d}_{\rm TV}^{}\!\left({p, p_1\otimes p_2}\right)}\geq \gamma\), which in view of the equation above yields \(|p(0,0)-p_1(0)p_2(0)|\geq \gamma/2\). Using this observation, we can test for independence using \(O(1/(\varepsilon^2\gamma^2))\) samples as follows. First, note that for any symbol \(x\), \(p(x)\) can be estimated up to an accuracy \(\gamma\) using \(O(1/(\varepsilon^2\gamma^2))\) samples by converting the observation \(X\) to the binary observation \(\mathbb{1}_{\left\{X=x\right\}}\) and applying the estimator of 2. Thus, we can estimate \(p(0,0)\), \(p_1(0)\), and \(p_2(0)\) up to an accuracy \(\gamma/16\) by assigning \(O(1/(\varepsilon^2\gamma^2))\) samples each for them. Denote the respective estimates by \(\tilde{p}(0,0)\), \(\tilde{p}_1(0)\), and \(\tilde{p}_2(0)\). When \(p(0,0)=p_1(0)p_2(0)\), \[|\tilde{p}(0,0)-\tilde{p}_1(0)\tilde{p}_2(0)|\leq |\tilde{p}(0,0)-p(0,0)|+ \tilde{p}_1(0)-p_1(0)|+ |\tilde{p}_2(0)-p_2(0)| \leq \frac{3}{16} \gamma.\] On the other hand, when \(|p(0,0)-p_1(0)p_2(0)|\geq \gamma/2\), we have \[|\tilde{p}(0,0)-\tilde{p}_1(0)\tilde{p}_2(0)| \geq |p(0,0)-p_1(0)p_2(0)|- |\tilde{p}(0,0)-p(0,0)|- |\tilde{p}_1(0)-p_1(0)|- |\tilde{p}_2(0)-p_2(0)| \geq \frac{5}{16}\gamma.\] Thus, for \(k=2\), locally private independence testing can be performed with \(O(1/(\varepsilon^2\gamma^2))\) samples by estimating the probabilities \(p(0,0)\), \(p_1(0)\), \(p_2(0)\) and comparing \(\left\lvert \tilde{p}(0,0)-\tilde{p}_1(0)\tilde{p}_2(0) \right\rvert\) to the threshold \(\gamma/4\). ◻
In this section, we provide two locally private mechanisms for uniformity testing. As discussed earlier, this in turn provides similar mechanisms for identity testing as well. These two tests, based respectively on the symmetric, private-coin mechanisms Rappor and HR, will be seen to have the same sample complexity of \(O(k^{3/2}/\gamma^2\varepsilon^2)\). However, the first has the advantage of being based on a widespread mechanism, while the second is more efficient in terms of both time and communication.
Given \(n\) independent samples from \(p\), let the output of Rappor applied to these samples be denoted by \({\boldsymbol{b}}_1, \ldots, {\boldsymbol{b}}_n\in\{0,1\}^k\), where \({\boldsymbol{b}}_i = ({\boldsymbol{b}}_{i1}, \ldots, {\boldsymbol{b}}_{ik})\) for \(i\in[n]\). The following fact is a simple consequence of the definition of Rappor.
Let \(i,j\in[n]\), and \(x,y\in[k]\). \[\Pr\mleft[\, {\boldsymbol{b}}_{ix} =1, {\boldsymbol{b}}_{jy}=1\, \mright] = \begin{cases} (\alpha_{R}p(x)+\beta_{R})(\alpha_{R}p(y)+\beta_{R}) & \text{ if } i\neq j\\ (\alpha_{R}p(x)+\beta_{R})(\alpha_{R}p(y)+\beta_{R})-\alpha_{R}^2p(x)p(y) & \text{ if } i=j,\, x\neq y\\ \alpha_{R} p(x) + \beta_{R} & \text{ if } i=j,\, x= y\\ \end{cases}\] where \(\alpha_{R},\beta_{R}\) are defined as in 2 .
A natural idea would be to try and estimate \({\lVert p{\rVert}}_2^2\) by counting the collisions from the output of Rappor. Since this only adds post-processing to Rappor, which is LDP, the overall procedure does not violate the \(\varepsilon\)-LDP constraint. For \(\sigma_{i,j}^x\) defined as \(\mathbb{1}_{\left\{{\boldsymbol{b}}_{ix} =1, {\boldsymbol{b}}_{jx}=1 \right\}}\), \(x\in[k]\), \(i\neq j\), the statistic \(S:=\sum_{1\leq i<j\leq n} \sum_{x\in[k]} \sigma_{i,j}^x\) counting collisions over all samples and differentially private symbols can be seen to have expectation \[\mathbb{E}\mleft[S\mright] = \binom{n}{2}\left(\alpha_{R}^2{\lVert p{\rVert}}_2^2+2\alpha_{R}\beta_{R} + k\beta_{R}^2 \right) \asymp \frac{1}{2}\varepsilon^2n^2{\lVert p{\rVert}}_2^2+ \Theta(k)\,.\] Up to the constant normalizing factor, this suggests an unbiased estimator for \({\lVert p{\rVert}}_2^2\), and thereby also for \({\lVert p-u{\rVert}}_2^2 ={\lVert p{\rVert}}_2^2 - 1/k\). However, the issue lies with the variance of this estimator. Indeed, it can be shown that \(\operatorname{Var}\mleft(S\mright) \approx n^3k\) (for constant \(\varepsilon\)). Thus, if we use this statistic to distinguish between \({\lVert p{\rVert}}_2^2=1/k\) and \({\lVert p{\rVert}}_2^2 >(1+\Omega(\gamma^2))/k\) for uniformity testing, we need \[\sqrt{n^3k} \ll n^2 \varepsilon^2\cdot \frac{\gamma^2}{k}\] \(i.e.\), \(n\gg k^3/(\gamma^4\varepsilon^4)\). This sample requirement turns out to be off by a quadratic factor, and even worse than the trivial upper bound obtained by learning \(p\).
We now propose our testing mechanism based on Rappor, which, in essence, uses a privatized version of a \(\chi^2\)-type statistic of [17], [18], [25]. For \(x\in[k]\), let the number of occurrences of \(x\) among the \(n\) (privatized) outputs of Rappor be \[\label{eq:rappor:nx} N_x :=\sum_{j=1}^n\mathbb{1}_{\left\{{\boldsymbol{b}}_{jx}=1\right\}}\tag{7}\] which by the definition of Rappor follows a \(\operatorname{Bin}\mleft( n, \alpha_{R}p(x)+\beta_{R} \mright)\) distribution. Now, letting \[\label{eq:rappor:z} T :=\sum_{x\in[k]} \left( \left( N_x-(n-1)\left(\frac{\alpha_{R}}{k}+\beta_{R}\right) \right)^2 - N_x \right) + k(n-1)\left(\frac{\alpha_{R}}{k}+\beta_{R}\right)^2\tag{8}\] we get a statistic, applied to the output of Rappor, which (as we shall see) is up to normalization an unbiased estimator for the squared \(\ell_{2}\) distance of \(p\) to uniform. The main difference with the naive approach we discussed previously, however, lies in the extra linear term. Indeed, the collision-based statistic was of the form \[S \propto \sum_{x\in[k]} \left( N_x^2 - N_x \right),\] and in comparison, keeping in mind that \(N_x\) is typically concentrated around its expected value of roughly \(n/2\), our new statistics can be seen to take the form \[T \approx \sum_{x\in[k]} \left( N_x^2 - nN_x \right) + \Theta(kn^2),\] since \(\beta_{R} \approx 1/2\). That is, now the fluctuations of the quadratic term are reduced significantly by the subtracted linear term, bringing down the variance of the statistic.
This motivates our testing algorithm based on Rappor, 4, and leads to the main result of this section:
Theorem 2. For \(\varepsilon\in (0,1]\), 4 based on \(\varepsilon\)-LDP Rappor can test whether a distribution is uniform or \(\gamma\)-far from uniform using \[O\left(\frac{k^{3/2}}{\gamma^2\varepsilon^2}\right)\] samples.
Proof of 2. Clearly, since Rappor is an \(\varepsilon\)-LDP mechanism, the overall 4 does not violate the \(\varepsilon\)-LDP constraint. We now analyze the error performance of the proposed test, which we will do simply by using Chebyshev’s inequality. Towards that, we evaluate the expected value and the variance of \(T\).
The following evaluation of expected value of statistic \(T\) uses a simple calculation entailing moments of a Binomial random variable:
Lemma 3. With \(T\) defined as above, we have \[\mathbb{E}\mleft[T\mright] = n(n-1)\alpha_{R}^2{\lVert p-u{\rVert}}_2^2\] where the expectation is taken over the private-coins used by Rappor and the samples drawn from \(p\). In particular, (i) if \(p=u\), then \(\mathbb{E}\mleft[T\mright]=0\); while (ii) if \({\operatorname{d}_{\rm TV}^{}\!\left({p, u}\right)}>\gamma\), then \(\mathbb{E}\mleft[T\mright]> 2n(n-1)\frac{\alpha_{R}^2\gamma^2}{k}\).
Proof. Letting \(\lambda :=\left(\frac{\alpha_{R}}{k}+\beta_{R}\right)\) and using the fact that \(\mathbb{E}\mleft[N_x^2\mright] = \mathbb{E}\mleft[N_x\mright] + (1-\frac{1}{n})\mathbb{E}\mleft[N_x\mright]^2\), we have \[\begin{align} \mathbb{E}\mleft[T\mright] &= \sum_{x\in[k]} \mathbb{E}\mleft[ \left( N_x-(n-1)\lambda \right)^2 - N_x \mright] + k(n-1) \lambda^2 \\ &= \sum_{x\in[k]} \left( \mathbb{E}\mleft[N_x^2\mright] - 2(n-1)\lambda \mathbb{E}\mleft[N_x\mright] + (n-1)^2\lambda^2 - \mathbb{E}\mleft[N_x\mright] \right) + k(n-1) \lambda^2 \\ &= \sum_{x\in[k]} \left( \frac{n-1}{n}\mathbb{E}\mleft[N_x\mright]^2 - 2(n-1)\lambda \mathbb{E}\mleft[N_x\mright] + n(n-1)\lambda^2 \right) \\ &= n(n-1)\sum_{x\in[k]} \left( \frac{\mathbb{E}\mleft[N_x\mright]^2}{n^2} - 2\lambda \frac{\mathbb{E}\mleft[N_x\mright]}{n} + \lambda^2 \right) \; = n(n-1)\sum_{x\in[k]} \left(\frac{\mathbb{E}\mleft[N_x\mright]}{n}-\lambda\right)^2, \end{align}\] which, along with the observation that \(\frac{\mathbb{E}\mleft[N_x\mright]}{n}-\lambda = \alpha_{R}\left(p(x)-1/k\right)\), gives the result. ◻
Turning to the variance, we get the following:
Lemma 4. With \(T\) defined as above, we have \[\operatorname{Var}\mleft(T\mright) \leq 4kn^2 + 8n^3 \alpha_{R}^2 {\lVert p-u{\rVert}}_2^2 = 4kn^2 + 8n\mathbb{E}\mleft[T\mright]\,.\]
The proof of this lemma is quite technical and relies on a tedious analysis of the covariance of the random variables \((N_x)_{x\in[k]}\), in view of bounding quantities of the form \(\operatorname{Cov}(f(N_x), f(N_y))\). We defer the details to 8.
With these two lemmata, we are in a position to conclude the argument. Suppose \(n\geq C\cdot \frac{k^{3/2}}{\alpha_{R}^2\gamma^2}\), for some constant \(C>0\) to be specified later. Recall that \(\alpha_{R} = \varepsilon/4+o(\varepsilon)\) when \(\varepsilon\to 0\), leading to the claimed sample complexity.
First, consider the case when \(p=u\). In this case \(\mathbb{E}\mleft[T\mright]=0\) and \(\operatorname{Var}\mleft(T\mright)\leq 4kn^2\) by 3 4, and so by Chebyshev’s inequality \[\Pr\mleft[\, T \geq n^2\frac{\alpha_{R}^2\gamma^2}{k} \, \mright] \leq \frac{ k^2\operatorname{Var}\mleft(T\mright) }{ n^4\alpha_{R}^4\gamma^4 } \leq \frac{17k^3}{8n^2\alpha_{R}^4\gamma^4} < \frac{3}{C^2}\] which is at most \(1/3\) for \(C\geq 3\).
Next, when \({\operatorname{d}_{\rm TV}^{}\!\left({p, u}\right)}>\gamma\), \(\mathbb{E}\mleft[T\mright]>2n^2\frac{\alpha_{R}^2\gamma^2}{k}\) and \(\operatorname{Var}\mleft(T\mright)\leq 4kn^2 + 8n\mathbb{E}\mleft[T\mright]\), and again by Chebyshev’s inequality \[\Pr\mleft[\, T < n^2\frac{\alpha_{R}^2\gamma^2}{k} \, \mright] \leq \Pr\mleft[\, T < \frac{1}{2}\mathbb{E}\mleft[T\mright] \, \mright] \leq \frac{ 4\operatorname{Var}\mleft(T\mright) }{ \mathbb{E}\mleft[T\mright]^2 } \leq \frac{17k^3}{2n^2\alpha_{R}^4\gamma^4} + \frac{10k}{n\alpha_{R}^2\gamma^2} \leq \frac{17}{2C^2} + \frac{10}{C\sqrt{k}}\] which is at most \(1/3\) for \(C\geq 23\). Taking \(C = 23\) concludes the proof of 2. ◻
Although the Rappor-based mechanism of 3.1 achieves a significantly improved sample complexity over the naive learning-and-testing approach, it suffers several shortcomings. The most apparent is its time complexity: inherently, the one-hot encoding procedure used in Rappor leads to a time complexity of \(\Theta(kn)\), with an extra linear dependence on the alphabet size \(k\), which is far from the “gold standard” of \(O(n)\) complexity.
A more time-efficient procedure is obtained using HR. In fact, we describe an algorithm for testing uniformity based on HR that has the same sample complexity as the one based on Rappor described above, but is much more time-efficient.
Theorem 3. For \(\varepsilon\in (0,1]\), 5 based on \(\varepsilon\)-LDP HR can test whether a distribution is uniform or \(\gamma\)-far from uniform using \[O\left(\frac{k^{3/2}}{\gamma^2\varepsilon^2}\right)\] samples. Moreover, the algorithm runs in time near-linear in the number of samples.
To describe the intuition behind this algorithm, suppose we feed inputs from an input distribution \(p\in\Delta\mleft([k]\mright)\) to the more general mechanism in 2.2.0.3, whose output then follows some induced distribution \(q\in\Delta\mleft([K]\mright)\). A natural hope is that whenever \(p\) is uniform (over \([k]\)), then \(q\) is uniform (over \([K]\)), too; and that conversely if \(p\) is not uniform, then \(q\) is neither, and that the distance to uniformity is preserved. This is not exactly what we will obtain. However, we can get something close to it in the next result, which suffices for our purpose.8
Theorem 4. Let \(\varepsilon\in(0,1]\), \(K=O(k)\) be a power of \(2\), and denote by \(q\) the output distribution over \([K]\). Then, we have \[\begin{align} {\lVert q-q^\ast{\rVert}}_2^2= \frac{\alpha_{H}^2}{K}\cdot {\lVert p-u{\rVert}}_2^2 \asymp \frac{\varepsilon^2}{k}{\lVert p-u{\rVert}}_2^2\,, \end{align}\] where \(\alpha_{H} :=\frac{e^{\varepsilon}-1}{e^{\varepsilon}+1}\), and \(q^\ast\in\Delta\mleft([K]\mright)\) is an explicit distribution, efficiently computable and independent of \(p\), with \({\lVert q^\ast{\rVert}}_2\leq (1+\alpha_{H})/\sqrt{K}\). Moreover, \(q^\ast\) can be sampled in time \(O(\log K)\).
Thus, when \(p=u\), we get \(q=q^\ast\). Otherwise when \({\operatorname{d}_{\rm TV}^{}\!\left({p, u}\right)}>\gamma\), then \[\begin{align} {\lVert q-q^\ast{\rVert}}_2^2 > \frac{4\alpha_{H}^2\gamma^2}{kK} =\Theta\!\left(\frac{\varepsilon^2}{k^2}\gamma^2\right). \end{align}\]
The observation above suggests that if we can estimate the \(\ell_{2}\) distance between \(q\) and \(q^\ast\), we can get our desired uniformity test. We facilitate this by invoking the result below, which follows from the \(\ell_{2}\)-distance estimation algorithm of [18], combined with an observation from [29]:9
Theorem 5 (Adapted from [18]). For two unknown distributions \(p,q\in\Delta\mleft([k]\mright)\), there exists an algorithm \(\mathrm{\small Test}\)-\(\ell_{2}\) that distinguishes with probability at least \(2/3\) between the cases \({\lVert p-q{\rVert}}_2 \leq \gamma/2\) and \({\lVert p-q{\rVert}}_2 > \gamma\) by observing \(O(\min({\lVert p{\rVert}}_2,{\lVert q{\rVert}}_2)/\gamma^2)\) samples from each. Moreover, this algorithm runs in time near-linear in the number of samples.
We apply the algorithm of 5 to our case by generating desired number of samples from \(q^\ast\), which can simply be obtained by passing samples from the uniform distribution via HR, and using them along with the samples observed from \(q\) at the output of HR. We need to distinguish between the cases \(q=q^\ast\) and \({\lVert q-q^\ast{\rVert}}_2>\gamma'/\sqrt{K}\), which by the previous result can be done using \(O({\lVert q^\ast{\rVert}}_2K/\gamma'^2)\) samples where \(\gamma':=2\alpha_{H}\gamma/\sqrt{k}\). Substituting \(K=O(k)\) and \({\lVert q^\ast{\rVert}}_2=O(1/\sqrt{K})\), the number of samples we need is \[O\!\left(\frac{1}{\sqrt{K}}\cdot K \cdot \left(\frac{\sqrt{k}}{\gamma\varepsilon}\right)^2\right) = O\!\left(\frac{k^{3/2}}{\gamma^2\varepsilon^2}\right),\] which is our claimed sample complexity.
The time complexity follows from the efficiency of Hadamard encoding (see [8]), which allows each player to generate their private sample in time \(O(\log K)=O(\log k)\), and to send only \(O(\log k)\) bits.10 After this, running the \(\mathrm{\small Test}\)-\(\ell_{2}\) algorithm takes time \(O(n\log K+n\log n)\), the first term being the time required to generate \(n\) samples from \(q^\ast\). Thus, to conclude the proof of 3, it only remains to establish 4 – which we do next.
Proof of 4. For any \(z\in[K]\), let \(D_z\subseteq[k]\) be the set of symbols \(x\) such that \(z\in C_x\). Then, from 3 (recalling that \(s=K/2\)) we get \[\begin{align} q(z) &= \sum_{x\in D_z} W(z\mid x)p(x) + \sum_{x\in D_z} W(z\mid x)p(x) \nonumber \\ &= \frac{1}{s}\left( p(D_z) \frac{e^\varepsilon}{e^\varepsilon+1} + p(D_z^c) \frac{1}{e^\varepsilon+1} \right) +\frac{1}{K}\cdot\frac{e^\varepsilon-1}{e^\varepsilon+1}\cdot\left(p(D_z)-p(D_z^c)\right) \nonumber \\ &=\frac{1}{K} + \frac{\alpha_{H}}{K}\left(2p(D_z)-1\right)\,. \label{eq:expression:output} \end{align}\tag{9}\] Define \(q^\ast\in\Delta\mleft([K]\mright)\) as \[\label{eq:def:qast} q^\ast(z) :=\frac{1}{K} + \frac{\alpha_{H}}{K}\left(\frac{2\left\lvert D_z \right\rvert}{k}-1\right), \quad \forall z\in[K],\tag{10}\] so that \(q^\ast(z) \in [(1-\alpha_{H})/K, (1+\alpha_{H})/K]\) for every \(z\) and \({\lVert q^\ast{\rVert}}_2 \leq (1+\alpha_{H})/\sqrt{K}\). From 9 10 , we get \[\label{eq:normtwo:q:expression} {\lVert q-q^\ast{\rVert}}_2^2 = \sum_{z\in[K]}\left(q(z) -q^\ast(z)\right)^2 = \frac{4\alpha_{H}^2}{K^2}\sum_{z\in[K]} \left( p(D_z)-\frac{\left\lvert D_z \right\rvert}{k} \right)^2.\tag{11}\]
Note that we may view a probability distribution \(p\in\Delta\mleft([k]\mright)\) as a function \(\boldsymbol{p}\colon \{0,1\}^k\to \mathbb{R}\) with \[\boldsymbol{p}(s) = p(S) = \sum_{x\in S} p(x), \quad \forall s\in\{0,1\}^k,\] where we identify \(s\in\{0,1\}^k\) with the subset \(S= \left\{\; x\in[k] \;\colon\; s_x = 1\; \right\} \subseteq [k]\) and use the two notations interchangeably. Also, from [fact:hadamard:fourier] and the definition of the \(C_x\) as sets encoded by the rows of the matrix \(H_K\), we have that \[\chi_{\phi(x)}(z) = (H_K)_{\phi(x),z} = 2\mathbb{1}_{\left\{z\in C_x\right\}} - 1, \quad \forall\, z\in[K], x\in[k],\] whereby \[\sum_{x\in[k]} \left( p(x) - \frac{1}{k} \right)\chi_{\phi(x)}(z) = 2\left( p(D_z)-\frac{\left\lvert D_z \right\rvert}{k} \right), \quad \forall\, z\in[K].\] Now, consider the function \(g\colon [K]\to \mathbb{R}\) defined by \(g(z) = 2\left( p(D_z)-\left\lvert D_z \right\rvert/k\right)\),11. Using the previous equation, we can view \(g\) alternatively as \[g(z) = \sum_{T\in\phi([k])}\left( p( \phi^{-1}(T) ) - \frac{1}{k} \right)\chi_T(z), \quad \forall\, z\in[K].\] Therefore, \[\hat{g}(T) = \sum_{x\in[k]}\left( p(x) - 1/k\right)\mathbb{1}_{\left\{T=\phi(x)\right\}}, \quad \forall\, T\in[K],\] which by Parseval’s theorem (1) gives \[\begin{align} \nonumber \frac{4}{K}\sum_{z\in[K]} \left( p(D_z)-\frac{\left\lvert D_z \right\rvert}{k} \right)^2 = \lVert g{\rVert}^2 = \sum_{T\in [K]} \hat{g}(T)^2 = \sum_{x\in[k]} \left( p(x) - \frac{1}{k} \right)^2 = {\lVert p-u{\rVert}}_2^2\,. \end{align}\] The identity above, together with 11 , yields \[{\lVert q-q^\ast{\rVert}}_2^2 = \frac{\alpha_{H}^2}{K}{\lVert p-u{\rVert}}_2^2\,.\] The claimed result then follows from the fact that \(\alpha_{H}=\frac{\varepsilon}{2}+o(\varepsilon)\). ◻
In the foregoing treatment, we saw that existing (private-coin) mechanisms such as Rappor and HR can perform uniformity testing using \(O(k^{3/2}/(\gamma^2 \varepsilon^2))\) samples at best. In this section, we describe our public-coin mechanism, Raptor,12 and use it to design an algorithm for testing uniformity that requires only \(O(k/(\gamma^2 \varepsilon^2))\) samples and constant communication13 per sample.
Our algorithm builds upon the warmup algorithm of 2, which allows us to perform uniformity testing for \(k=2\) using \(O(1/(\gamma^2\varepsilon^2))\) samples. Specifically, we use public randomness to reduce the uniformity testing problem for an arbitrary \(k\) to that for \(k=2\), albeit with \(\gamma\) replaced with \(\gamma/\sqrt{k}\); and then apply the warmup algorithm.
To enable the aforementioned reduction, we need to show that the probabilities of a randomly generated set differ appropriately under the uniform distribution and a distribution that is \(\gamma\) far from uniform in total variation distance. To accomplish this, we prove a more general result which might be of independent interest. We say that random variables \(X_1, X_2, \dots, X_k\) are \(4\)-symmetric if \(\mathbb{E}\mleft[X_{i_1}X_{i_2}X_{i_3}X_{i_4}\mright]\) depends only on the number of times each element appears in the multiset \(\{i_1, i_2, i_3, i_4\}\).14 The following result constitutes a concentration bound for \(Z = \sum_{i\in [k]}\delta_iX_i\) for a probability perturbation \(\delta\).
Theorem 6 (Probability perturbation concentration). Consider a vector \(\delta\) such that \(\sum_{i\in [k]}\delta_i = 0\). Let random variables \(X_1, \dots, X_k\) be \(4\)-symmetric and \(Z = \sum_{i\in [k]}\delta_iX_i\). Then, for every \(\alpha \in (0,1/4)\), \[\Pr\mleft[\, \bigg(\mathbb{E}\mleft[X_1^2\mright] - \mathbb{E}\mleft[X_1X_2\mright]\bigg) - \sqrt{\frac{38 \alpha}{1-2\alpha}\mathbb{E}\mleft[X_1^4\mright]} \leq \frac{Z^2}{{\lVert\delta{\rVert}}_2^2} \leq \frac{1}{1-2\alpha} \bigg(\mathbb{E}\mleft[X_1^2\mright] - \mathbb{E}\mleft[X_1X_2\mright]\bigg) \, \mright] \geq \alpha.\]
The proof requires a careful evaluation of the second and the fourth moments of \(Z\) and is deferred to 7. As a corollary, we obtain the result below, which is at the core of our reduction argument.
Corollary 2. Consider a distribution \(p\in \Delta\mleft([k]\mright)\) such that \({\operatorname{d}_{\rm TV}^{}\!\left({p, u}\right)}>\gamma\). For a random subset \(S\) of \([k]\) distributed uniformly over all subsets of \([k]\) of cardinality \(k/2\), it holds that \[\Pr\mleft[\, \left\lvert p(S)-\frac{1}{2} \right\rvert>\frac{\gamma}{\sqrt{5k}}\, \mright]>\frac{1}{477}\,.\]
Proof. Let \(Y_1, \dots, Y_k\) be independent random bits, and let \(X_1, \dots, X_k\) be obtained by conditioning \((Y_1, \dots, Y_k)\) on the event \(\sum_{i\in [k]}X_i = k/2\). Consider the random set \(S\) defined as \[S = \left\{\; i\in[k] \;\colon\; X_i =1\; \right\} .\] Letting \(\delta :=p- u\), we have \[p(S) - u(S) = p(S) - \frac{1}{2} = \sum_{i\in[k]}\delta_iX_i.\] Note that \(\mathbb{E}\mleft[X_1^2\mright] = \mathbb{E}\mleft[X_1^4\mright] =1/2\). Also, \[\begin{align} \mathbb{E}\mleft[X_1X_2\mright] &= \frac{1}{2} \Pr\mleft[\, X_2=1 \;\middle\vert\; X_1=1\, \mright] \\ &= \frac{1}{2} \Pr\mleft[\, Y_2=1 \;\middle\vert\; Y_1=1, \sum_{i=1}^kY_i =\frac{k}{2} \, \mright] \\ &= \frac{1}{2} \Pr\mleft[\, Y_2=1 \;\middle\vert\; \sum_{i=2}^kY_i =\left(\frac{k}{2} -1\right)\, \mright] \\ &= \frac{1}{2} \mathbb{E}\mleft[\, Y_2 \;\middle\vert\; \sum_{i=2}^kY_i =\left(\frac{k}{2} -1\right)\, \mright] \end{align}\] which by symmetry yields \[\mathbb{E}\mleft[X_1X_2\mright] = \frac{1}{2} \mathbb{E}\mleft[\, Y_j \;\middle\vert\; \sum_{i=2}^kY_i =\left(\frac{k}{2} -1\right)\, \mright], \quad \forall\, 2\leq j\leq k.\] Taking the average of the right-side, we get \[\mathbb{E}\mleft[X_1X_2\mright] = \frac{1}{2(k-1)} \mathbb{E}\mleft[\, \sum_{j=2}^kY_j \;\middle\vert\; \sum_{i=2}^k Y_i =\left(\frac{k}{2} -1\right)\, \mright] =\frac{(k -2)}{4(k-1)} \leq \frac{1}{4}.\] Finally, note that \[{\lVert\delta{\rVert}}_2^2 \geq \frac{1}{k} {\lVert\delta{\rVert}}_1^2 \geq \frac{4\gamma^2}{k},\] so that, applying 6 to \(Z = \sum_{i=1}^k\delta_i X_i\) with \(\alpha :=1/477\) we get \[\Pr\mleft[\, Z^2 >\frac{\gamma^2}{5k}\, \mright] \geq \frac{1}{477},\] which completes the proof. ◻
Armed with this result, we can divide our LDP testing problem into two parts: A public-coin \(\varepsilon\)-LDP mechanism releases \(1\)-bit per sample to the curator, and the curator applies a test to the received bits to accomplish uniformity testing. This specific mechanism suggested by the previous corollary is our Raptor(see 3 for a description). While in this paper we have only considered its use for testing uniformity and independence, since it provides locally private \(1\)-bit outputs that, in essence, preserve the \(\ell_{2}\) distance of the underlying distribution from any other fixed one, we can foresee many other use-cases for Raptor and pose it as a standalone mechanism of independent interest.
Recall that in Raptor the curator and the users pick a random subset \(S\) of size \(k/2\) from their shared randomness, and each user sends the indicator function that its input lies in this set \(S\) using \(\varepsilon\)-LDP RR. This is precisely the \(1\)-bit information from samples required to enable the estimator of 2. Note that when the underlying distribution \(p\) is uniform, the probability \(p(S)\) of user bit being \(1\) is exactly 1/2. Also, by 2 when \(p\) is \(\gamma\)-far from uniform we have \(p(S) = 1/2\pm\Omega(\gamma/\sqrt{k})\) with a constant probability (over the choice of \(S\)); by repeating the protocol a constant number of times,15 we can ensure that with high constant probability at least one of the choices of \(S\) will indeed have this property. Therefore, we obtain an instance of the uniformity testing problem for \(k=2\), namely the problem of privately distinguishing a \(\operatorname{Bern}\mleft( 1/2 \mright)\) from \(\operatorname{Bern}\mleft( 1/2\pm \frac{c_1\gamma}{\sqrt{k}} \mright)\). Thus, when we apply Raptor to the samples, the curator gets the \(1\)-bit updates required by 2 to which it can apply the estimator prescribed in 2 to solve the underlying uniformity testing instance for \(k=2\) using \[O\left({\frac{k}{\gamma^2}\frac{(e^\varepsilon+1)^2}{(e^\varepsilon-1)^2}}\right)\] samples. Since we used \(\varepsilon\)-LDP RR to send each bit, Raptor, too, is \(\varepsilon\)-LDP and thereby so is our overall uniformity test.
We summarize the overall algorithm and its performance below.
Theorem 7. For \(\varepsilon\in (0,1]\), 6 based on \(\varepsilon\)-LDP Raptor can test whether a distribution is uniform or \(\gamma\)-far from uniform using \[O\left(\frac{k}{\gamma^2\varepsilon^2}\right)\] samples.
Proof of 7. The proof of correctness follows the foregoing outline, which we describe in more detail. Let \(c:=1/477\) be the constant from 2, and let \(\delta :=\frac{c}{2(1+c)}\), and set \(\gamma' :=\frac{\gamma}{\sqrt{5k}}\). By a standard amplification argument,16 one can amplify the success probability of the private estimation procedure of 2 to \(1-\delta\), using a total of \(O(\log(1/\delta)/({\gamma'}^2\varepsilon^2))=O(1/({\gamma'}^2\varepsilon^2))\) samples (to achieve privacy \(\varepsilon\) and accuracy \(\gamma'\)).
Consider the \(t\)-th test from 6 (where \(1\leq t\leq T\)), and let \(b_t\) be the indicator that the bias estimation outputs unbiased. If \(p\) is uniform, then by the above we have \(\Pr\mleft[\, b_t = 1 \, \mright] \geq 1- \delta\) (where the probability is over the choice of the random subset \(S_t\), and the randomness of the bias estimation). However, if \(p\) is \(\gamma\)-far from uniform, by 2 it it the case that \(\Pr\mleft[\, b_t = 1 \, \mright] \leq (1-c) + c\delta = 1- (\delta+\frac{c}{2})\). Therefore, for a sufficiently large constant in the choice of \(T = \Theta(1/c^2) = \Theta(1)\), a Chernoff bound argument ensures that we can distinguish between these two cases with probability at least \(2/3\). ◻
We now establish that the public-coin testing algorithm in the previous section has optimal sample-complexity for any LDP uniformity testing algorithm. Furthermore, we establish lower bounds on the sample complexity for any LDP testing algorithm using Rappor or HR, showing that the tests we proposed using these mechanisms are sample optimal (up to constant factors) in their class.
We first show that any uniformity testing algorithm that uses data from an \(\varepsilon\)-LDP public-coin mechanism (which includes private-coin mechanisms) requires at least \(\Omega\left(k/(\gamma^2\varepsilon^2)\right)\) samples.
Theorem 8. For \(\varepsilon\in (0,1]\), any \(\varepsilon\)-LDP public-coin mechanism for uniformity testing must use \[\Omega\left(\frac{k}{\gamma^2\varepsilon^2}\right)\] samples.
Proof. Our lower bound relies on analyzing the standard “Paninski construction” [20], which we briefly recall. Assuming without loss of generality that \(k\) is even, we partition the domain in \(k/2\) consecutive pairs \((2i-1,2i)\). For a given parameter \(\gamma\in(0,1/2]\), the family of “no-instances” is the collection of \(2^{k/2}\) distributions \((p_{\theta})_{\theta\in\{-1,+1\}^{k/2}}\) where \[p_{\theta}(2i-1) = \frac{1+2\theta_i\gamma}{k}, \qquad p_{\theta}(2i) = \frac{1-2\theta_i\gamma}{k}, \qquad i\in[k/2]\,.\] Note that every such \(p_\theta\) is a total variation exactly \(\gamma\) from the uniform distribution on \([k]\).
Our starting point will be the proof of the public-coin lower bound of [19] for uniformity testing in a (non-private) distributed setting. Note that the proof in [19] proceeds by noting that once we restrict our attention to the hypothesis testing problem implied by Paninski’s construction, we can derandomize and find a deterministic protocol that outperforms the public-coin protocol. Therefore, it suffices to bound the performance of deterministic protocols. However, in our current application, relaxing to deterministic protocols will get rid of local privacy constraints and will not lead to useful bounds. Instead, we note in similar vein as the proof in [19] that we can derandomize public randomness and find a private-coin \(\varepsilon\)-LDP protocol that achieves the same performance for Paninski’s construction as the public-coin protocol we start with. Therefore, it suffices to restrict our attention to private-coin protocols.
Let \(W\) be an arbitrary \(\varepsilon\)-LDP private-coin mechanism for uniformity testing. For \(1\leq j\leq n\) and \(\theta,\theta'\in\{-1, +1\}^{k/2}\), define \(H_j(\theta, \theta')\) as \[\begin{align} H_j(\theta, \theta') &:=\frac{\gamma^2}{k} \sum_{m}\sum_{i_1,i_2\in [k/2]}\theta_{i_1}\theta'_{i_2} \frac{ \left( W_j(m \mid 2i_1-1)-W_j(m \mid 2i_1) \right) \left( W_j(m \mid 2i_2-1)-W_j(m \mid 2i_2) \right)}{ \sum_{i=1}^{k} W_j(m \mid i)}\,. \end{align}\] where \(m\in(\{0,1\}^\ast)^n\) denotes the tuple of outputs from the \(n\) users. Let \[\bar{W}_j(m) :=\frac{1}{k} \sum_{i=1}^{k} W_j(m \mid i)\] \(i.e.\), \(\bar{W}_j(m)\) is the probability of user \(j\) outputting \(m\) when the input distribution is uniform. Let \(\delta_{i,j}^m\) be such that \[W_j(m \mid 2i-1)-W_j(m \mid 2i)= \bar{W}_j(m) \delta_{i,j}^m.\] Then by the conditions for LDP, we must have \[\begin{align} \left\lvert \delta_{i,j}^m \right\rvert\leq e^\varepsilon-1\,. \end{align}\] Furthermore, we can rewrite \[\begin{align} H_j(\theta, \theta') &= \frac{\gamma^2}{k^2} \sum_{m}\sum_{i_1,i_2\in [k/2]}\theta_{i_1}\theta'_{i_2}{\bar{W}_j(m)\delta_{i_1,j}^m\delta_{i_2,j}^m} = \sum_{i_1,i_2\in [k/2]}\theta_{i_1}\theta'_{i_2}\left(\frac{\gamma^2}{k^2}\sum_{m}\bar{W}_j(m)\delta_{i_1,j}^m\delta_{i_2,j}^m\right)\\ &= \frac{\gamma^2}{k^2}\theta^T \mathbf{H}_j \theta', \end{align}\] where \(\mathbf{H}_j\) is an \([k/2]\times [k/2]\) matrix with \((i_1, i_2)\)th entry equal to \[\mathbf{H}_j(i_1, i_2) :={\sum_{m}\bar{W}_j(m)\delta_{i_1,j}^m\delta_{i_2,j}^m}\,.\] By using that \(\sum_m \bar{W}_j(m) = 1\), we further get that \[\left\lvert \mathbf{H}_j(i_1, i_2) \right\rvert \leq \left(e^\varepsilon-1\right)^2\,.\] For a given distribution \(p\in\Delta\mleft([k]\mright)\), denote by \(\mathcal{W}(p)\in\Delta\mleft((\{0,1\}^\ast)^n\mright)\) the product distribution over \(m\) (the tuple of \(n\) messages) when each user gets an independent sample from \(p\). In [19], it is shown that, with \(n\) users, the \(\chi^2\) distance between the distributions of (i) the output of the mechanism under the Paninski mixture, \(\mathcal{W}^{{\sf{}no}} :=\frac{1}{2^{k/2}}\sum_{\theta} \mathcal{W}(p_\theta)\), and (ii) the output of the mechanism under the uniform distribution \(\mathcal{W}^{\sf{}yes}:=\mathcal{W}(u)\), is bounded by \[\begin{align} \mathbb{E}_{\theta, \theta'}\left(\exp\left(\sum_{j=1}^nH_j(\theta, \theta')\right)\right)-1 =\mathbb{E}_{\theta, \theta'}\left(\exp\left(\frac{\gamma^2}{k^2}\theta^T (\sum_{j=1}^n\mathbf{H}_j)\theta'\right)\right)-1\,. \end{align}\] We will also rely on the following technical claim:
Consider random vectors \(\theta, \theta'\in\{-1, 1\}^{k/2}\) with each \(\theta_i\) and \(\theta'_i\) distributed uniformly over \(\{-1, 1\}\), independent of each other and independent for different \(i\)’s. Then, for any symmetric matrix \(H\), \[\ln \mathbb{E}_{\theta \theta'}{ e^{\lambda\theta^T H\theta'}} \leq \lambda^2 \lVert H{\rVert}_F^2, \quad \forall\, \lambda>0\,.\]
Using this claim, and choosing \(\lambda :=\frac{\gamma^2}{k^2}\) we obtain the following upper bound on the distance between the distributions of the output of the mechanisms in the two cases: \[\begin{align} {\operatorname{d}_{\rm TV}^{}\!\left({\mathcal{W}^{\sf{}no}, \mathcal{W}^{\sf{}yes}}\right)} &\leq \exp\left(\frac{\gamma^4}{k^4}\lVert\sum_{j=1}^n\mathbf{H}_j{\rVert}_F^2\right)-1 \leq \exp\left(\frac{\gamma^4}{k^4}n\left(\sum_{j=1}^n\lVert\mathbf{H}_j{\rVert}_F^2\right)\right)-1\\ &\leq \exp\left(\frac{\gamma^4 n^2}{k^4}\left((k/2)^2 \left(e^\varepsilon-1\right)^4\right)\right)-1 \leq \exp\left(\frac{\gamma^4 n^2}{4k^2}\left(e^\varepsilon-1\right)^4\right)-1\,. \end{align}\] This implies the claimed lower bound by a standard application of Le Cam’s two-point method (as e.g. detailed by Pollard [37]), as one must have \(n= \Omega(k/(\varepsilon^2\gamma^2))\) for the RHS to be \(\Omega(1)\). ◻
In this section, we prove a lower bound for any uniformity testing mechanism that uses Rappor, not only the algorithm from 3.1 (2). In fact, the next result shows that that algorithm requires the least number of samples (up to constant factors) among all mechanisms based on the output Rappor, even those allowing public-coin protocols in their post-processing stage.
Theorem 9. In the high-privacy regime, any \(\varepsilon\)-LDP mechanism for uniformity testing that uses Rappor for reporting user data must use \[\Omega\left(\frac{k^{3/2}}{\gamma^2\varepsilon^2}\right)\] samples.
Proof. We once again take recourse to Pollard’s recipe and proceed as in the proof of 8. Denote by \(W\colon [k] \to \{0,1\}^k\) the channel from the input to the output of Rappor. Letting for conciseness \(q_\varepsilon:=e^\varepsilon/(1+e^\varepsilon)\), we first observe that for any observation \(i\in [k]\) one has \[\begin{align} W(m\mid i) &= \left(m_i q_\varepsilon+ (1-m_i)(1-q_\varepsilon)\right)\cdot q_\varepsilon^{\left\lvert \left\{\; \ell \;\colon\; \ell \neq i, m_\ell =0\; \right\} \right\rvert} (1-q_\varepsilon)^{\left\lvert \left\{\; \ell \;\colon\; \ell \neq i, m_\ell =1\; \right\} \right\rvert} \\ &= m_i q_\varepsilon^{m(0)+1}(1-q_\varepsilon)^{m(1)-1} + (1-m_i) q_\varepsilon^{m(0)-1}(1-q_\varepsilon)^{m(1)+1}, \end{align}\] where \(m(0)\) and \(m(1)\), respectively, denote the number of \(0\)’s and \(1\)’s in \(m\). As was seen in the previous proof of lower bound, for our purpose, we need to evaluate \(\sum_{i \in [k]}W(m\mid i)\) and \(W(m\mid i) - W(m\mid i')\). For the former quantity, we have \[\begin{align} \sum_{i\in [k]}W(m\mid i) &= q_\varepsilon^{m(0)}(1-q_\varepsilon)^{m(1)} \left(m(1) \frac{q_\varepsilon}{1-q_\varepsilon} + m(0) \frac{1-q_\varepsilon}{q_\varepsilon}\right). \end{align}\] For the latter, we have \[\begin{align} W(m\mid i) - W(m\mid i')&= q_\varepsilon^{m(0)}(1-q_\varepsilon)^{m(1)} (m_i - m_{i'})\left(\frac{q_\varepsilon}{1-q_\varepsilon} - \frac{1-q_\varepsilon}{q_\varepsilon}\right). \end{align}\] We are now in a position to prove the lower bound. We are considering protocols where each sample \(X_j\) is reported to the center using Rappor, and so, each sample is reported using the same channel \(W\) described above. Therefore, the \(k\times k\) matrix \(\mathbf{H}_j\) used in the previous proof does not depend on \(j\) and satisfies \[\begin{align} \mathbf{H}(i_1, i_2) :=\mathbf{H}_j(i_1, i_2) &= k\sum_{m}\frac{ \left( W(m|2i_1-1)-W(m|2i_1) \right) \left( W(m|2i_2-1)-W(m|2i_2) \right)}{ \sum_{i=1}^{k} W(m\mid i)}. \end{align}\] It follows that \[\begin{align} \mathbf{H}(i_1, i_2) &= k\cdot \frac{(e^{2\varepsilon} -1 )^2}{e^{\varepsilon}} \cdot \sum_{m} q_\varepsilon^{m(0)}(1-q_\varepsilon)^{m(1)}\cdot \frac{(m_{2i_1 - 1} - m_{2i_1}) (m_{2i_2 - 1} - m_{2i_2})}{m(1)e^{2\varepsilon}+ m(0)}. \end{align}\] The key observation that facilitates our bound is that for \(i_1\neq i_2\), the sum on the right-side is \(0\). Indeed, consider the set of messages of fixed type, namely those with \(m(0)\) and \(m(1)\) fixed. Note that in any such set, only messages with \(m_{2i_1}\neq m_{2i_1-1}\) and \(m_{2i_2}\neq m_{2i_2-1}\) contribute to the sum. Furthermore, for any fixed \(m_{2i_2}\neq m_{2i_2-1}\), the contributions corresponding to \(m_{2i_1}=1, m_{2i_1-1}=0\) and \(m_{2i_1}=0, m_{2i_1-1}=1\) negate each other when \(i_1\neq i_2\), whereby the overall sum is \(0\). Thus, we have \[\begin{align} \mathbf{H}(i_1, i_2)&=\mathbb{1}_{\left\{i_1=i_2\right\}} \frac{k(e^{2\varepsilon} -1 )^2}{e^{\varepsilon}} \cdot \sum_{m} q_\varepsilon^{m(0)}(1-q_\varepsilon)^{m(1)}\cdot \frac{|m_{2i_1 - 1} - m_{2i_1}|^2 }{m(1)e^{2\varepsilon}+ m(0)} \\ &\leq \mathbb{1}_{\left\{i_1=i_2\right\}} \frac{(e^{2\varepsilon} -1 )^2}{e^{\varepsilon}} \cdot \sum_{m} q_\varepsilon^{m(0)}(1-q_\varepsilon)^{m(1)} \\ &= \mathbb{1}_{\left\{i_1=i_2\right\}} \frac{(e^{2\varepsilon} -1 )^2}{e^{\varepsilon}}, \end{align}\] where the inequality holds since \(m(1)e^{2\varepsilon} + m(0)\geq k\) for every \(\varepsilon\geq 0\). It follows that \[\lVert\mathbf{H}{\rVert}_F^2\leq k\cdot \frac{(e^{2\varepsilon} -1 )^4}{e^{2\varepsilon}},\] whereby \[\begin{align} {\operatorname{d}_{\rm TV}^{}\!\left({\mathcal{W}^{\sf{}no}, \mathcal{W}^{\sf{}yes}}\right)} &\leq \exp\left(\frac{\gamma^4n^2}{k^4}\lVert\mathbf{H}{\rVert}_F^2\right)-1 \leq \exp\left(\frac{\gamma^4n^2}{k^4}\left(k\frac{(e^{2\varepsilon}-1)^4}{e^{2\varepsilon}}\right)\right)-1\\ &\le \exp\left(\frac{\gamma^4 n^2}{e^{2\varepsilon}k^3}\left(e^{2\varepsilon}-1\right)^4\right)-1, \end{align}\] which can only be \(\Omega (1)\) if \(n= \Omega\left(\frac{k^{3/2}}{\gamma^2\left(e^\varepsilon-1\right)^2}\right)\), establishing the result. ◻
Finally, we establish the analogue of 9 for any mechanism based on Hadamard Response.
Theorem 10. In the high-privacy regime, any \(\varepsilon\)-LDP mechanism for uniformity testing that uses HR for reporting user data must use \[\Omega\left(\frac{k^{3/2}}{\gamma^2\varepsilon^2}\right)\] samples.
Proof. The proof follows the same outline as the proof of 9 – we show once again that the matrix \(\mathbf{H}\) corresponding to using HR for reporting each users data is a diagonal matrix. Specifically, considering the set of messages as \(\{0,\dots, K-1\}\) and the inputs as \(\{0,\dots k-1\}\) for convenience, the matrix \(\mathbf{H}\) in the proof of lower bound is given by \[\begin{align} \mathbf{H}(i_1, i_2) &= k\sum_{m=0}^{K-1}\frac{ \left( W(m\mid 2i_1)-W(m\mid 2i_1+1) \right) \left( W(m\mid 2i_2)-W(m\mid 2i_2+1) \right)}{ \sum_{i=0}^{k-1} W(m\mid i)}, \quad 0\leq i_1, i_2\leq \frac{k-1}{2}\,, \nonumber \end{align}\] where \(W(m\mid i)\) denotes the probability that HR outputs \(m\) when the input is \(i\) and is given by \[\begin{align} W(m\mid i) &= \frac{2}{K(e^\varepsilon+1)}\left( e^{\varepsilon} \mathbb{1}_{\left\{m\in C_i\right\}}+ \mathbb{1}_{\left\{m\notin C_i\right\}} \right) =\frac{2}{K(e^\varepsilon+1)}\left( (e^{\varepsilon}-1) \mathbb{1}_{\left\{m\in C_i\right\}}+ 1 \right)\,. \end{align}\] With a slight abuse of notation, we use \(m\) and \(i\) interchangeably to denote their values and the binary vectors corresponding to binary representation of those values. Further, let \(\mleft\langle x, y \mright\rangle = \oplus\, x_i y_i\) denote the standard (parity) inner product for vectors over \(\mathbb{F}_2\). With this convention, for HR we have \[\mathbb{1}_{\left\{m\in C_i\right\}} = \mathbb{1}_{\left\{ \mleft\langle m, i \mright\rangle =0\right\}}.\] Note that for \(m=0\) and every \(i\), \(\mathbb{1}_{\left\{m\in C_i\right\}} = 1\), which implies that \(W(0\mid i)\) is the same for all \(i\). It follows that the term corresponding to \(m=0\) in the expression for \(\mathbf{H}(i_1, i_2)\) is \(0\). Moreover, using \(\sum_{i=0}^{k-1} \mathbb{1}_{\left\{ \mleft\langle m, i \mright\rangle =0\right\}}=K/2\) for \(m\neq 0\), we obtain \[\begin{align} \sum_{i=1}^{k}W(m\mid i) &= \frac{2}{K(e^\varepsilon+1)}\left( \Big(e^{\varepsilon}-1\Big)\sum_{i=0}^{k-1} \mathbb{1}_{\left\{ \mleft\langle m, i \mright\rangle =0\right\}}+ k\right) \\ &=\frac{2}{K(e^\varepsilon+1)}\left( \Big(e^{\varepsilon}-1\Big)\frac{K}{2}+ k\right) \\ &= c(\varepsilon, k, K)\cdot\frac{k}{K}\,, \end{align}\] where \(c(\varepsilon, k, K) =2((e^{\varepsilon}-1) K/2+ k)/(k(e^\varepsilon+1))\); by assumption, \(k\leq K \leq 2k\), which implies that \(c(\varepsilon, k, K) \in [1, 2]\). Therefore, for every \(0\leq i_1, i_2\leq (k-1)/2\), \[\begin{align} \mathbf{H}(i_1, i_2) &= c(\varepsilon, k, K)\cdot\frac{4(e^\varepsilon-1)^2}{K(e^\varepsilon+1)^2}\sum_{m=1}^{K-1} \left(\mathbb{1}_{\left\{ \mleft\langle m, 2i_1 \mright\rangle =0\right\}} - \mathbb{1}_{\left\{ \mleft\langle m, 2i_1+1 \mright\rangle =0\right\}}\right)\cdot \nonumber \\ & \left(\mathbb{1}_{\left\{ \mleft\langle m, 2i_2 \mright\rangle =0\right\}} - \mathbb{1}_{\left\{ \mleft\langle m, 2i_2+1 \mright\rangle =0\right\}}\right). \label{e:H-terms} \end{align}\tag{12}\] We claim that \(\mathbf{H}(i_1, i_2)=0\) for \(i_1\neq i_2\). Indeed, a case analysis yields \[\begin{align} \left(\mathbb{1}_{\left\{ \mleft\langle m, 2i_1 \mright\rangle =0\right\}} - \mathbb{1}_{\left\{ \mleft\langle m, 2i_1+1 \mright\rangle =0\right\}}\right) &\left(\mathbb{1}_{\left\{ \mleft\langle m, 2i_2 \mright\rangle =0\right\}} - \mathbb{1}_{\left\{ \mleft\langle m, 2i_2+1 \mright\rangle =0\right\}}\right)\\ &= \left(\mathbb{1}_{\left\{ \mleft\langle m, 2i_1 \mright\rangle = \mleft\langle m, 2i_2 \mright\rangle \right\}} - \mathbb{1}_{\left\{ \mleft\langle m, 2i_1 \mright\rangle \neq \mleft\langle m, 2i_2 \mright\rangle \right\}}\right)\mathbb{1}_{\left\{ \mleft\langle m, 1 \mright\rangle \neq 0\right\}}\,, \end{align}\] where the condition \(\mathbb{1}_{\left\{ \mleft\langle m, 1 \mright\rangle \neq 0\right\}}\) indicates that the expression is nonzero only when \(m\) is odd. Thus, the summands in 12 can be restricted to odd \(m\), and further, each summand equals \[\mathbb{1}_{\left\{ \mleft\langle m, 2i_1 \mright\rangle = \mleft\langle m, 2i_2 \mright\rangle \right\}} - \mathbb{1}_{\left\{ \mleft\langle m, 2i_1 \mright\rangle \neq \mleft\langle m, 2i_2 \mright\rangle \right\}} = \mathbb{1}_{\left\{ \mleft\langle m, 2(i_1\oplus i_2) \mright\rangle =0\right\}} - \mathbb{1}_{\left\{ \mleft\langle m, 2(i_1\oplus i_2) \mright\rangle =1\right\}}\,.\] We can simplify the expression on the right-side by noting that each odd \(m\) has the binary form \((b,1)\) and \(\mleft\langle (b,1), 2i \mright\rangle = \mleft\langle b, i \mright\rangle\). Hence, \[\begin{align} \sum_{m=1}^{K-1} \left(\mathbb{1}_{\left\{ \mleft\langle m, 2i_1 \mright\rangle =0\right\}} - \mathbb{1}_{\left\{ \mleft\langle m, 2i_1+1 \mright\rangle =0\right\}}\right)&\left(\mathbb{1}_{\left\{ \mleft\langle m, 2i_2 \mright\rangle =0\right\}} - \mathbb{1}_{\left\{ \mleft\langle m, 2i_2+1 \mright\rangle =0\right\}}\right) \\ &=\sum_{m=0}^{(K-1)/2} \left(\mathbb{1}_{\left\{ \mleft\langle m,(i_1\oplus i_2) \mright\rangle =0\right\}} - \mathbb{1}_{\left\{ \mleft\langle m,(i_1\oplus i_2) \mright\rangle =1\right\}}\right) \\ &= \frac{K-1}{2}\mathbb{1}_{\left\{i_1=i_2\right\}}. \end{align}\] since for any nonzero vector \(j\), \(| \left\{\; m \;\colon\; \mleft\langle m, j \mright\rangle \rangle =0\; \right\} | = | \left\{\; m \;\colon\; \mleft\langle m, j \mright\rangle \rangle =1 \; \right\} |\) . In summary, we have \[\mathbf{H}(i_1, i_2) =c(\varepsilon, k, K)\cdot \frac{4(e^\varepsilon-1)^2(K-1)}{K(e^\varepsilon+1)^2} \mathbb{1}_{\left\{i_1=i_2\right\}},\] whereby using \(c(\varepsilon, k, K)\in [1,2]\) we get \[\lVert\mathbf{H}{\rVert}_F^2 = \sum_{i_1, i_2} |\mathbf{H}(i_1, i_2)|^2 = O\left(k\frac{(e^\varepsilon-1)^4}{(e^\varepsilon+1)^4}\right).\] The proof is completed in the same manner as the proof of 9. ◻
In this section, we treat independence testing. We begin in 6.1 with an independence testing mechanism based on HR that does not require public randomness and which achieves significantly improved sample complexity over the state-of-the-art (in dependence on the alphabet size). However, we do not have matching lower bounds for its performance.
Then, in 6.2, we describe and analyze an optimal procedure that uses public randomness, akin to the optimal uniformity testing mechanism of 4.
We present a symmetric, private-coin LDP mechanism for testing independence of distributions over \([k]\times[k]\) (although, as we note in [rk:independence:otherdomains], our mechanism can be easily extended to handle a more general setting).
Theorem 11. For \(\varepsilon\in (0,1]\), 7 based on a symmetric private-coin \(\varepsilon\)-LDP mechanism can test whether a distribution over \([k]\times[k]\) is a product distribution or \(\gamma\)-far from product using \[O\left(\frac{k^{3}}{\gamma^2\varepsilon^4}\right)\] samples.
The rest of this section is dedicated to the proof of 11. The argument will follow the “testing-by-hybrid-learning” approach of [17], modified suitably for the local differential privacy setting. Specifically, instead of learning and testing the underlying user data distributions, we simply do this in the Fourier domain for the distributions seen at the output of HR; details follow.
Denote by \(\mathcal{H}\) the HR mapping from \([k]\) to \([K]\), where \(K=O(k)\), and \(\alpha_{H} :=\frac{e^\varepsilon-1}{e^\varepsilon+1}\) as in 3.2. For any probability distribution \(p\in\Delta\mleft([k]\times[k]\mright)\), we define \(\mathcal{T}(p)\in\Delta\mleft([K]\times[K]\mright)\) as the distribution of \((Z_1,Z_2)\) obtained by the process below:
(1) Draw \((X_1,X_2)\) from \(p\);
(2) apply HR independently to \(X_1\) and \(X_2\) to obtain \(Z_1\) and \(Z_2\).
It is immediate to see that if \(p\) is a product distribution with marginals \(p_1\) and \(p_2\), then \[\mathcal{T}(p) = \mathcal{H}(p_1)\otimes\mathcal{H}(p_2)\,.\] We build our test on observations \((Z_1, Z_2)\) from each user, with distribution \(\mathcal{T}(p)\). Our proposed test uses these samples. It builds on several components that we will describe later; for ease of presentation, we summarize the overall algorithm in 7.
For [algo:independence:testing], we rely on a result of [17], modified slightly for our purposes:17
Theorem 12 ([17]). Given the explicit description of a distribution \(q\in\Delta\mleft([k]\mright)\) such that \(\min_{x\in[k]}q(x) \geq \frac{1}{50k}\) and samples from an unknown distribution \(p\in\Delta\mleft([k]\mright)\), there exists an efficient algorithm with that can distinguish with probability at least \(9/10\) between the cases \(\chi^2(p,q)<\frac{\gamma^2}{2}\) and \(\chi^2(p,q) \geq \gamma^2\) using \(O(\sqrt{k}/\gamma^2)\) samples.
In addition to 12, our proposed algorithm builds on 4 which we will describe and prove below. But before we prove this result, we note that this algorithm can be seen to satisfy all the properties claimed in 11. Indeed, it requires \(O(k^3/(\alpha_{H}^4\gamma^2))\); its privacy is immediate since the observations at the curator are obtained by passing user data via HR. The mechanism is clearly symmetric, as each user sends the output of HR(applied independently to both marginal of their data) to the curator – it is only at the curator that these privatized outputs are used and combined to generate samples from \(\mathcal{T}(p)\), \(\mathcal{T}(p_1\otimes p_2)\), \(\mathcal{T}(p_1)\), or \(\mathcal{T}(p_2)\).
As for the correctness, it will follow from 4 12 (ensuring that the algorithm is overall correct with probability at least \(7/10>2/3\)), once the following structural property is established: For \(p\) that is \(\gamma\)-far from any product distribution has \(\chi^2(\mathcal{T}(p),q) > {\gamma'}^2\). Formally, we show the following:
Theorem 13. Let \(p\in\Delta\mleft([k]\times[k]\mright)\) with marginals \(p_1,p_2\in\Delta\mleft([k]\mright)\), and \(q\in\Delta\mleft([k]\times[k]\mright)\) be a product distribution such that \(\chi^2(\mathcal{T}(p_1\otimes p_2),\mathcal{T}(q)) \leq \frac{\alpha_{H}^4\gamma^2}{k^2}\). (i) If \(p\) is a product distribution, then \(\chi^2( \mathcal{T}(p), \mathcal{T}(q) ) \leq \frac{\alpha_{H}^4\gamma^2}{k^2}\). (ii) if \(p\) is \(\gamma\)-far from being a product distribution, then \(\chi^2( \mathcal{T}(p), \mathcal{T}(q) ) > \frac{2\alpha_{H}^4\gamma^2}{k^2}\).
It only remains to establish the structural property above and \(\chi^2\) learning algorithm 4.
We prove that (i) if \(p\) is independent, then \(\chi^2(\mathcal{T}(p_1\otimes p_2),q)\) will be small, while (ii) if \(p\) is far from independent then \(\chi^2(\mathcal{T}(p_1\otimes p_2),q)\) must be noticeably larger. The key technical component is the next lemma.
Lemma 5. Let \(p,q\in\Delta\mleft([k]\times[k]\mright)\) be two distributions, with marginals \(p_1,p_2\) and \(q_1,q_2\), respectively. Then, \[{\lVert\mathcal{T}(p)-\mathcal{T}(q){\rVert}}_2^2 = \frac{\alpha_{H}^4}{K^2}{\lVert p-q{\rVert}}_2^2 + \frac{\alpha_{H}^2}{K^2}\left( {\lVert p_1-q_1{\rVert}}_2^2 + {\lVert p_2-q_2{\rVert}}_2^2 \right)\,.\] In particular, if \({\operatorname{d}_{\rm TV}^{}\!\left({p, q}\right)} > \gamma\), then \({\lVert\mathcal{T}(p)-\mathcal{T}(q){\rVert}}_2 > \frac{2\alpha_{H}^2\gamma}{Kk}\).
Proof. The proof is similar to that of 4. Note that it follows in the manner of 9 that for every \((z_1,z_2)\in[K]\times[K]\), \[\begin{align} \mathcal{T}(p)&(z_1,z_2) \\ &= \sum_{(x_1,x_2)\in [k]\times[k]} W(z_1 \mid x_1)W(z_2 \mid x_2)p(x_1,x_2) \\ &= \frac{4}{K^2(e^\varepsilon+1)^2} \sum_{(x_1,x_2)\in [k]\times[k]} p(x_1,x_2) \left( (e^\varepsilon-1) \mathbb{1}_{\left\{z_1\in C_{x_1}\right\}} + 1 \right)\left( (e^\varepsilon-1) \mathbb{1}_{\left\{z_2\in C_{x_2}\right\}} + 1 \right) \\ &= \frac{1}{K^2}\sum_{(x_1,x_2)\in [k]\times[k]} p(x_1,x_2) \left( \alpha_{H}\chi_{\phi(x_1)}(z_1) + 1 \right)\left( \alpha_{H}\chi_{\phi(x_2)}(z_2) + 1 \right) \\ &= \frac{\alpha_{H}^2}{K^2}\sum_{x_1,x_2} p(x_1,x_2)\chi_{\phi(x_1)}(z_1)\chi_{\phi(x_2)}(z_2) + \frac{\alpha_{H}}{K^2}\Big( \sum_{x_1} p_1(x_1)\chi_{\phi(x_1)}(z_1) + \sum_{x_2} p_2(x_2)\chi_{\phi(x_2)}(z_2) \Big) + \frac{1}{K^2}, \end{align}\] where by the second-to-last identity above gives \(\mathcal{T}(p)(z_1,z_2)\in [1-\alpha_{H}^2,1+\alpha_{H}^2]\cdot \frac{1}{K^2}\) for every \((z_1,z_2)\). As an analogous expression holds for \(\mathcal{T}(q)(z_1,z_2)\), setting \(g:=\mathcal{T}(p) - \mathcal{T}(q)\) we have \[\begin{align} g(z_1,z_2) &= \frac{\alpha_{H}^2}{K^2}\sum_{(x_1,x_2)\in [k]\times[k]} \left(p(x_1,x_2) - p_1(x_1)p_2(x_2) \right) \chi_{\phi(x_1)}(z_1)\chi_{\phi(x_2)}(z_2) \\ &\qquad+ \frac{\alpha_{H}}{K^2}\Big( \sum_{x_1\in [k]} (p_1(x_1)-q_1(x_1)) \chi_{\phi(x_1)}(z_1) + \sum_{x_2\in [k]} (p_2(x_2)-q_2(x_2)) \chi_{\phi(x_2)}(z_2) \Big), \end{align}\] for every \((z_1,z_2)\in [K]\times[K]\). Now, as in 4, but looking at the corresponding characters for the Hadamard transform from \([k]\times[k]\) to \([K]\times[K]\),18 we get \[\begin{align} \hat{g}(T) &= \frac{\alpha_{H}^2}{K^2}\sum_{(x_1,x_2)\in[k]\times[k]}\left(p(x_1,x_2) - p_1(x_1)p_2(x_2) \right)\mathbb{1}_{\left\{T=(\phi(x_1),\phi(x_2))\right\}} \\ &\qquad+ \frac{\alpha_{H}}{K^2}\Big( \sum_{x_1\in[k]}\left(p_1(x_1)-q_1(x_1)\right)\mathbb{1}_{\left\{T=\phi(x_1)\right\}} + \sum_{x_2\in[k]}\left(p_2(x_2)-q_2(x_2)\right)\mathbb{1}_{\left\{T=\phi(x_2)\right\}} \Big)\,. \end{align}\] By Parseval’s theorem (1), \[\begin{align} \lVert g{\rVert}^2 &= \frac{1}{K^2}\sum_{(z_1,z_2)\in[K]\times[K]}\left( \mathcal{T}(p)(z_1,z_2) - \mathcal{T}(q)(z_1,z_2) \right)^2 \\ &= \sum_{T\in[K]\times[K]} \hat{g}(T)^2 \\ &= \frac{\alpha_{H}^4}{K^4}\sum_{(x_1,x_2)\in[k]\times[k]}\left(p(x_1,x_2) - q(x_1,x_2) \right)^2 \\ & + \frac{\alpha_{H}^2}{K^4}\Big( \sum_{x_1}\left(p_1(x_1)-q_1(x_1)\right)^2 + \sum_{x_2}\left(p_2(x_2)-q_2(x_2)\right)^2 \Big), \end{align}\] so that \[{\lVert\mathcal{T}(p)-\mathcal{T}(q){\rVert}}_2^2 = \frac{\alpha_{H}^4}{K^2}{\lVert p-q{\rVert}}_2^2 + \frac{\alpha_{H}^2}{K^2}\left( {\lVert p_1-q_1{\rVert}}_2^2 + {\lVert p_2-q_2{\rVert}}_2^2 \right) \geq \frac{\alpha_{H}^4}{K^2}{\lVert p-q{\rVert}}_2^2\,,\] as claimed. ◻
Proof of 13. The first statement is obvious, as then \(\mathcal{T}(p) = \mathcal{T}(p_1\otimes p_2)\). Turning to the second, assume that \(p\) is \(\gamma\)-far from being a product distribution, so that in particular \({\operatorname{d}_{\rm TV}^{}\!\left({p, q}\right)} > \gamma\). This implies by 5 that \({\lVert\mathcal{T}(p) - \mathcal{T}(q){\rVert}}_2^2 > (4\alpha_{H}^4\gamma^2)/(K^2k^2)\) which along with \({\lVert\mathcal{T}(q){\rVert}}_\infty \leq \frac{1+\alpha_{H}^2}{K^2} \leq \frac{2}{K^2}\) yields \[\chi^2( \mathcal{T}(p), \mathcal{T}(q) ) = \sum_{z\in[K]\times[K]}\frac{ (\mathcal{T}(p)(z) - \mathcal{T}(q)(z))^2 }{ \mathcal{T}(q)(z)} \geq \frac{K^2}{2}{\lVert\mathcal{T}(p) - \mathcal{T}(q){\rVert}}_2^2 > \frac{2\alpha_{H}^4\gamma^2}{k^2},\] as claimed. ◻
Next, we establish the correctness of Step [algo:independence:learning]. That is, we show that by leveraging the product structure one can (privately) learn \(\mathcal{T}(p_1\otimes p_2)\) to the desired \(\chi^2\) accuracy with the number of samples scaling as \(k^3\). To do so, will rely on the following result in [38] on learning in \(\chi^2\) distance:
Lemma 6 ([38]). The Laplace (add-1) estimator can learn \(k\)-ary distributions to \(\chi^2\) distance \(\gamma^2\), with probability \(9/10\), using \(O(k/\gamma^2)\) samples.
The next corollary ensues.
Corollary 3. There is an efficient estimator to learn product distributions over \([k]\times[k]\) to \(\chi^2\) distance \(\gamma^2\), with probability \(4/5\), using \(O(k/\gamma^2)\) samples.
Proof. Let \(p=p_1\otimes p_2\in\Delta\mleft([k]\times[k]\mright)\) be a product distribution, and \(\tilde{p}_1\), \(\tilde{p}_2\) be the hypotheses obtained by using the estimator of 6 independently on the two marginals of \(p\), with distance parameter \(\gamma^2/3\). We claim that \(\tilde{p}:=\tilde{p}_1\otimes\tilde{p}_2\) can serve as our desired estimate. Indeed, by a union bound, with probability at least \(4/5\) it is the case that \(\chi^2(p_1,\tilde{p}_1) \leq \gamma^2/3\) and \(\chi^2(p_2,\tilde{p_2}) \leq \gamma^2/3\). When this happens, \[\begin{align} \chi^2(p,\tilde{p}) &= -1 + \sum_{(x_1,x_2)\in[k]\times[k]} \frac{p_1(x_1)^2p_2(x_2)^2}{\tilde{p}_1(x_1)\tilde{p}_2(x_2)} \\ & = -1 + \sum_{x_1\in[k]} \frac{p_1(x_1)^2}{\tilde{p}_1(x_1)}\sum_{x_2\in[k]} \frac{p_2(x_2)^2}{\tilde{p}_2(x_2)} \\ &= -1 + (\chi^2(p_1,\tilde{p}_1)+1)(\chi^2(p_2,\tilde{p}_2)+1) \\ & = \chi^2(p_1,\tilde{p}_1)\chi^2(p_2,\tilde{p_2})+\chi^2(p_1,\tilde{p}_1)+\chi^2(p_2,\tilde{p_2}) \\ &\leq \frac{\gamma^4}{9} + \frac{2}{3}\gamma^2 < \gamma^2, \end{align}\] concluding the proof. ◻
As a further corollary, we finally obtain the desired algorithm for LDP \(\chi^2\)-learning.
Corollary 4. There exists an algorithm based on a private-coin, symmetric \(\varepsilon\)-LDP mechanism that learns \(\mathcal{T}(p_1\otimes p_2)\) to \(\chi^2\) distance \(\gamma'^2 :=\alpha_{H}^4\gamma^2/k^2\), with probability \(4/5\), using \(O(k^3/(\alpha_{H}^4\gamma^2))\) samples. Moreover, the estimate \(q\in\Delta\mleft([K]\times[K]\mright)\) obtained by this algorithm is a product distribution with \(\min_{z\in[K]\times[K]}q(z) \geq 1/(50K^2)\).
The last point follows from the fact that \(\mathcal{T}(p_1\otimes p_2)(z) \geq 1/(2K^2)\) for every \(z\in[K]\times[K]\). Hence, if \(q(z) < 1/(50K^2)\) for some \(z\), then \(\chi^2(\mathcal{T}(p_1\otimes p_2), q) \gg 1\).
To conclude this section, we note that a straightforward generalization of 7 4 12 13 to the case \([k_1]\times[k_2]\) leads to a symmetric private-coin \(\varepsilon\)-LDP mechanism to test whether a distribution over \([k_1]\times[k_2]\) is a product distribution vs. \(\gamma\)-far from product with sample complexity \(O\left((k_1 k_2)(k_1 + k_2 + \sqrt{k_1 k_2})/(\gamma^2\varepsilon^4)\right)\).
We proceed, as for uniformity testing, by reducing independence testing for arbitrary \(k\) to that for \(k=2\); an algorithm for solving the latter problem is given as a warmup in 1. We show that if \({\operatorname{d}_{\rm TV}^{}\!\left({p, p_1\otimes p_2}\right)}\geq \gamma\), uniformly random sets \(S_1, S_2\subseteq[k]\) of cardinality \(k/2\) satisfy \[\label{eq:s1s2} \left\lvert p(S_1, S_2)- p_1(S_1)p_2(S_2) \right\rvert = \Omega(\gamma/k),\tag{13}\] with constant probability. Therefore, we can perform our independence test by repeating the mechanism of 1 \(O(1)\) times, each for independently generated \(S_1, S_2\) applied to \(O(k^2/(\gamma^2\varepsilon^2))\) samples. Indeed, the claim above guarantees that, with high constant probability, when \({\operatorname{d}_{\rm TV}^{}\!\left({p, p_1\otimes p_2}\right)}\geq \gamma\), one of the \(O(1)\) repetitions will produce sets \(S_1,S_2\) that satisfy 13 . On the other hand, clearly when \(p=p_1\otimes p_2\), we have \(p(S_1\times S_2)=p_1(S_1)p_2(S_2)\) for all \(S_1, S_2\subseteq[k]\). Thus, the mechanism described in 1 will allow us to perform independence testing using \(O(k^2/(\gamma^2\varepsilon^2))\) samples by obtaining first the estimates \(\tilde{p}\), \(\tilde{p}_1\), and \(\tilde{p}_2\), respectively, of \(p(S_1\times S_2)\), \(p_1(S_1)\), and \(p_2(S_2)\), and then comparing \(\left\lvert \tilde{p}-\tilde{p}_1\tilde{p}_2 \right\rvert\) with a suitable threshold.19
Hence, we can (as we did for uniformity testing) divide the LDP testing problem into two parts: A public-coin \(\varepsilon\)-LDP mechanism releases 3 bits per sample to the curator, and then the curator applies a test to the received bits to perform independence testing on the reduced domain \(\{0,1\}\times\{0,1\}\). The specific mechanism underlying the first part will be Raptor(specifically, a bivariate variant of Raptor given in [algo:raptor:bivariate]); the second part relies on the estimator of 1. As in 4, we can boost the probability of success to \(2/3\) by performing the above two-part test a constant number of times and using the median trick.
It only remains to prove the claim 13 . This requires the following (somewhat technical) extension of 6; for simplicity, we provide a less general version that addresses only a specific choice of random variables \(X\) and \(Y\).
Theorem 14 (Joint probability perturbation concentration). Consider a matrix \(\delta\in\mathbb{R}^{k\times k}\) such that, for every \(i_0,j_0\in[k]\), \(\sum_{j\in [k]}\delta_{i_0,j}=\sum_{i\in [k]}\delta_{i,j_0} = 0\). Let random variables \(X=(X_1, \dots, X_k)\) and \(Y=(Y_1, \dots, Y_k)\) be independent and uniformly distributed over \(k\)-length binary sequences of weight \(k/2\). Define \(Z = \sum_{(i,j)\in [k]\times[k]}\delta_{ij}X_iY_j\). Then, there exist constants \(c_1,c_2,\rho>0\) such that \[\Pr\mleft[\, \frac{Z^2}{ \lVert\delta{\rVert}_F^2}\in [c_1,c_2]\, \mright]\geq \rho.\]
We provide the details of the proof of 14 in 9. In particular, choosing \(\delta_{ij} :=(p(i,j) - p_1(i)p_2(j))\), we obtain the desired result as a corollary:
Corollary 5. Consider \(p\in\Delta\mleft([k]\times[k]\mright)\) with marginals \(p_1,p_2\) such that \({\operatorname{d}_{\rm TV}^{}\!\left({p, p_1\otimes p_2}\right)}\geq \gamma\). For randomly chosen subsets \(S_1\) and \(S_2\), generated uniformly and independently over all subsets of \([k]\) of cardinality \([k/2]\), there exist positive constants \(c\) and \(\rho\) such that \[\Pr\mleft[\, |p(S_1\times S_2)-p_1(S_1)p_2(S_2)|\geq c \frac{{\operatorname{d}_{\rm TV}^{}\!\left({p, p_1\otimes p_2}\right)}}{k}\, \mright]\geq \rho\,.\]
Proof. Setting \(\delta_{ij} = (p(i,j) - p_1(i)p_2(j))\) in 14, note that \[Z = \sum_{i,j}X_iY_j(p(i,j)-p_1(i)p_2(j))= p(S_1\times S_2)-p_1(S_1)p_2(S_2)\] and that \[\lVert\delta{\rVert}_F^2 = \sum_{i,j\in [k]}\delta_{i,j}^2 \geq \frac{ \Big(\sum_{i,j\in [k]}\left\lvert \delta_{i,j} \right\rvert\Big)^2}{k^2}\geq \frac{4\gamma^2}{k^2}.\] Thus, the claim follows from 14. ◻
Finally, we show that the sample requirement for our mechanism is optimal for \(\varepsilon\in (0,1]\). The proof is similar to that of 8, since the uniform distribution on \([k]\times[k]\) is also a product distribution. The only caveat is that we need to ensure that each perturbed distribution is at total variation distance at least \(\gamma\) from every product distribution, not only the uniform one. Fortunately, we can get this using the following simple fact:
Assume \(p\) is \(\gamma\)-close to some product distribution \(q\in\Delta\mleft([k]\times[k]\mright)\). Then, \(p\) is \(\gamma\)-close to the product distribution induced by its own marginals, \(i.e.\), \({\operatorname{d}_{\rm TV}^{}\!\left({p, p_1\otimes p_2}\right)} \leq 3\gamma\).
Consequently, to show that the perturbed distribution is \(\gamma\)-far from independent it is enough to prove it is \((3\gamma)\)-far from the product of its marginals, which in turn is immediate. This implies that locally private independence testing is information-theoretically at least as hard as locally private uniformity testing over \([k]\times[k]\) (\(i.e.\), over alphabet size \(k^2\)), yielding the \(\Omega\left({k^2}/{(\gamma^2\varepsilon^2)}\right)\) sample lower bound. In summary, combining the upper and lower bounds we have shown the following result.
Theorem 15. There exists a symmetric, public-coin \(\varepsilon\)-LDP mechanism to test whether a distribution over \([k]\times[k]\) is a product distribution vs. \(\gamma\)-far from product using \[O\left(\frac{k^2}{\gamma^2\varepsilon^2}\right)\] samples. Furthermore, any \(\varepsilon\)-LDP mechanism for testing independence in this regime must use \(\Omega\left(\frac{k^2}{\gamma^2\varepsilon^2}\right)\) samples.
We thank Jon Ullman for bringing to our attention the relation between symmetric and asymmetric schemes, 1, and outlining its proof.
Theorem 16 (Probability perturbation concentration, restated). Consider a vector \(\delta\) such that \(\sum_{i\in [k]}\delta_i = 0\). Let random variables \(X_1, \dots, X_k\) be \(4\)-symmetric and \(Z = \sum_{i\in [k]}\delta_iX_i\). Then, for every \(\alpha \in (0,1/4)\), \[\Pr\mleft[\, \bigg(\mathbb{E}\mleft[X_1^2\mright] - \mathbb{E}\mleft[X_1X_2\mright]\bigg) - \sqrt{\frac{38 \alpha}{1-2\alpha}\mathbb{E}\mleft[X_1^4\mright]} \leq \frac{Z^2}{{\lVert\delta{\rVert}}_2^2} \leq \frac{1}{1-2\alpha} \bigg(\mathbb{E}\mleft[X_1^2\mright] - \mathbb{E}\mleft[X_1X_2\mright]\bigg) \, \mright] \geq \alpha.\]
Proof. Since \(X_1, X_2,\dots, X_k\) are \(4\)-symmetric, the expectations \(\mathbb{E}\mleft[X_aX_bX_cX_d\mright]\) depends only on the number of times each distinct element appears in the multiset \(\{a,b,c,d\}\). For ease of notation, we replace the highest frequency element in \(\{a,b,c,d\}\) with \(1\), second highest with \(2\), and so on, to obtain a representation \(S\) and denote \(m_{S} :=\mathbb{E}\mleft[\prod_{i\in S}X_i\mright]\). For instance, \(\mathbb{E}\mleft[X_a^2\mright] = m_{\{1,1\}}\) and \(\mathbb{E}\mleft[X_aX_b\mright]=m_{\{1,2\}}\) for distinct \(a,b\). With this notation at our disposal, we are ready to proceed with the proof.
Note first that \[\mathbb{E}\mleft[Z\mright] = \sum_{i\in[k]}\delta_i \mathbb{E}\mleft[X_i\mright] = m_{\{1\}} \sum_{i\in [k]} \delta_i =0.\] Moreover, for the variance of \(Z\), we have \[\begin{align} \operatorname{Var}\mleft(Z\mright) = \mathbb{E}\mleft[Z^2\mright] &= \sum_{i_1,i_2 \in [k]}\delta_{i_1}\delta_{i_2} \mathbb{E}\mleft[X_{i_1}X_{i_2}\mright] \notag\\ &= \sum_{i_1 \in [k]}\delta_{i_1}^2\mathbb{E}\mleft[X_{i_1}^2\mright] + \sum_{i_1\neq i_2}\delta_{i_1}\delta_{i_2}\mathbb{E}\mleft[X_{i_1}X_{i_2}\mright] \notag\\ &= m_{\{1,1\}}{\lVert\delta{\rVert}}_2^2 +m_{\{1,2\}} \sum_{i\neq j}\delta_{i_1}\delta_{i_2} \notag\\ &= m_{\{1,1\}}{\lVert\delta{\rVert}}_2^2 +m_{\{1,2\}} \left(\Big(\sum_{i\in[k]}\delta_i\Big)^2 - \sum_{i\in [k]}\delta_i^2\right) \notag\\ &= (m_{\{1,1\}}- m_{\{1,2\}}){\lVert\delta{\rVert}}_2^2 \notag\\ &= \bigg(\mathbb{E}\mleft[X_1^2\mright]-\mathbb{E}\mleft[X_1X_2\mright]\bigg){\lVert\delta{\rVert}}_2^2 \label{eq:paley:1}\,, \end{align}\tag{14}\] where we used \(\sum_{i\in[k]}\delta_i = 0\) in the previous identity. It follows from Chebyshev’s inequality that \[\Pr\mleft[\, Z^2\leq \frac{1}{1-2\alpha} \left(\mathbb{E}\mleft[X_1^2\mright]-\mathbb{E}\mleft[X_1X_2\mright]\right){\lVert\delta{\rVert}}_2^2\, \mright] \geq 1-2\alpha.\] For the lower tail bound, we derive a bound for \(\mathbb{E}\mleft[Z^4\mright]\) and invoke the Paley–Zygmund inequality. Specifically, we have \[\begin{align} \mathbb{E}\mleft[Z^4\mright] &= \sum_{i_1, i_2, i_3,i_4}\delta_{i_1}\delta_{i_2}\delta_{i_3}\delta_{i_4}\mathbb{E}\mleft[X_{i_1}X_{i_2}X_{i_3}X_{i_4}\mright] \\ &=m_{\{1,1,1,1\}}\Sigma_1 + m_{\{1,1,1,2\}}\Sigma_{2,1} + m_{\{1,1,2,2\}}\Sigma_{2,2} + m_{\{1,1,2,3\}}\Sigma_3 + m_{\{1,2,3,4\}}\Sigma_4, \end{align}\] where we have abbreviated \[\begin{align} \Sigma_1 &= {\lVert\delta{\rVert}}_4^4, \\ \Sigma_{2, 1}&= 4\sum_{i_1< i_2}\left(\delta_{i_1}^3\delta_{i_2} + \delta_{i_2}^3\delta_{i_1}\right), \\ \Sigma_{2, 2}&= 6\sum_{i_1< i_2} \delta_{i_1}^2\delta_{i_2}^2, \\ \Sigma_{3}&= 12\sum_{i_1<i_2<i_3} \left(\delta_{i_1}^2\delta_{i_2}\delta_{i_3}+\delta_{i_1}\delta_{i_2}^2\delta_{i_3} +\delta_{i_1}\delta_{i_2}\delta_{i_3}^2\right), \\ \Sigma_{4}&= 24\sum_{i_1<i_2<i_3<i_4}\delta_{i_1}\delta_{i_2}\delta_{i_3}\delta_{i_4}. \end{align}\] The expressions for \(\Sigma\)’s above can be simplified further by using \(\sum_{i\in[k]}\delta_i=0\). Observe now that \[\Sigma_1+\Sigma_{2,1}+\Sigma_{2,2} + \Sigma_3 +\Sigma_4 = \Big(\sum_{i\in [k]}\delta_i\Big)^4 =0.\] Also, for \(\Sigma_{2,1}\) and \(\Sigma_{2,2}\), we obtain \[\begin{align} \Sigma_{2,1} &= 4\left(\sum_{i}\delta_{i} \sum_{i}\delta_{i}^3 - \sum_{i}\delta_i^4\right) = -4{\lVert\delta{\rVert}}_4^4, \\ \Sigma_{2,2} &= 3\left(\sum_{i}\delta_{i}^2 \sum_{i}\delta_{i}^2 - \sum_{i}\delta_i^4\right) =3{\lVert\delta{\rVert}}_2^4 - 3{\lVert\delta{\rVert}}_4^4. \end{align}\] Finally, the expressions for \(\Sigma\)’s can be seen to satisfy, \[\left(\sum_{i}\delta_{i}\right)^2 \sum_{i}\delta_{i}^2 = \sum_i \delta_i^4 + \frac{1}{2} \Sigma_{2,1} + \frac{1}{3} \Sigma_{2,2} + \frac{1}{6} \Sigma_3,\] whereby \[\begin{align} \Sigma_3 = - 6\Sigma_1 -3\Sigma_{2,1} - 2\Sigma_{2,2} = 12{\lVert\delta{\rVert}}_4^4 - 6{\lVert\delta{\rVert}}_2^4 \end{align}\] Combining the relations above, we obtain \[\begin{align} \mathbb{E}\mleft[Z^4\mright] &= \big(m_{\{1,1,1,1\}} -4m_{\{1,1,1,2\}} -3m_{\{1,1,2,2\}} +12 m_{\{1,1,2,3\}} - 6m_{\{1,2,3,4\}}\big) {\lVert\delta{\rVert}}_4^4 \\ &\qquad+ \big(3m_{\{1,1,2,2\}} - 6m_{\{1,1,2,3\}}+3m_{\{1,2,3,4\}}\big){\lVert\delta{\rVert}}_2^4 \\ &\leq \big(m_{\{1,1,1,1\}}+ 3m_{\{1,1,2,2\}}+ 15 m_{\{1,1,2,3\}}\big){\lVert\delta{\rVert}}_2^4. \end{align}\] Note that by symmetry \[2(m_{\{1,1,2,2\}} - m_{\{1,1,2,3\}})= E[X_1^2(X_2-X_3)^2] \geq 0\] and by symmetry and the Cauchy–Schwarz inequality \[m_{\{1,1,1,1\}}=\mathbb{E}\mleft[X_1^4\mright]\geq \mathbb{E}\mleft[X_1^2X_2^2\mright] = m_{\{1,1,2,2\}}.\] Therefore, the previous inequality yields \[\begin{align} \label{eq:paley:2} \mathbb{E}\mleft[Z^4\mright]&\leq 19 \mathbb{E}\mleft[X_1^4\mright]{\lVert\delta{\rVert}}_2^4\,. \end{align}\tag{15}\] We now take recourse to the Paley–Zygmund inequality, restated below:
Theorem 17 (Paley–Zygmund (Refined version)). Suppose \(U\) is a non-negative random variable with finite variance. Then, for every \(\theta\in[0,1]\), \[\Pr\mleft[\, U > \theta\mathbb{E}\mleft[U\mright] \, \mright] \geq \frac{(1-\theta)^2\mathbb{E}\mleft[U\mright]^2}{\operatorname{Var}U + (1-\theta)^2\mathbb{E}\mleft[U\mright]^2}\,.\]
Applying this to \(Z^2\) and substituting the bounds of 14 15 above, and setting \[\theta :=1-\sqrt{\frac{38\alpha}{1-2\alpha}}\frac{\sqrt{\mathbb{E}\mleft[X_1^4\mright]{\lVert\delta{\rVert}}_2^4}}{(\mathbb{E}\mleft[X_1^2\mright]-\mathbb{E}\mleft[X_1X_2\mright]){\lVert\delta{\rVert}}_2^2} \leq 1-\sqrt{\frac{19\alpha}{1-2\alpha}}\frac{\sqrt{\mathbb{E}\mleft[Z^4\mright]}}{\mathbb{E}\mleft[Z^2\mright]}\,,\] we obtain \[\Pr\mleft[\, Z^2 \geq \theta (\mathbb{E}\mleft[X_1^2\mright]-\mathbb{E}\mleft[X_1X_2\mright]){\lVert\delta{\rVert}}_2^2\, \mright] \geq \frac{(1-\theta)^2(\mathbb{E}\mleft[X_1^2\mright]-\mathbb{E}\mleft[X_1X_2\mright])^2{\lVert\delta{\rVert}}_2^4}{ 19\mathbb{E}\mleft[X_1^4\mright]{\lVert\delta{\rVert}}_2^4+ (1-\theta)^2(\mathbb{E}\mleft[X_1^2\mright]-\mathbb{E}\mleft[X_1X_2\mright])^2{\lVert\delta{\rVert}}_2^4} = 2\alpha\,,\] which completes the proof. ◻
Lemma 7 (Variance of the Rappor-based estimator, restated). With \(T\) defined as in 7 , we have \[\operatorname{Var}\mleft(T\mright) \leq 4kn^2 + 8n^3 \alpha_{R}^2 {\lVert p-u{\rVert}}_2^2 = 4kn^2 + 8n\mathbb{E}\mleft[T\mright]\,.\]
Proof of 4. Letting again \(\lambda :=\frac{\alpha_{R}}{k}+\beta_{R}\) and \(\lambda_x:=\frac{1}{n}\mathbb{E}\mleft[N_x\mright] = \alpha_{R}p_x+\beta_{R}\) for \(x\in[k]\), we have \[\operatorname{Var}\mleft(T\mright) = \sum_{x,y\in[k]} \operatorname{Cov}\mleft( f(N_x) , f(N_y) \mright)\,,\] where \(f\colon[0,\infty)\to\mathbb{R}\) is given by \(f(t) = (t-(n-1)\lambda)^2 - t + (n-1)\lambda^2\).
The key difficulty in analysis arises from the fact that Rappor renders the multiplicities \(N_x\)’s dependent random variable. They are negatively associated, but since \(f\) is not monotone this does not imply that the cross covariance terms are non-positive. Thus, we need to take recourse to a more direct, elaborate treatment.
Fix \(x\neq y\) in \([k]\). Expanding the covariance term, recalling \(\mathbb{E}\mleft[f(N_x)\mright] = n(n-1)(\lambda_x-\lambda)^2\) from the proof of 3 and abbreviating \(r:= 2(n-1)\lambda+1\) and \(m:=n-1\), we obtain after a few manipulations that \[\begin{align} &\operatorname{Cov}\mleft( f(N_x) , f(N_y) \mright)\\ &= \mathbb{E}\mleft[ (f(N_x)-\mathbb{E}\mleft[f(N_x)\mright])(f(N_y)-\mathbb{E}\mleft[f(N_y)\mright])\mright]\\ &= \mathbb{E}\mleft[N_x^2N_y^2\mright] - r\mathbb{E}\mleft[N_x^2N_y+N_xN_y^2\mright] + mn\lambda_y(2\lambda-\lambda_y)\mathbb{E}\mleft[N_x^2\mright] + mn\lambda_x(2\lambda-\lambda_x)\mathbb{E}\mleft[N_y^2\mright] \\ &\qquad + r^2\mathbb{E}\mleft[N_xN_y\mright] - rmn( \lambda_y(2\lambda-\lambda_y)\mathbb{E}\mleft[N_x\mright] + \lambda_x(2\lambda-\lambda_x)\mathbb{E}\mleft[N_y\mright] )\\ &\qquad + m^2n^2 \lambda_x\lambda_y(2\lambda-\lambda_x)(2\lambda-\lambda_y)\\ &= \mathbb{E}\mleft[N_x^2N_y^2\mright] - r\mathbb{E}\mleft[N_x^2N_y+N_xN_y^2\mright] - 2m^2n\lambda\lambda_y(2\lambda-\lambda_y)\mathbb{E}\mleft[N_x\mright] + m^2\lambda_y(2\lambda-\lambda_y)\mathbb{E}\mleft[N_x\mright]^2\\ &\qquad-2m^2n\lambda\lambda_x(2\lambda-\lambda_x)\mathbb{E}\mleft[N_y\mright] + m^2\lambda_x(2\lambda-\lambda_x)\mathbb{E}\mleft[N_y\mright]^2 \\ &\qquad + r^2\mathbb{E}\mleft[N_xN_y\mright] + m^2n^2 \lambda_x\lambda_y(2\lambda-\lambda_x)(2\lambda-\lambda_y). \end{align}\] Substituting \(r-1=2m\lambda\) and \(\mathbb{E}\mleft[N_y^2\mright] = \mathbb{E}\mleft[N_y\mright]+\frac{m}{n}\mathbb{E}\mleft[N_y\mright]^2\) in the previous identity, and similarly for \(N_x\), we get \[\begin{align} \label{eq:covariance} & \operatorname{Cov}\mleft( f(N_x) , f(N_y) \mright) \nonumber \\ &= \mathbb{E}\mleft[N_x^2N_y^2\mright] - (2m\lambda+1)\mathbb{E}\mleft[N_x^2N_y+N_xN_y^2\mright] - 2m^2\lambda(2\lambda-\lambda_y)\mathbb{E}\mleft[N_x\mright]\mathbb{E}\mleft[N_y\mright] \notag\\ &\qquad-2m^2\lambda(2\lambda-\lambda_x)\mathbb{E}\mleft[N_x\mright]\mathbb{E}\mleft[N_y\mright] + m^2\lambda_x(2\lambda-\lambda_x)\mathbb{E}\mleft[N_y\mright]^2 + m^2\lambda_y(2\lambda-\lambda_y)\mathbb{E}\mleft[N_x\mright]^2\notag\\ &\qquad + (2m\lambda+1)^2\mathbb{E}\mleft[N_xN_y\mright] + m^2\mathbb{E}\mleft[N_x\mright]\mathbb{E}\mleft[N_y\mright](2\lambda-\lambda_x)(2\lambda-\lambda_y). \end{align}\tag{16}\] We proceed by evaluating the expressions for \(\mathbb{E}\mleft[N_xN_y\mright]\), \(\mathbb{E}\mleft[N_x^2N_y\mright]\), \(\mathbb{E}\mleft[N_xN_y^2\mright]\), and \(\mathbb{E}\mleft[N_x^2N_y^2\mright]\) separately.
Specifically, by [fact:rappor:statistics], we get \[\begin{align} \mathbb{E}\mleft[N_xN_y\mright] &= \sum_{1\leq i,j\leq n} \Pr\mleft[\, {\boldsymbol{b}}_{ix} =1, {\boldsymbol{b}}_{jy}=1\, \mright] \nonumber \\ & = \sum_{i=1}^n( \lambda_x\lambda_y - \alpha_{R}^2p(x)p(y) ) + \sum_{i\neq j} \lambda_x\lambda_y \nonumber \\ &= n^2\lambda_x\lambda_y - n\alpha_{R}^2p(x)p(y). \label{eq:covariance:11} \end{align}\tag{17}\]
Turning to \(\mathbb{E}\mleft[N_x^2N_y\mright]\), we get \[\begin{align} \mathbb{E}\mleft[N_x^2 N_y\mright] &= \sum_{1\leq i,j,\ell\leq n} \Pr\mleft[\, {\boldsymbol{b}}_{ix} = 1, {\boldsymbol{b}}_{jx} = 1, {\boldsymbol{b}}_{\ell y} = 1 \, \mright] \\ &= n\Pr\mleft[\, {\boldsymbol{b}}_{ix} = 1, {\boldsymbol{b}}_{i y} = 1 \, \mright] + 6\binom{n}{3} \lambda_x^2 \lambda_y + 2\binom{n}{2}\left( \lambda_x\lambda_y+2\lambda_x(\lambda_x\lambda_y-\alpha_{R}^2p(x)p(y)) \right) \\ &= n\lambda_x\lambda_y - n\alpha_{R}^2p(x)p(y) + n(n-1)(n-2)\lambda_x^2 \lambda_y \\ &\qquad+ n(n-1) \lambda_x\lambda_y+ 2 n(n-1)\lambda_x^2\lambda_y - 2 n(n-1)\alpha_{R}^2\lambda_xp(x)p(y), \end{align}\] which yields \[\label{eq:covariance:21} \mathbb{E}\mleft[N_x^2 N_y\mright] = n^2 \lambda_x\lambda_y - (2m\lambda_x+1)n\alpha_{R}^2p(x)p(y) + mn^2\lambda_x^2 \lambda_y.\tag{18}\]
For the last term, note that \[\begin{align} \mathbb{E}\mleft[N_x^2 N_y^2\mright] &= \sum_{1\leq i,j,i',j'\leq n} \Pr\mleft[\, {\boldsymbol{b}}_{ix} = 1, {\boldsymbol{b}}_{jx} = 1, {\boldsymbol{b}}_{i' y} = 1, {\boldsymbol{b}}_{j' y} = 1 \, \mright] \\ &= n\left(\lambda_x\lambda_y-\alpha_{R}^2p(x)p(y)\right) + \binom{n}{2}\left(2\lambda_x\lambda_y + 4\lambda_x\left(\lambda_x\lambda_y-\alpha_{R}^2p(x)p(y)\right) \right.\\&\qquad\left.+ 4\lambda_y\left(\lambda_x\lambda_y-\alpha_{R}^2p(x)p(y)\right) + 4\left(\lambda_x\lambda_y-\alpha_{R}^2p(x)p(y)\right)^2 \right) \\ &\qquad+ \binom{n}{3}\left( 6\lambda_x^2\lambda_y+6\lambda_x\lambda_y^2 + 24\lambda_x\lambda_y\left(\lambda_x\lambda_y-\alpha_{R}^2p(x)p(y)\right) \right) \\ &\qquad + 24\binom{n}{4} \lambda_x^2\lambda_y^2 \end{align}\] where the second identity follows from counting the different possibilities for the values taken by \(i,i',j,j'\); we divide into cases based on the number of different values taken and apply [fact:rappor:statistics] for each subcase. Note that the total number of terms is \(n+14\binom{n}{2}+36\binom{n}{3}+24\binom{n}{4}=n^4\).
This after a tedious simplification leads to \[\begin{align} \label{eq:covariance:22} \mathbb{E}\mleft[N_x^2 N_y^2\mright] &= n\left(\lambda_x\lambda_y-\alpha_{R}^2p(x)p(y)\right) + mn\left(\lambda_x\lambda_y + 2\lambda_x\left(\lambda_x\lambda_y-\alpha_{R}^2p(x)p(y)\right) \right.\notag\\&\qquad\left.+ 2\lambda_y\left(\lambda_x\lambda_y-\alpha_{R}^2p(x)p(y)\right) + 2\left(\lambda_x\lambda_y-\alpha_{R}^2p(x)p(y)\right)^2 \right) \notag\\ &\qquad+ mn(m-1)\left( \lambda_x^2\lambda_y+\lambda_x\lambda_y^2 + 4\lambda_x\lambda_y\left(\lambda_x\lambda_y-\alpha_{R}^2p(x)p(y)\right) \right) \notag\\ &\qquad + mn(m-1)(m-2) \lambda_x^2\lambda_y^2 \notag\\ &= m^2n^2 \lambda_x^2 \lambda_y^2 + mn^2 (\lambda_x^2 \lambda_y + \lambda_x \lambda_y^2) + n^2 \lambda_x \lambda_y - 4\alpha_{R}^2m^2np(x) p(y) \lambda_x \lambda_y \notag\\ &\qquad- 2 \alpha_{R}^2 mn\left( p(x) p(y) \lambda_x + p(x) p(y) \lambda_y \right) + 2\alpha_{R}^4 mnp(x)^2 p(y)^2 -\alpha_{R}^2 np(x) p(y)\,, \end{align}\tag{19}\]
Upon combining 17 18 19 with 16 and further simplifying the expressions, we get \[\begin{align} \operatorname{Cov}\mleft( f(N_x) , f(N_y) \mright) &= 2 \alpha_{R}^4 n(n-1) \left( p(x)^2 p(y)^2 - 2(n-1) p(x) p(y) \left(p(x)-\tfrac{1}{k}\right)\left(p(y)-\tfrac{1}{k}\right) \right)\,. \end{align}\] We proceed by summing both sides over pairs of distinct \(x,y\in[k]\) to obtain \[\begin{align} &\sum_{x\neq y}\operatorname{Cov}\mleft( f(N_x) , f(N_y) \mright) \\ &= 2\alpha_{R}^4n(n-1)\sum_{x\neq y} p(x)^2p(y)^2 - 4\alpha_{R}^4n(n-1)^2 \sum_{x\neq y} p(x)p(y)\left(p(x)-\tfrac{1}{k}\right)\left(p(y)-\tfrac{1}{k}\right) \\ &= 2\alpha_{R}^4n(n-1)\left( {\lVert p{\rVert}}_2^4 - {\lVert p{\rVert}}_4^4 \right) - 4\alpha_{R}^4n(n-1)^2 \left( {\lVert p-u{\rVert}}_2^4 - \sum_{x\in[k]} p(x)^2\left(p(x)-\tfrac{1}{k}\right)^2 \right)\\ &\leq 2\alpha_{R}^4n^2+ 4\alpha_{R}^4n(n-1)^2 {\lVert p-u{\rVert}}_2^2\\ &\leq 2n^2 + 4\alpha_{R}^2n(n-1)^2{\lVert p-u{\rVert}}_2^2\,, \end{align}\] where we have used \(\sum_{x\in[k]} p(x)\left(p(x)-\frac{1}{k}\right) = {\lVert p{\rVert}}_2^2-1/k= {\lVert p-u{\rVert}}_2^2\) and bounded the non-negative terms.
This completes our bound for the cross-variance terms. Turning now to the variances, we note that \[\begin{align} \operatorname{Var}\mleft( f(N_x) \mright) &= 2 n(n-1) \lambda_x^2(1-\lambda_x)^2 + 4n(n-1)^2\lambda_x(1-\lambda_x) (\lambda-\lambda_x)^2 \\ &\leq \frac{1}{8}n^2 + \alpha_{R}^2n(n-1)^2\left(p(x)-\tfrac{1}{k}\right)^2, \end{align}\] where the previous inequality holds since \(\lambda_x\in[0,1]\). It follows that \[\begin{align} \sum_{x\in[k]}\operatorname{Var}\mleft( f(N_x) \mright) &\leq \frac{1}{8}n^2k+ \alpha_{R}^2n(n-1)^2{\lVert p-u{\rVert}}_2^2\,. \end{align}\] Putting everything together, we conclude \[\operatorname{Var}\mleft(T\mright) = \sum_{x\in[k]}\operatorname{Var}\mleft( f(N_x) \mright) + \sum_{x\neq y}\operatorname{Cov}\mleft( f(N_x) , f(N_y) \mright) \leq \frac{17}{8}n^2 + 5\alpha_{R}^2n(n-1)^2{\lVert p-u{\rVert}}_2^2\,,\] proving the lemma. ◻
Theorem 18 (Joint probability perturbation concentration, restated). Consider a matrix \(\delta\in\mathbb{R}^{k\times k}\) such that, for every \(i_0,j_0\in[k]\), \(\sum_{j\in [k]}\delta_{i_0,j}=\sum_{i\in [k]}\delta_{i,j_0} = 0\). Let random variables \(X=(X_1, \dots, X_k)\) and \(Y=(Y_1, \dots, Y_k)\) be independent and uniformly distributed over \(k\)-length binary sequences of weight \(k/2\). Define \(Z = \sum_{(i,j)\in [k]\times[k]}\delta_{ij}X_iY_j\). Then, there exist constants \(c_1,c_2,\rho>0\) such that \[\Pr\mleft[\, \frac{Z^2}{ \lVert\delta{\rVert}_F^2}\in [c_1,c_2]\, \mright]\geq \rho.\]
Proof. The proof is similar to that of 6, with further technicalities difficulties arising since the random variables \((X_i,Y_j)\) assigned as weights to \(\delta_{ij}\), \(1\leq i,j\leq k\), are not \(4\)-symmetric (as a pair). However, \(\delta\) has an additional structure since both its rows and columns sum to zero; we complete the proof by exploiting this property and the fact that \(X_i\)’s and \(Y_j\)’s are individually \(4\)-symmetric. As before, we use the notation \(m_S :=\mathbb{E}\mleft[\prod_{i\in S} X_i\mright]\), and moreover, let \(m'_S :=\mathbb{E}\mleft[\prod_{i\in S} Y_i\mright]\).
First, observe that by independence of \(X_i\)’s and \(Y_j\)’s and since \(\sum_{(i,j)\in [k]\times[k]}\delta_{ij} = 0\), we have \[\mathbb{E}\mleft[Z\mright] = \sum_{(i,j)\in [k]\times[k]}\delta_{ij} \mathbb{E}\mleft[X_i\mright]\mathbb{E}\mleft[Y_j\mright] = m_{\{1\}}m'_{\{1\}}\sum_{(i,j)\in [k]\times[k]}\delta_{ij} = 0\,.\] Furthermore, \[\begin{align} \operatorname{Var}\mleft(Z\mright) = \mathbb{E}\mleft[Z^2\mright] &= \sum_{(i_1,j_1)\in[k]\times[k]}\sum_{(i_2,j_2)\in[k]\times[k]}\delta_{i_1j_1}\delta_{i_2j_2} \mathbb{E}\mleft[X_{i_1}X_{i_2}\mright]\mathbb{E}\mleft[Y_{j_1}Y_{j_2}\mright] \\ &= \sum_{i_1,i_2} \mathbb{E}\mleft[X_{i_1}X_{i_2}\mright] \sum_{j_1,j_2}\delta_{i_1j_1}\delta_{i_2j_2}\mathbb{E}\mleft[Y_{j_1}Y_{j_2}\mright]\\ &= \sum_{i_1,i_2} \mathbb{E}\mleft[X_{i_1}X_{i_2}\mright] \left( m'_{\{1,1\}}\sum_{j_1}\delta_{i_1j_1}\delta_{i_2j_1} + m'_{\{1,2\}} \sum_{j_1\neq j_2}\delta_{i_1j_1}\delta_{i_2j_2} \right)\\ &= \sum_{i_1,i_2} \mathbb{E}\mleft[X_{i_1}X_{i_2}\mright] \Bigg( (m'_{\{1,1\}}-m'_{\{1,2\}})\sum_{j}\delta_{i_1j}\delta_{i_2j} + m'_{\{1,2\}} \Big(\sum_{j}\delta_{i_1j} \Big)^2 \Bigg)\\ &= (m'_{\{1,1\}}-m'_{\{1,2\}})\sum_{i_1,i_2} \sum_{j}\delta_{i_1j}\delta_{i_2j} \mathbb{E}\mleft[X_{i_1}X_{i_2}\mright]\, , \end{align}\] where the previous identity uses \(\sum_{j}\delta_{i_1j} = 0\). Repeating the same manipulations with the outer sum, we get \[\begin{align} \operatorname{Var}\mleft(Z\mright) = \mathbb{E}\mleft[Z^2\mright] &= (m'_{\{1,1\}}-m'_{\{1,2\}})\sum_{j} \Bigg( m_{\{1,1\}}\sum_{i} \delta_{ij}^2 + m_{\{1,2\}}\sum_{i_1\neq i_2} \delta_{i_1j}\delta_{i_2j} \Bigg) \notag\\ &= (m'_{\{1,1\}}-m'_{\{1,2\}})\sum_{j} \Bigg( (m_{\{1,1\}}-m_{\{1,2\}})\sum_{i} \delta_{ij}^2 + m_{\{1,2\}}\Big(\sum_{i} \delta_{i,j}\Big)^2 \Bigg) \notag\\ &= (m_{\{1,1\}}-m_{\{1,2\}})(m'_{\{1,1\}}-m'_{\{1,2\}})\lVert\delta{\rVert}_F^2 \,. \end{align}\] Up to this point, our calculations are valid for any independent choice of \(4\)-symmetric \((X_1,\dots,X_k)\) and \((Y_1, \dots, Y_k)\). For our specific choice, using calculations from the proof of 2, we obtain the following: \[\frac{1}{16} \lVert\delta{\rVert}_F^2 \leq \operatorname{Var}\mleft(Z\mright) = \frac{1}{4} \mathbb{E}\mleft[(X_1-X_2)^2\mright]\mathbb{E}\mleft[(Y_1-Y_2)^2\mright] \lVert\delta{\rVert}_F^2 \leq \frac{1}{4}\lVert\delta{\rVert}_F^2\,.\] It remains to bound the fourth moment of \(Z\); for simplicity, we provide this proof only for our specific choice of random variables. We have \[\begin{align} \mathbb{E}\mleft[Z^4\mright] &= \sum_{(i_1,j_1)}\sum_{(i_2,j_2)}\sum_{(i_3,j_3)}\sum_{(i_4,j_4)}\delta_{i_1j_1}\delta_{i_2j_2}\delta_{i_3j_3}\delta_{i_4j_4} \mathbb{E}\mleft[X_{i_1}X_{i_2}X_{i_3}X_{i_4}\mright]\mathbb{E}\mleft[Y_{j_1}Y_{j_2}Y_{j_3}Y_{j_4}\mright] \notag\\ &= \sum_{i_1,i_2,i_3,i_4} \mathbb{E}\mleft[X_{i_1}X_{i_2}X_{i_3}X_{i_4}\mright] \sum_{j_1,j_2,j_3,j_4} \mathbb{E}\mleft[Y_{j_1}Y_{j_2}Y_{j_3}Y_{j_4}\mright] \delta_{i_1j_1}\delta_{i_2j_2}\delta_{i_3j_3}\delta_{i_4j_4} \nonumber\,. \end{align}\] Consider the inner summation for an arbitrary fixed choice of \(i_1, i_2, i_3, i_4\). We show first that the inner summation can be expressed as \[\begin{align} \alpha_k\sum_{j}\delta_{i_1j}\delta_{i_2j}\delta_{i_3j}\delta_{i_4j} + \beta_k\sum_{j}\delta_{i_1j}\delta_{i_2j}\cdot \sum_j\delta_{i_3j}\delta_{i_4j}, \label{e:remaining:term} \end{align}\tag{20}\] for appropriate coefficients \(\alpha_k\) and \(\beta_k\). To that end, we introduce the notations: For \(\ell\leq 4\), denote \[\begin{align} p_\ell(j_1, \dots, j_{\ell}) &:=\Pr\mleft[\, Y_{j_1}=1, \dots, Y_{j_\ell}=1\, \mright] \\ p_\ell(j_1, \dots, j_{\ell-1}) &:=\Pr\mleft[\, Y_{j_\ell}=1\mid Y_{j_1}=1, \dots, Y_{j_{\ell-1}}=1\, \mright], \quad j_\ell\notin\{j_1, \dots, j_{\ell-1}\}, \\ p_\ell(j_1, \dots, j_{m}) &:=\Pr\mleft[\, Y_{j_\ell}=1\mid Y_{j_1}=1, \dots, Y_{j_{m}}=1, Y_{j_{m+1}} =1, \dots, Y_{j_{\ell-1}} =1 \, \mright], \\ &\qquad\qquad\qquad j_r \notin \{j_1, \dots, j_{m}\},\,\, j_r \text{ distinct for } m+1< r\leq \ell, \end{align}\] and the corresponding notation \(q_\ell(j_1, \dots, j_{m}) :=1- p_\ell(j_1, \dots, j_m)\). With this in hand, we can write \[\begin{align} \sum_{j_1,j_2,j_3,j_4}&\delta_{i_1j_1}\delta_{i_2j_2}\delta_{i_3j_3}\delta_{i_4j_4}\mathbb{E}\mleft[Y_{j_1}Y_{j_2}Y_{j_3}Y_{j_4}\mright] \\ &=\sum_{j_1,j_2,j_3}\delta_{i_1j_1}\delta_{i_2j_2}\delta_{i_3j_3}\left(\sum_{j_4\in \{j_1, j_2, j_3\}}\delta_{i_4j_4} \mathbb{E}\mleft[Y_{j_1}Y_{j_2}Y_{j_3}\mright] + \sum_{j_4\notin \{j_1, j_2, j_3\}}\delta_{i_4j_4} \mathbb{E}\mleft[Y_{j_1}Y_{j_2}Y_{j_3}Y_{j_4}\mright]\right) \\ &=\sum_{j_1,j_2,j_3}p_3(j_1, j_2, j_3)\delta_{i_1j_1}\delta_{i_2j_2}\delta_{i_3j_3}\left(\sum_{j_4\in \{j_1, j_2, j_3\}}\delta_{i_4j_4} + p_4(j_1, j_2, j_3)\sum_{j_4\notin \{j_1, j_2, j_3\}}\delta_{i_4j_4}\right) \\ &=\sum_{j_1,j_2,j_3}p_3(j_1, j_2, j_3)q_4(j_1, j_2, j_3)\delta_{i_1j_1}\delta_{i_2j_2}\delta_{i_3j_3}\sum_{j_4\in \{j_1, j_2, j_3\}}\delta_{i_4j_4}, \end{align}\] where we have used \(\sum_{j}\delta_{i_4, j}=0\) in the previous identity. Next, note that each term in the sum above has, by symmetry, the form \[\begin{align} &\sum_{j_1,j_2,j_3}p_3(j_1,j_2, j_3)q_4(j_1, j_2,j_3)\delta_{i_1j_1}\delta_{i_2j_2}\delta_{i_3j_3}\delta_{i_4j_1} \\ &=\sum_{j_1,j_2}p_2(j_1, j_2) \Big( q_3(j_1, j_2)\sum_{j_3\in \{j_1, j_2\}}\delta_{i_1j_1}\delta_{i_2j_2}\delta_{i_3j_3}\delta_{i_4j_1} + p_3(j_1, j_2)q_4(j_1, j_2)\sum_{j_3\notin \{j_1, j_2\}}\delta_{i_1j_1}\delta_{i_2j_2}\delta_{i_3j_3}\delta_{i_4j_1}\Big) \\ &=\sum_{j_1,j_2}p_2(j_1, j_2) \Big(1- p_3(j_1, j_2)\big(1+q_4(j_1, j_2)\big)\Big) \sum_{j_3\in \{j_1, j_2\}}\delta_{i_1j_1}\delta_{i_2j_2}\delta_{i_3j_3}\delta_{i_4j_1}, \end{align}\] where we have once again used \(\sum_{j_3}\delta_{i_3, j_3}=0\) to obtain the last line from the second-to-last. This leaves us with terms of the form \[\begin{align} \sum_{j_1,j_2}p_2(j_1,j_2)\Big(1- p_3(j_1, j_2)\big(1+q_4(j_1, j_2)\big)\Big) \left( \delta_{i_1j_1}\delta_{i_2j_2}\delta_{i_3j_1}\delta_{i_4j_1} + \delta_{i_1j_1}\delta_{i_2j_2}\delta_{i_3j_2}\delta_{i_4j_1}\right). \end{align}\] Finally, splitting the summation above into terms with \(j_1=j_2\) and \(j_1\neq j_2\), we end up with terms of the form 20 . Note that the resulting coefficients \(\alpha_k,\beta_k\) entail terms dependent on \(k\) which can be handled and bounded (crucially, independently of \(k\)) in the manner of proof of 2.
To complete the proof, we handle each term in 20 separately. For the first, we obtain \[\begin{align} \sum_{j}\sum_{i_1,i_2,i_3, i_4}\delta_{i_1j}\delta_{i_2j}\delta_{i_3j}\delta_{i_4j} \mathbb{E}\mleft[X_1X_2X_3X_4\mright] \leq 19\mathbb{E}\mleft[X_1^4\mright]\sum_j\Big( \sum_{i}\delta_{ij}^2\Big)^2 \leq 19\mathbb{E}\mleft[X_1^4\mright]\lVert\delta{\rVert}_F^2\,, \nonumber \end{align}\] where the inequality uses 15 . For the second term, note that \[\begin{align} \sum_{i_1,i_2,i_3,i_4}X_{i_1}X_{i_2}X_{i_3}X_{i_4} \sum_{j}\delta_{i_1j}\delta_{i_2j}\cdot \sum_{j^\prime}\delta_{i_3j^\prime}\delta_{i_4j^\prime} &= \Big(\sum_{j}\Big(\sum_{i}X_i\delta_{ij}\Big)^2\Big)^2, \end{align}\] whereby the expected value of the left-side can be bounded by \[\begin{align} \mathbb{E}\mleft[\left(\sum_{j}\left(\sum_{i}X_i\delta_{ij}\right)^2\right)^2\mright] &= \sum_{j, j^\prime}\mathbb{E}\mleft[\left(\sum_{i}X_i\delta_{ij}\right)^2\left(\sum_{i}X_i\delta_{ij^\prime}\right)^2\mright] \\ &\leq \sum_{j, j^\prime}\sqrt{\mathbb{E}\mleft[\left(\sum_{i}X_i\delta_{ij}\right)^4\mright]\mathbb{E}\mleft[ \left(\sum_{i}X_i\delta_{ij^\prime}\right)^4\mright]} \\ &\leq 19 \mathbb{E}\mleft[X_1^4\mright] \sum_{j, j^\prime} {\lVert\delta_{\cdot, j}{\rVert}}_2^2{\lVert\delta_{\cdot, j^\prime}{\rVert}}_2^2, \end{align}\] where the final inequality uses 15 . The sum on the right-side can be seen to simplify as \[\begin{align} \sum_{j, j^\prime} {\lVert\delta_{\cdot, j}{\rVert}}_2^2{\lVert\delta_{\cdot, j^\prime}{\rVert}}_2^2 = \sum_{j, j^\prime}\sum_{i}\delta_{i,j}^2 \sum_{i}\delta_{i,j^\prime}^2 = \left(\sum_{ij}\delta_{i,j}^2\right)^2 =\lVert\delta{\rVert}_F^4. \end{align}\] Therefore, on combining the observations above, we obtain \[\mathbb{E}\mleft[Z^4\mright]\leq c^\prime \lVert\delta{\rVert}_F^4,\] for an appropriate absolute constant \(c'\). The proof is completed in the manner of that of 6 using the Paley–Zygmund inequality. ◻
Cornell University. Email: acharya@cornell.edu.↩︎
Stanford University. Email: ccanonne@cs.stanford.edu. Supported by a Motwani Postdoctoral Fellowship.↩︎
Cornell University. Email: cfreitag@cs.cornell.edu.↩︎
Indian Institute of Science. Email: htyagi@iisc.ac.in.↩︎
The more general question asks to test independence of distributions over \([k_1]\times[k_2]\), or even over \([k_1]\times\dots\times[k_d]\). Optimal (non-private) sample complexities for these generalizations are also known [29].↩︎
As is typical, we set that probability to be \(2/3\); by a standard argument, this can be amplified to any \(1-\delta\) at the price of an extra \(O(\log(1/\delta))\) factor in the sample complexity and running time.↩︎
Note that for public-coin mechanisms, one can define \(\tilde{W}\colon{\cal X}\to{\cal Y}\), as there is no need for a user to communicate the random index \(I\) to the referee.↩︎
To see that our desired statement cannot hold as stated above, note that for \(p=u\), 9 implies \(q(z_1) = \frac{1+\alpha_{H}}{K}\), since \(\left\lvert D_{z_1} \right\rvert=k\) as the first column of \(H_K\) is the all-one vector. Thus the squared \(\ell_{2}\) distance of \(q\) to uniform is at least \(\alpha_{H}^2/K\).↩︎
[18] require that \(b\geq \max({\lVert p{\rVert}}_2, {\lVert q{\rVert}}_2)\); [29] shows how to relax this requirement to \(b\geq \min({\lVert p{\rVert}}_2, {\lVert q{\rVert}}_2)\).↩︎
This is significantly better than the \(O(k)\) time and communication per player of 4.↩︎
Recall that \(K\) is a power of two, so \([K]\) can be identified to \(\{0,1\}^{\log K}\).↩︎
Which stands for Randomized Aggregated Private Testing Optimal Response.↩︎
In fact, we only need \(1\)-bit per sample if we allow asymmetric implementation.↩︎
That is, if \(\mathbb{E}\mleft[X_{i_1}X_{i_2}X_{i_3}X_{i_4}\mright]\) does not depend on the actual values of \(i_1,i_2,i_3,i_4\) (for which there are \(k^4\) possibilities) but only on the quantities \(\mathbb{1}_{\left\{i_a=i_b\right\}}\), for \(1\leq a< b\leq 4\) (for which there are \(2^{\binom{4}{2}}\) possibilities).↩︎
To preserve the symmetry of our mechanism, we note that this can be done “in parallel” at each user. That is, each user considers the same \(T = \Theta(1)\) many random subsets, and sends their corresponding \(T\) privatized (with parameter \(\varepsilon' = \varepsilon/T\)) indicator bits to the curator.↩︎
Namely, letting the server divide the received samples into \(O(\log(1/\delta))\) disjoint batches, and running the private estimation procedure of 2 independently \(T\) times, before outputting the majority vote.↩︎
This statement differs slightly from that in [17], but can be seen to follow from their analysis. Indeed, the difference only impacts the analysis of the variance of their estimator, which now goes through because of our assumption on \(\min_{x\in[k]}q(x)\).↩︎
There are \((K+1)^2\) characters for \([K]\times[K]\) of the form \(\chi_T(z_1)\chi_S(z_2)\), \(\chi_T(z_1)\), and \(\chi_T(z_2)\) for \(S,T\subseteq [K]\), along with the constant character. Note that the constant character will not appear in the proof of 5, as we consider the transform of the difference of two functions, canceling the constant term.↩︎
As was the case for our uniformity testing algorithm, to preserve the symmetry of our mechanism we can ask that these \(O(1)\) repetitions be done “in parallel” at each user; further, for each of these repetitions every user sends three privatized bits to the central server, corresponding to the indicators of \(S_1\times[k]\), \([k]\times S_2\), and \(S_1\times S_2\).↩︎