# The Correlated Gaussian Sparse Histogram Mechanism

Christian Janos Lebeda, Lukas Retschmeier

► To cite this version:

Christian Janos Lebeda, Lukas Retschmeier. The Correlated Gaussian Sparse Histogram Mechanism. Symposium on Foundations of Responsible Computing (FORC 2025), Jun 2025, Standford, United States. 10.4230/LIPIcs.FORC.2025.23 . hal-04895301

HAL Id: hal-04895301

https://inria.hal.science/hal-04895301v1

Submitted on 17 Jan 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# The Correlated Gaussian Sparse Histogram Mechanism

CHRISTIAN JANOS LEBEDA*, Inria, University of Montpellier, France

LUKAS RETSCHMEIER*, BARC, University of Copenhagen, Denmark

We consider the problem of releasing a sparse histogram under $(\epsilon, \delta)$-differential privacy. The stability histogram independently adds noise from a Laplace or Gaussian distribution to the non-zero entries and removes those noisy counts below a threshold. Thereby, the introduction of new non-zero values between neighboring histograms is only revealed with probability at most $\delta$, and typically, the value of the threshold dominates the error of the mechanism. We consider the variant of the stability histogram with Gaussian noise. Recent works ([Joseph and Yu, COLT '24] and [Lebeda, SOSA '25]) reduced the error for private histograms using correlated Gaussian noise. However, these techniques can not be directly applied in the very sparse setting. Instead, we adopt Lebeda's technique and show that adding correlated noise to the non-zero counts only allows us to reduce the magnitude of noise when we have a sparsity bound. This, in turn, allows us to use a lower threshold by up to a factor of 1/2 compared to the non-correlated noise mechanism. We then extend our mechanism to a setting without a known bound on sparsity. Additionally, we show that correlated noise can give a similar improvement for the more practical discrete Gaussian mechanism.

## 1 Introduction

Releasing approximate counts is a common task in differential private data analysis. For example, the task of releasing a search engine log, where one wants to differentially private release the number of users who have searched each possible search term.

The full domain of search terms is too large to work with directly, but the vector of all search counts is extremely sparse as most phrases are never searched. The standard approach to exploit sparsity while ensuring differential privacy is the stability histogram [Aumüller et al. 2022; Balcer and Vadhan 2019; Bun et al. 2016; Google Anonymization Team 2020; Gotz et al. 2012; Korolova et al. 2009; Wilson et al. 2020]. The idea is to preserve sparsity by filtering out zero counts and then adding noise from a suitable probability distribution to the remaining ones. Unfortunately, some filtered-out counts could be non-zero in a neighboring dataset, and thus, revealing any of them would violate privacy. To limit this privacy violation, the stability histogram introduces a threshold $\tau$ and releases only those noisy counts that exceed $1 + \tau$. This way, we might still reveal the true dataset among a pair of neighboring datasets if one of these counters exceeds the threshold, but with an appropriate choice of $\tau$, this is extremely unlikely to happen.

In our setting, one single user may contribute to many counts; hence, using the Gaussian Sparse Histogram Mechanism (GSHM) [Google Anonymization Team 2020; Wilkins et al. 2024] might be preferable. The GSHM is similar to the stability histogram, but it replaces noise from the Laplace distribution with Gaussian noise. To analyze the $(\epsilon, \delta)$ guarantees of the GSHM, one has to find an upper bound for $\delta$, which is influenced by the standard Gaussian mechanism and the small probability of infinite privacy loss that can happen when the noise exceeds $\tau$. We denote these two quantities as $\delta_{gauss}$ and $\delta_{inf}$. Recently, Wilkins et al. [2024] gave exact privacy guarantees of the GSHM, which improves over the analysis by Google Anonymization Team [2020] where $\delta_{gauss}$ and $\delta_{inf}$ were simply added together. Their main contribution is a more intricate case distinction of a single user's impact on the values of $\delta_{gauss}$ and $\delta_{inf}$. This allows them to use a lower threshold with the same privacy parameters. Their improvement lies in the constants, but it can be significant in practical applications because the tighter analysis essentially gives better utility at no privacy cost.

<footnote>*All authors contributed equally to this research.</footnote>
Our goal is to reduce the error further. Because the previous analysis is exact, we must exploit some additional structure of the problem. Consider a $d$-dimensional histogram $H(X) = \sum_{i=1}^{n} X_i$ for $X = (X_1, \dots, X_n)$ for users with data $X_i \in \{0, 1\}^d$. Notice that adding a single user to $X$ can only increase counts in $H(X)$, whereas removing one can only decrease counts. Lebeda [2024] recently showed how to exploit this monotonicity by adding a small amount of correlated noise. This reduces the total magnitude of noise almost by a factor of 2 compared to the standard Gaussian Mechanism. So, it is natural to ask if we can adapt this technique to the setting when the histogram is sparse. This motivates our main research question:

**Question:** Can we take advantage of monotonicity and use correlated noise to improve the *Gaussian Sparse Histogram Mechanism*?

## 1.1 Our Contribution

We answer this question in the affirmative and introduce the *Correlated Stability Histogram (CSH)*. Building on the work by Lebeda [2024], we extend their framework to the setting of releasing a histogram under a sparsity constraint, that is $||H(X)||_0 \le k$ for some known $k$. This is a natural setting that occurs e.g. for Misra-Gries sketches, where $k$ is the size of the sketch [Lebeda and Tetek 2023; Misra and Gries 1982].

**Correlated GSHM.** We introduce the *Correlated Stability Histogram (CSH)*, a variant of the GSHM using correlated noise. Our algorithm achieves a better utility-privacy trade-off than GSHM for $k$-sparse histograms. Similar to the result of Lebeda [2024], we show that correlated noise can reduce the error by almost a factor of 2 at no additional privacy cost. In particular, our main result lies in the following (informally stated) theorem:

**THEOREM 1.1 (THE CORRELATED STABILITY HISTOGRAM (INFORMAL)).** Let $H(X) = \sum_{i=1}^{n} X_i$ denote a histogram with bounded sparsity, where $X = (X_1, \dots, X_n)$ and $X_i \in \{0, 1\}^d$. If the GSHM privately releases $H(X)$ under $(\epsilon, \delta)$-DP with noise magnitude $\sigma$ and removes noisy counters below a threshold $\tau$, then the Correlated Stability Histogram (CSH) releases $H(X)$ also under $(\epsilon, \delta)$-DP with noise of magnitude $\sigma/2 + o(1)$ and removes noisy counters below a threshold $\tau/2 + o(1)$.

As a baseline, we first analyze our mechanism using the *add-the-deltas* [Google Anonymization Team 2020] approach and show that even this approach outperforms the exact analysis in [Wilson et al. 2020] in many settings. We then turn our attention to a tighter analysis, which uses an intricate case distinction to upper bound the parameter $\delta$. The proof by Wilkins et al. [2024] does not carry directly over because of the increased complexity due to the correlated noise sample. Furthermore, we complement our approach with the following results:

**Generalization & Extensions.** We extend our mechanism to multiple other settings, including extensions considered in Wilkins et al. [2024]. First, we generalize our approach to allow an additional threshold that filters out infrequent data in a pre-processing step. Second, we discuss how other aggregate database queries can be included in our mechanism. Last, we generalize to top-$k$ counting queries when we have no bound for $||H(X)||_0$.

**Discrete Gaussian Noise.** Our mechanism achieves the same improvement over GSHM when noise is sampled from the discrete Gaussian rather than the continuous distribution. We present a simple modification to make our mechanism compatible with discrete noise. This has practical relevance even for the dense setting considered by Lebeda [2024].

Additionally, *Experimental* evaluations support our claim that our approach can improve utility by up to a factor of 2 compared with the standard GSHM.
**Organization.** The rest of the paper is organized as follows. Section 2 introduces the problem formally and reviews the required background. Section 3 introduces the Correlated Stability Histogram, our main algorithmic contribution for the sparse case. Furthermore, in Section 4 we generalize our approach to the non-sparse setting. The experiments in Section 5 confirm our claim that we improve the error over previous techniques. The extensions of our technique to match the setting of Wilkins et al. [2024] are discussed in Section 6. In Section 7, we show how to adapt our mechanism for discrete Gaussian noise. Finally, we conclude the paper in Section 8 and discuss open problems for future work.

## 2 Preliminaries and Background

Given a dataset $X \in \mathcal{U}^N$, we want to perform an aggregate query $\mathcal{A}$ under differential privacy. We focus on settings where each user has a set of elements, and we want to estimate the count of all elements over the dataset. Therefore, we consider a dataset $X = (X_1, \dots, X_n)$ of $n$ data points where each $X_i \in \{0, 1\}^d$. Our goal is to output a private estimate of the histogram $H(X) \in \mathbb{N}^d$, where $H(X) = \sum_{i=1}^n X_i$. For some vector $H \in \mathbb{R}^d$, we define the support as $U(H) = \{i \in [d] : H_i \neq 0\}$ and denote the $l_0$ norm as $\|H\|_0 := |U(H)|$, being the number of non-zeroes in $H$. In this work, we focus on settings where the dimension $d$ is very large or infinite.

Proposed by Dwork et al. [2006b], differential privacy (DP) is a property of a randomized mechanism. The intuition behind differential privacy is that privacy is preserved by ensuring that the output distribution does not depend much on any individual's data. In this paper, we consider $(\epsilon, \delta)$-differential privacy (sometimes referred to as approximate differential privacy) together with the add-remove variant of neighboring datasets as defined below. Note that by this definition $|X| = n$ and $|X'| = n \pm 1$:

**Definition 2.1 (Neighboring datasets).** A pair of datasets are neighboring, denoted $X \sim X'$, if there exists an $i$ such that either $X = (X'_1, \dots, X'_{i-1}, X'_{i+1}, \dots, X'_{n+1})$ or $X' = (X_1, \dots, X_{i-1}, X_{i+1}, \dots, X_n)$ holds.

**Definition 2.2 ([Dwork and Roth 2014] $(\epsilon, \delta)$-differential privacy).** Given $\epsilon$ and $\delta$, a randomized mechanism $\mathcal{M}: \mathcal{U}^N \to \mathcal{Y}$ satisfies $(\epsilon, \delta)$-DP, if for every pair of neighboring datasets $X \sim X'$ and every measurable set of outputs $Y \in \mathcal{Y}$ it holds that

$$ \Pr[\mathcal{M}(X) \in Y] \le e^{\epsilon} \Pr[\mathcal{M}(X') \in Y] + \delta. $$

Differential privacy is immune to post-processing: Let $\mathcal{M}: \mathcal{U}^N \to \mathbb{R}$ be a randomized algorithm that is $(\epsilon, \delta)$-DP. Let $f: \mathbb{R} \to \mathbb{R}'$ be an arbitrary randomized mapping. Then $f \circ \mathcal{M}: \mathcal{U}^N \to \mathbb{R}'$ is $(\epsilon, \delta)$-DP.

An important concept in differential privacy is the sensitivity of a query, which restricts the difference between the output for any pair of neighboring datasets. We consider both the $l_2$ sensitivity and, more generally, the sensitivity space of the queries in this paper.

**Definition 2.3 (Sensitivity space and $l_2$ sensitivity).** The sensitivity space of a deterministic function $f: \mathcal{U}^N \to \mathbb{R}^d$ is the set $\Delta f = \{f(X) - f(X') \in \mathbb{R}^d | X \sim X'\}$. The $l_2$ sensitivity of $f$ is defined as

$$ \Delta_2 f = \max_{X \sim X'} \|f(X) - f(X')\|_2 = \max_{x \in \Delta f} \|x\|_2, $$

where $\|x\|_2 = \sqrt{\sum_{i=1}^d x_i^2}$ denotes the $l_2$ norm of any $x \in \mathbb{R}^d$.

The standard Gaussian mechanism adds continuous noise from a Gaussian distribution with magnitude scaled according to Lemma 2.5.

**Definition 2.4 (Gaussian Distribution).** The zero-centered Gaussian distribution (Normal distribution) $N(0, \sigma^2)$ with variance $\sigma^2$ has pdf $\phi(x, \sigma^2) = \frac{1}{2\pi\sigma^2} \exp(-\frac{x^2}{2\sigma^2})$. We denote the cdf of the Gaussian distribution as $\Phi(X)$. We refer to $\Phi^{-1}$ as the inverse CDF of the Gaussian distribution.
**Lemma 2.5** ([Balle and Wang 2018, Theorem 8] The Gaussian Mechanism). Let $f: \mathcal{U}^{\mathbb{N}} \to \mathbb{R}^d$ denote a function with $\ell_2$ sensitivity at most $\Delta_2 f$. Then the mechanism that outputs $f(X) + Z$, where $Z \sim \mathcal{N}(0, \sigma^2 \mathbf{I}_d)$, satisfies $(\epsilon, \delta)$-differential privacy if the following inequality holds

$$ \Phi\left(\frac{\Delta_2 f}{2\sigma} - \frac{\epsilon\sigma}{\Delta_2 f}\right) - e^{\epsilon}\Phi\left(-\frac{\Delta_2 f}{2\sigma} - \frac{\epsilon\sigma}{\Delta_2 f}\right) \le \delta. $$

## 2.1 The Gaussian Sparse Histogram Mechanism

We consider the problem of privately releasing the histogram $H(X)$ of a dataset $X = (X_1, \dots, X_n)$ where each $X_i \in \{0, 1\}^d$. The standard techniques for releasing a private histogram are the well-known Laplace mechanism [Dwork et al. 2006b] and Gaussian mechanism [Balle and Wang 2018; Dwork et al. 2006a], which achieve $\epsilon$- and $(\epsilon, \delta)$-DP, respectively. Although this works well for dense data, it is unsuited for very sparse data where $\|H(X)\|_0 \ll d$ because adding noise to all entries increases both the maximum error as well as the space and time requirements. Furthermore, the mechanisms are undefined for infinite domains ($d = \infty$).

In the classic sparse histogram setting where $\|X_i\|_0 = 1$ under $(\epsilon, \delta)$-DP, the preferred technique is the stability histogram which combines Laplace noise with a thresholding technique (see [Aumüller et al. 2022; Balcer and Vadhan 2019; Bun et al. 2016; Google Anonymization Team 2020; Gotz et al. 2012; Korolova et al. 2009; Wilson et al. 2020]).

In this paper, we consider the Gaussian Sparse Histogram Mechanism (see [Google Anonymization Team 2020; Wilkins et al. 2024]), which replaces Laplace noise in the stability histogram with Gaussian noise. This is often preferred when users can contribute multiple items as the magnitude of noise is scaled by the $\ell_2$ sensitivity instead of the $\ell_1$ sensitivity. The GSHM adds Gaussian noise to each non-zero counter of $H(X)$ and removes all counters below a threshold $1 + \tau$. Find the pseudocode in Algorithm 1. We discuss the impact of the parameter $\tau$ below.

<caption>**Algorithm 1** The Gaussian Sparse Histogram Mechanism (GSHM)</caption>

**Input:** Parameters $\sigma$ and $\tau$, histogram $H(X) \in \mathbb{N}^d$.
1: Let $\tilde{H} = \{0\}^d$.
2: for each $i \in [d]$ where $H(X)_i \ne 0$ do
3: &nbsp;&nbsp;&nbsp;&nbsp;Sample $Z_i \sim N(0, \sigma^2)$.
4: &nbsp;&nbsp;&nbsp;&nbsp;if $H(X)_i + Z_i > 1 + \tau$ then
5: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set $\tilde{H}_i = H(X)_i + Z_i$.
6: &nbsp;&nbsp;&nbsp;&nbsp;end if
7: end for
8: Release $\tilde{H}$.

To get $(\epsilon, \delta)$ differential privacy guarantees, we observe that there are two sources of privacy loss that have to be accounted for by the value of $\delta$: $\delta_{gauss}$ from the Gaussian noise itself and the probability of infinite privacy loss $\delta_{inf}$, when a zero count is ignored in one dataset, but possibly released in a neighboring one. These events have infinite privacy loss because they can only occur for one of the datasets. Therefore, $\delta_{inf}$ bounds the possibility of outputting a counter that is not present in the neighboring dataset. Figure 2 gives some intuition about the role of $\delta_{gauss}$ and $\delta_{inf}$. Throughout this section, we assume that $\|X_i\|_0 \le k$ for some known integer $k \ll d$. Next, we discuss two approaches for obtaining the overall privacy guarantees of the GSHM.
<figure><img src="image_2.png" /><figcaption>Fig. 1. Examples of different kinds of neighboring datasets for the Gaussian Sparse Histogram Mechanism where a single user can contribute to at most four counters, thus $||X_i||_0 \le 4$. These counters are depicted in green. a) For the example on the left, the mechanism behaves exactly as running the Gaussian mechanism on a restricted domain. b) In the case in the middle, we only have to bound the probability that one of the green elements together with the additive noise term exceeds the threshold $1 + \tau$. c) The case on the right is the most difficult case for the privacy analysis because the overall $\delta$ value depends on both kinds of changes.</figcaption></figure>

## 2.2 The add-the-deltas Approach

The following approach appeared in a technical report in the Google differential privacy library [Google Anonymization Team 2020]. Similar techniques have been used elsewhere in the literature (e.g. [Wilson et al. 2020]). We refer to this technique as add-the-deltas. We have to account for the privacy loss due to the magnitude of the Gaussian noise. Therefore, the value of $\delta_{gauss}$ is typically found by considering the worst-case effect of a user that only changes non-zero counters in both histograms. The value of $\delta_{gauss}$ follows from applying Lemma 2.5 (compare also Figure 1a)).

The event of infinite privacy loss is captured by $\delta_{inf}$. This is bounded by considering the worst-case scenario of changing $k$ zero-counters to 1 and the fact that infinite privacy loss occurs exactly when any of these $k$ counters exceed the threshold in the non-zero dataset (compare Figure 1b)).

The observation for the add-the-deltas approach is that $\delta_{gauss} + \delta_{inf}$ is a valid upper bound on the overall $\delta$ value, and hence the condition of Lemma 2.6 is sufficient to achieve differential privacy.

**Lemma 2.6** ([Google Anonymization Team 2020] add-the-deltas). If any pair of neighboring histograms differs in at most $k$ counters then the Gaussian Sparse Histogram Mechanism with parameters $\sigma$ and $\tau$ satisfies $(\varepsilon, \delta_{gauss} + \delta_{inf})$-differential privacy where

$$ \delta_{gauss} = \Phi\left(\frac{\sqrt{k}}{2\sigma} - \frac{\varepsilon\sigma}{\sqrt{k}}\right) - e^{\varepsilon}\Phi\left(-\frac{\sqrt{k}}{2\sigma} - \frac{\varepsilon\sigma}{\sqrt{k}}\right) \\ \delta_{inf} = 1 - \Phi\left(\frac{\tau}{\sigma}\right)^k . $$

## 2.3 Exact Analysis by Taking the Max over the Sensitivity Space

While the add-the-deltas approach is sufficient to bound $\delta$ it does not give the tightest possible parameters. Wilkins et al. [2024] were able to derive an exact value for $\delta$. Compared to the add-the-deltas approach above, the key insight is that the two worst-case scenarios cannot occur simultaneously for any pair of neighboring histograms. This means that each counter either contributes to $\delta_{gauss}$ or $\delta_{inf}$, but never to both. In the extreme cases, either all $k$ counters flip from zero to one, from one to zero, or none of them do between neighboring datasets. Thus, we only need to consider a single source of privacy loss. In the other (mixed) cases, we have to consider both sources of privacy loss, but the change is smaller than for the worst-case pair of datasets. A small example is depicted in Figure 1. Wilkins et al. [2024] used this fact to reduce the threshold required to satisfy the given privacy parameters using a tighter analysis. We now restate their main result: the exact privacy analysis of the GSHM.
**Lemma 2.7** ([Wilkins et al. 2024] Exact Privacy Analysis of the GSHM). If any pair of neighboring histograms differs in at most k counters then the Gaussian Sparse Histogram Mechanism with parameters $\sigma$ and $\tau$ satisfies $(\epsilon, \delta)$-differential privacy where $\gamma(j) = (k - j) \log \Phi(\frac{\tau}{\sigma})$ and

$$ \max \left[ 1 - \Phi\left(\frac{\tau}{\sigma}\right)^k, \max_{j \in [k]} \left(1 - \Phi\left(\frac{\tau}{\sigma}\right)^{k-j} + \Phi\left(\frac{\tau}{\sigma}\right)^{k-j}\right) \left[ \Phi\left(\frac{\sqrt{j}}{2\sigma} - \frac{(\epsilon - \gamma(j))\sigma}{\sqrt{j}}\right) - e^{\epsilon - \gamma(j)}\Phi\left(-\frac{\sqrt{j}}{2\sigma} - \frac{(\epsilon - \gamma(j))\sigma}{\sqrt{j}}\right) \right], \max_{j \in [k]} \left(\Phi\left(\frac{\sqrt{j}}{2\sigma} - \frac{(\epsilon + \gamma(j))\sigma}{\sqrt{j}}\right) - e^{\epsilon + \gamma(j)}\Phi\left(-\frac{\sqrt{j}}{2\sigma} - \frac{(\epsilon + \gamma(j))\sigma}{\sqrt{j}}\right)\right) \right] \le \delta. $$

Note that we use a slightly different convention from Wilkins et al. [2024]. We use a threshold of $1 + \tau$ rather than $\tau$. Furthermore, they also consider a more general mechanism that allows for optional aggregation queries and an additional threshold parameter. Although our work can easily be adapted to this setting as well, these extensions are not the focus of our main work to simplify presentation. A discussion of the extensions can be found in Section 6.

## 2.4 The Correlated Gaussian Mechanism

Our work builds on a recent result by Lebeda [2024] about using correlated noise to improve the utility of the Gaussian mechanism under the add-remove neighboring relationship. They show that when answering $d$ counting queries, adding a small amount of correlated noise to all queries can reduce the magnitude of Gaussian noise by almost half. We restate their main result for $(\epsilon, \delta)$-differential privacy with a short proof as they use another privacy notion definition.

**Lemma 2.8** ([Lebeda 2024] The Correlated Gaussian Mechanism). Let $H(X) := \sum_{i=1}^n X_i$ where $X_i \in \{0, 1\}^d$. Then the mechanism that outputs $H(X) + Z_{cor} I^d + Z$ satisfies $(\epsilon, \delta)$-DP. Here $I^d$ is the $d$-dimensional vector of all ones, $Z_{cor} \sim N(0, \sigma^2/\gamma)$, and $Z \sim N(0, \sigma^2 I_d)$ where

$$ \Phi\left(\frac{\sqrt{d+\gamma}}{4\sigma} - \frac{2\epsilon\sigma}{\sqrt{d+\gamma}}\right) - e^{\epsilon}\Phi\left(-\frac{\sqrt{d+\gamma}}{4\sigma} - \frac{2\epsilon\sigma}{\sqrt{d+\gamma}}\right) \le \delta. $$

*PROOF.* This follows from combining the inequality for the standard Gaussian mechanism (see Lemma 2.5) with [Lebeda 2024, Lemma 3.5]. Furthermore, if we set $\gamma = \sqrt{d}$ as in [Lebeda 2024, Theorem 3.1] we minimize the total magnitude of noise. Notice that the value of $\sigma$ scales with $\sqrt{d}$ for the standard Gaussian mechanism and it scales with $\frac{1}{2}\sqrt{d+\gamma} = \frac{1}{2}\sqrt{d+\sqrt{d}}$ here. We add two noise samples to each query, and the total error for each data point scales with $(\sqrt{d} + 1)/2$. $\square$

Concurrently with the result discussed above, Joseph and Yu [2024] considered the setting where user contributions are sparse such that $\|X_i\|_0 \le k$ for some $k \le d/2$. They give an algorithm that adds the optimal amount of correlated Gaussian noise for any $d$ and $k \le d/2$. It is natural to ask whether this algorithm can improve error for our setting since they focus on a sparse setting. However, their improvement factor over the standard Gaussian mechanism depends on the sparsity. Naively applying their technique for the setting of the GSHM where $k \ll d$ yields no practical improvements. We instead focus on adapting the technique from [Lebeda 2024].

## 3 Algorithmic Framework

We are now ready to introduce our main contribution, a variant of the Gaussian Sparse Histogram Mechanism using correlated noise. Throughout this section, we assume that all histograms are
k-sparse monotonic as defined below. Intuitively, we define monotonicity on a histogram in a way that captures the setting where the counts are either all increasing or all decreasing.

**Definition 3.1** (k-sparse monotonic histogram). We assume that the input histogram is k-sparse. That is, for any dataset X we have $||H(X)||_0 \le k$. Furthermore, the sensitivity space of H is $\{0, 1\}^d \cup \{0, -1\}^d$. That is, the difference between counters of neighboring histograms are either non-decreasing or non-increasing.

Observe that due to the monotonicity constraint, we either have that the supports $U$ and $U'$ for two neighboring histograms satisfies $U \subseteq U'$ or $U' \subseteq U$. We use this property in the privacy proofs later. The histograms are also monotonic in [Wilkins et al. 2024], but they do not require k-sparsity. We provide a mechanism for a setting where the histograms are not k-sparse in Section 4.

One example of k-sparse monotonic histograms is Misra-Gries sketches. Merging Misra-Gries sketches is common in practical applications. The sensitivity space of merged Misra-Gries sketches of size $k$ exactly matches Definition 3.1 (See Lebeda and Tetek [2023]). The exact procedure used to generate the histogram is not important for this section. Our algorithm is differentially private as long as the structure between histograms holds for all pairs of neighboring datasets.

Notice that Definition 3.1 implies that neighboring histograms differ in at most $k$ counters. As such, we can release the histogram using the standard Gaussian Sparse Histogram Mechanism. Wilkins et al. [2024] already uses the fact that counters are either non-decreasing or non-increasing in their analysis. We intend to further take advantage of the monotonicity by adding a small amount of correlated noise to all non-zero counters. This allows us to reduce the total magnitude of noise similar to [Lebeda 2024]. The reduced magnitude of noise in turn allows us to reduce the threshold required for privacy. The pseudocode for our mechanism is in Algorithm 2.

<caption>**Algorithm 2** Correlated Stability Histogram (CSH)</caption>

**Input:** Parameters $k$, $\sigma$ and $\tau$, histogram $H(X) \in \mathbb{N}^d$ where $||H(X)||_0 \le k$.
1: Let $\tilde{H} = \{0\}^d$.
2: Sample $Z_{corr} \sim N(0, \sigma^2/\sqrt{k})$.
3: **for** each $i \in [d]$ where $H(X)_i \ne 0$ **do**
4: &nbsp;&nbsp;&nbsp;&nbsp;Sample $Z_i \sim N(0, \sigma^2)$.
5: &nbsp;&nbsp;&nbsp;&nbsp;**if** $H(X)_i + Z_i + Z_{corr} > 1 + \tau$ **then**
6: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set $\tilde{H}_i = H(X)_i + Z_i + Z_{corr}$.
7: &nbsp;&nbsp;&nbsp;&nbsp;**end if**
8: &nbsp;&nbsp;&nbsp;&nbsp;**end for**
9: **Release** $\tilde{H}$.

Next, we prove the algorithm's privacy guarantees. We first give privacy guarantees in a (relatively) simple closed-form which is similar to the *add-the-deltas* approach. Later, we give tighter bounds using a more complicated analysis similar to Lemma 2.7. Unfortunately, we cannot reuse the proofs from previous work in either case because they rely on the fact that all noisy counters are independent. That is clearly not the case for our mechanism because the value of $Z_{cor}$ is added to all entries. Instead, we use different techniques to give similar results, starting with the *add-the-deltas* approach. The following lemma gives a general bound the event that one of $j$ correlated noisy terms exceeds a threshold $\tau$. We use this in the proof for both approaches later.
<figure><img src="image_3.png" /><figcaption>Fig. 2. The separation technique of the $\delta_{gauss}$ and $\delta_{inf}$ used in Theorems 3.3 and 3.5. The idea is to construct an intermediate histogram $H(\tilde{X})$ with the same support $U'$ as $H(X')$ but only reflect the changes that can cause infinite privacy loss between $H(X)$ and $H(X')$.</figcaption></figure>

**Lemma 3.2** (Upper bound for Correlated Noise). Let $Z_{corr} \sim N(0, \sigma^2/\sqrt{k})$ be a single sample for a real $k > 0$ and together with $j$ additional samples $Z_1, \dots, Z_j \sim N(0, \sigma^2)$. Then for any $\tau > 0$, we have

$$ \mathrm{Pr}[\exists i \in [j] : Z_{corr} + Z_i > \tau] \le 1 - \Phi \left( \frac{\tau}{\sigma(k^{-1/4} + 1)} \right)^{j+1}. $$

**PROOF.** We first give a bound for $Z_{corr}$ and the $Z_i$'s independently, which is sufficient for us to bound the probability of this event. First, observe that the $k$ uncorrelated terms $Z_i \sim N(0, \sigma^2)$ are independent, and we are interested in bounding the maximum of them and hence:

$$ \mathrm{Pr} \left[ \max_{Z_1, \dots, Z_j} Z_i \le \frac{\tau}{1 + k^{-1/4}} \right] = \mathrm{Pr} \left[ N(0, \sigma^2) \le \frac{\tau}{1 + k^{-1/4}} \right]^j = \Phi \left( \frac{\tau}{\sigma(1 + k^{-1/4})} \right)^j. $$

Similarly, we have for $Z_{corr} \sim N(0, \sigma^2/\sqrt{k})$ that

$$ \mathrm{Pr} \left[ Z_{corr} \le \frac{\tau k^{-1/4}}{1 + k^{-1/4}} \right] = \Phi \left( \frac{\tau k^{-1/4}}{\sigma (1 + k^{-1/4}) \cdot k^{-1/4}} \right) = \Phi \left( \frac{\tau}{\sigma (1 + k^{-1/4})} \right). $$

Notice that if both $Z_i \le \tau/(1 + k^{-1/4})$ and $Z_{corr} \le \tau k^{-1/4}/(1 + k^{-1/4})$ holds then $Z_{corr} + Z_i \le \tau$. As such, we can prove that the lemma holds since

$$ \mathrm{Pr}[Z_{corr} + \max_{Z_1, \dots, Z_j} Z_i > \tau] \le \mathrm{Pr} \left[ Z_{corr} > \frac{\tau k^{-1/4}}{1 + k^{-1/4}} \lor \max_{Z_1, \dots, Z_j} Z_i > \frac{\tau}{1 + k^{-1/4}} \right] \quad (1) $$

$$ = 1 - \mathrm{Pr} \left[ Z_{corr} \le \frac{\tau k^{-1/4}}{1 + k^{-1/4}} \right] \cdot \mathrm{Pr} \left[ \max_{Z_1, \dots, Z_j} Z_i \le \frac{\tau}{1 + k^{-1/4}} \right] \quad (2) $$

$$ = 1 - \Phi \left( \frac{\tau}{\sigma (1 + k^{-1/4})} \right)^{j+1} $$

where step (1) holds by a union bound and step (2) holds because the random variables $Z_{corr}$ and $\tilde{Z} = \max_{Z_1, \dots, Z_j} Z_i$ are independent. □
## 3.1 The add-the-deltas Analysis

The following Theorem 3.3 proves privacy guarantees of our mechanism using a similar technique than proposed by Google Anonymization Team [2020] and Wilson et al. [2020] which is known as add-the-deltas. The total value for $\delta$ is split between $\delta_{gauss}$ and $\delta_{inf}$ which accounts for the two types of privacy loss that are relevant to the mechanism. However, like with the GSHM, these values are found by considering worst-case pairs of neighboring histograms for each case. A pair of neighboring histograms cannot be worst-case for both values as seen in Figure 1.

**THEOREM 3.3 (ADD-THE-DELTAS TECHNIQUE).** Algorithm 2 satisfies $(\epsilon, \delta_{gauss} + \delta_{inf})$-differential privacy for $k$-sparse monotonic histograms where

$$ \delta_{gauss} = \Phi \left( \frac{\sqrt{k} + \sqrt{k}}{4\sigma} - \frac{2\epsilon\sigma}{\sqrt{k} + \sqrt{k}} \right) - e^{\epsilon}\Phi \left( -\frac{\sqrt{k} + \sqrt{k}}{4\sigma} - \frac{2\epsilon\sigma}{\sqrt{k} + \sqrt{k}} \right) \\ \delta_{inf} = 1 - \Phi \left( \frac{\tau}{\sigma(1 + k^{-1/4})} \right)^{k+1}. $$

**PROOF.** By Definition 2.2, the lemma holds if for any pair of $k$-sparse monotonic histograms $H(X)$ and $H(X')$ and all sets of outputs $Y$ we have

$$ \Pr[CSH(H(X)) \in Y] \le e^{\epsilon} \Pr[CSH(H(X')) \in Y] + \delta_{gauss} + \delta_{inf}. $$

We prove that the inequality above holds by introducing a third histogram. This new histogram is constructed to be between $H(X)$ and $H(X')$. We first state the desired properties of this histogram and then show that such a histogram must exist for all neighboring histograms.

Assume for now that there exists a histogram $H(\hat{X}) \in \mathbb{N}^d$ where the following two inequalities hold for any set of outputs $Y$:

$$ \Pr[CSH(H(\hat{X})) \in Y] \le e^{\epsilon} \Pr[CSH(H(X')) \in Y] + \delta_{gauss}, \quad (3) $$

$$ \Pr[CSH(H(X)) \in Y] \le \Pr[CSH(H(\hat{X})) \in Y] + \delta_{inf}. \quad (4) $$

Then the inequality we need for the lemma follows immediately since

$$ \Pr[CSH(H(X)) \in Y] \le \Pr[CSH(H(\hat{X})) \in Y] + \delta_{inf} \\ \le e^{\epsilon} \Pr[CSH(H(X')) \in Y] + \delta_{gauss} + \delta_{inf}. $$

Next, we show how to construct $H(\hat{X})$ from $H(X)$ and $H(X')$, and finally we show that each of two inequalities holds using this construction. Let $U = \{i \in [d] : H(X)_i \neq 0\}$ denote the support of $H(X)$ and define similarly $U'$ and $\hat{U}$. We construct $H(\hat{X})$ such that it has the same support as $H(X')$, that is $U' = \hat{U}$. For all $i \in (U \cap U')$ we set $H(\hat{X})_i = H(X)_i$ and for all $i \notin (U \cap U')$ we set $H(\hat{X})_i = H(X')_i$. In other words, we construct $H(\hat{X})$ such that (1) $H(X')$ and $H(\hat{X})$ only differ in entries that are in both $U$ and $U'$ (2) $H(X)$ and $H(\hat{X})$ only differ in entries that are in only one of $U$ and $U'$. This allows us to analyze each case separately to derive our values for $\delta_{gauss}$ and $\delta_{inf}$. An example of this construction is shown in Figure 2.

We start with the case of $\delta_{gauss}$ using $H(X')$ and $H(\hat{X})$. Let $CSH'$ denote a new mechanism equivalent to Algorithm 2 except that the condition on line 5 is removed. Notice that with $H(X')$ or $H(\hat{X})$ as inputs $CSH'$ is equivalent to the Correlated Gaussian Mechanism restricted to $U'$. Since $|U'| \le k$ we have by Lemma 2.8 that

$$ \Pr[CSH'(H(\hat{X})) \in Y] \le e^{\epsilon} \Pr[CSH'(H(X')) \in Y] + \delta_{gauss}. $$
Notice that if we post-process the output of CSH' by removing entries below $1 + \tau$, then the output distribution is equivalent to CSH. Equation (3) therefore holds because post-processing does not affect differential privacy guarantees (see Definition 2.2).

The histograms $H(X)$ and $H(\hat{X})$ only differ in entries that all has a count of 1 in one of the histograms while they all have a count of 0 in the other. $\delta_{inf}$ accounts for the event where any such counter exceeds the threshold because the distributions are identical for the shared support. The probability of this event is increasing in the number of different elements between $H(X)$ and $H(\hat{X})$ and therefore, the worst case happens for neighboring datasets such that $H(X) = 1^k$ and $H(\hat{X}) = 0^k$. Note that this bound also hold when zero counters in $H(X)$ are non-zero in $H(\hat{X})$. We focus on one direction because the proof is almost identical for the symmetric case. We bound the probability of outputting any entries from $H(X)$, that is $\tilde{H}_i := 1 + Z_{corr} + Z_i > 1 + \tau$ for at least one $i \in (U \setminus U')$. The bound for $\delta_{inf}$ follows from setting $j = k$ in Lemma 3.2. $\square$

In the Lemma 3.4 below, we show how to directly compute the required threshold based on the result in Theorem 3.3.

**Lemma 3.4 (Computing the threshold $\tau$).** For a fixed privacy budget $\epsilon$, $\delta$ and parameters $k$ and $\sigma$, the add-the-deltas technique requires $\tau \ge \Phi^{-1}(\sqrt[k+1]{1 - \delta - \delta_{gauss}}) \cdot (1 + k^{-1/4}) \sigma$ where $\Phi^{-1}$ is the inverse CDF of the normal distribution and $\delta_{gauss}$ is defined as in Theorem 3.3.

**PROOF.** Observe $\delta - \delta_{gauss} \ge \delta_{inf} = 1 - \Phi(\frac{\tau}{\sigma(1+k^{-1/4})})^{k+1}$ and hence $\frac{\tau}{\sigma(1+k^{-1/4})} \ge \Phi^{-1}(\sqrt[k+1]{1 - \delta - \delta_{gauss}})$ Multiplying by $\sigma(1+k^{-1/4})$ gives the desired result. $\square$

## 3.2 Tighter Analysis

Next, we carry out a more careful analysis that considers all elements from the sensitivity space similar to Wilkins et al. [2024]. As discussed above, we cannot directly translate the analysis by Wilkins et al. because they rely on independence between each entry. The proof of Theorem 3.5 is in Appendix B. Here we give a short intuition behind the theorem.

**THEOREM 3.5 (TIGHTER ANALYSIS).** Let $\gamma(j) = \min(\sqrt{j}, \frac{1}{2}\sqrt{j+\sqrt{k}})$, $\psi(m) = \Phi(\frac{\tau}{(1+k^{-1/4})\sigma})^{m+1}$, and $\hat{\epsilon}(j) = \epsilon + \ln(\psi(k-j))$. Then Algorithm 2 with parameters $k$, $\sigma$, and $\tau$ satisfies $(\epsilon, \delta)$-differential privacy for $k$-sparse monotonic histograms, where

$$ \max \left[ 1 - \psi(k), \Phi\left(\frac{\sqrt{k+\sqrt{k}}}{4\sigma} - \frac{2\epsilon\sigma}{\sqrt{k+\sqrt{k}}}\right) - e^{\epsilon}\Phi\left(-\frac{\sqrt{k+\sqrt{k}}}{4\sigma} - \frac{2\epsilon\sigma}{\sqrt{k+\sqrt{k}}}\right), \right. \\ \max_{j \in [k-1]} \left. 1 - \psi(k-j) + \Phi\left(\frac{\gamma(j)}{2\sigma} - \frac{\epsilon\sigma}{\gamma(j)}\right) - e^{\epsilon}\Phi\left(-\frac{\gamma(j)}{2\sigma} - \frac{\epsilon\sigma}{\gamma(j)}\right), \right. \\ \left. \max_{j \in [k-1]} \Phi\left(\frac{\gamma(j)}{2\sigma} - \frac{\hat{\epsilon}(j)\sigma}{\gamma(j)}\right) - e^{\hat{\epsilon}(j)}\Phi\left(-\frac{\gamma(j)}{2\sigma} - \frac{\hat{\epsilon}(j)\sigma}{\gamma(j)}\right) \right] \le \delta. $$

The result relies on a case by case analysis where each term in the maximum corresponds to a specific difference between neighboring histograms. The first two terms covers cases when we only have to consider either the infinite privacy loss event or the Gaussian noise, respectively. The remaining terms cover the differences when we have to account for both Gaussian noise and the threshold similar to case c) in Figure 1. The first of the internal maximum covers the cases where $U \supset U'$ and $|U'| \le j$, while the second covers the cases where $U \subset U'$ and $|U| \le j$. For each case in our analysis, we split up the impact from Gaussian noise and the threshold. Together, these cases cover all elements in the sensitivity space for $k$-sparse monotonic histograms.
## 4 Top-k Counting Queries

The privacy guarantees of Algorithm 2 are conditioned on the histogram being k-sparse for all datasets. Here we present a technique when we do not have this guarantee. Specifically, we consider the setting when the input is a dataset $\mathbf{X} = (X_1, \dots, X_n)$ where $X_i \in \{0, 1\}^d$. We want to release a private estimate of $H(\mathbf{X}) = \sum_{i=1}^n X_i$, and $X_i$ can have any number of non-zero entries. We use superscript to denote the elements of the histogram in descending order with ties broken arbitrarily such that $H(\mathbf{X})^{(1)} \ge H(\mathbf{X})^{(2)} \ge \dots \ge H(\mathbf{X})^{(d-1)} \ge H(\mathbf{X})^{(d)}$. This setting is studied in a line of work for Private top-k selection: [Bafna and Ullman 2017; Durfee and Rogers 2019; McSherry and Talwar 2007; Qiao et al. 2021; Rosén 1997; Wu and Zhang 2024].

Our algorithm in this setting relies on a simple pre-processing step. We first find the value of the $(k+1)$'th largest entry in the histogram. We then subtract that value from all entries in the histogram and remove negative counts. This gives us a new histogram which we use as input for Algorithm 2. We show that this histogram is both k-sparse and monotonic which implies that the mechanism has the same privacy guarantees as Algorithm 2.

<caption>**Algorithm 3** Top-k Mechanism using Correlated Gaussian Noise</caption>

**Input:** Parameters $k, \sigma$, and $\tau$, dataset $\mathbf{X} = (X_1, \dots, X_n)$ where $X_i \in \{0, 1\}^d$.
1: Let $H(\mathbf{X}) = \sum_{i=1}^n X_i$.
2: Let $\tilde{H}(\mathbf{X}) = \{0\}^d$.
3: **for** each $i \in [d]$ **do**
4: &nbsp;&nbsp;&nbsp;&nbsp;Set $\tilde{H}(\mathbf{X})_i = \max(0, H(\mathbf{X})_i - H(\mathbf{X})^{(k+1)})$.
5: &nbsp;&nbsp;&nbsp;&nbsp;**end for**
6: **Release** CSH($k, \sigma, \tau, \tilde{H}(\mathbf{X})$).

**Lemma 4.1.** The function $\tilde{H}: \mathcal{U}^N \to \mathbb{N}^d$ in Algorithm 3 produces k-sparse monotonic histograms.

**PROOF.** By Definition 3.1 we have to show two properties of $\tilde{H}$. It must hold for any $\mathbf{X}$ that $\|\tilde{H}(\mathbf{X})\|_0 \le k$ and for any pair $\mathbf{X} \sim \mathbf{X}'$ we have $\tilde{H}(\mathbf{X}) - \tilde{H}(\mathbf{X}') \in \{0, 1\}^d$ or $\tilde{H}(\mathbf{X}) - \tilde{H}(\mathbf{X}') \in \{0, -1\}^d$.

The sparsity claim is easy to see. Any counter that is not strictly larger than $H(\mathbf{X})^{k+1}$ is removed in line 4. By definition of $H(\mathbf{X}')^{k+1}$, there are at most $k$ such entries.

To prove the monotonicity property, we must show that counters in $\tilde{H}$ either all increase or all decrease by at most one. We only give the proof for the case where $\mathbf{X}$ is constructed by adding one data point to $\mathbf{X}'$. The proof is symmetric for the case where $\mathbf{X}$ is created by removing one data point from $\mathbf{X}'$.

We first partition $H(\mathbf{X}')$ into three sets: Let $U = \{i \in [d] \mid H(\mathbf{X}')_i > H(\mathbf{X}')^{(k+1)}\}$, $M = \{i \in [d] \mid H(\mathbf{X}')_i = H(\mathbf{X}')^{(k+1)}\}$ and $L = [d] \setminus \{U, M\}$. Because we have $H(\mathbf{X})_i - H(\mathbf{X}')_i \in \{0, 1\}$ for all $i \in [d]$, also $H(\mathbf{X})^{(k+1)} - H(\mathbf{X}')^{(k+1)} \in \{0, 1\}$. Note that the $(k+1)$'th largest entry might not represent the same element, but we only care about the value.

Consider the case where $H(\mathbf{X})^{(k+1)} = H(\mathbf{X}')^{(k+1)}$. We see that for all $l \in L$: $\tilde{H}(\mathbf{X})_l = \tilde{H}(\mathbf{X}')_l = 0$, and for all $u \in U$ we have $\tilde{H}(\mathbf{X})_u - \tilde{H}(\mathbf{X})_u = H(\mathbf{X})_u - H(\mathbf{X})^{(k+1)} - H(\mathbf{X})_u + H(\mathbf{X}')^{(k+1)} \in \{0, 1\}$ because we subtract the same value and increment $H(\mathbf{X})_u$ by at most one. Some elements $m \in M$ might now be exactly one larger than $H(\mathbf{X}')^{(k+1)}$ in $H(\mathbf{X})$, but still $\tilde{H}(\mathbf{X})_m \in \{0, 1\}$ by definition. Thus we have that $\tilde{H}(\mathbf{X}) - \tilde{H}(\mathbf{X}') \in \{0, 1\}^d$.

Now, consider the case where $H(\mathbf{X})^{(k+1)} = H(\mathbf{X}')^{(k+1)} + 1$. No element $l \in L$ can become larger or equal to the new $(k+1)$'th largest element, so still $\tilde{H}(\mathbf{X})_l = \tilde{H}(\mathbf{X})_l = 0$. Elements in $u \in U$ get reduced by at most one for $H(\mathbf{X})$, because they either are increased together with the $H(\mathbf{X}')^{(k+1)}$ and
then $\tilde{H}(X)_u - \tilde{H}(X')_u = 0$, or they stay the same in which case $\tilde{H}(X)_u = \tilde{H}(X')_u - 1$. One can also see that for $m \in M$, $H(X)_m - H(X)^{(k+1)} \in \{0, -1\}$, depending on whether or not they increase together with $H(X)^{(k+1)}$. As such we have $\tilde{H}(X)_m = 0$ for all $m \in M$. Therefore, $\tilde{H}(X) - \tilde{H}(X') \in \{0, -1\}^d$. $\square$

Since Algorithm 3 simply returns the output of running Algorithm 2 with a $k$-sparse monotonic histogram it has the same privacy guarantees.

**Corollary 4.2.** *The privacy guarantees specified by Theorem 3.3 and Theorem 3.5 hold for Algorithm 3.*

Algorithm 3 introduces bias when subtracting $H(X)^{(k+1)}$ from each counter as a pre-processing step. If we have access to a private estimate of $H(X)^{(k+1)}$ we can add it to all counters of the output as post-processing. Since this estimate would be used for multiple counters, similar to $Z_{corr}$, we might want to use additional privacy budget to get a more accurate estimate. This can be included directly in the privacy analysis. If we e.g. release $\tilde{H}(X)^{(k+1)} = H(X)^{(k+1)} + N(0, \sigma^2/\sqrt{k})$ the privacy guarantees from Theorem 3.3 holds if we change $\sqrt{k} + \sqrt{\bar{k}}$ to $\sqrt{k} + 5\sqrt{\bar{k}}$ in $\delta_{gauss}$.

# 5 Experiments

To back up our theoretical claims, we compare the error of the *Correlated Stability Histogram* against both the *add-the-deltas* approach [Google Anonymization Team 2020] and the *exact* analysis [Wilkins et al. 2024] of the uncorrelated GSHM. We consider the error in both privacy analysis approaches for our mechanisms as well (Theorems 3.3 and 3.5).

We compare the parameters of the mechanisms when releasing $k$-sparse monotonic histograms. We ran the experiments shown in Figure 3 with the same privacy parameters as in Wilkins et al. [2024]<fnref n="1" />, which is $\varepsilon = 0.35$ and $\delta = 10^{-5}$. Following their approach, we plot the minimum $\tau$ such that each mechanism satisfies $(\varepsilon, \delta)$-DP for a given magnitude of noise. Note that our setting of $\|H(X)\|_0 \le k$ differs from [Wilkins et al. 2024], so the experiments are not directly comparable.

*Results.* The first plot shown in Figure 3a) resembles the same $k = 51914$ used in [Wilkins et al. 2024, Figure 1 (A)]. In this setting, one can lower the threshold by approximately 43%. Because our technique favors large $k$ (we have to scale the noise with $\frac{1}{2}\sqrt{k} + \sqrt{\bar{k}}$ instead of $\sqrt{k}$), we also include the case were $k = 10$ is small in Figure 3b). The plots show that we make some small improvements even in that case. Even in that case, our looser *add-the-deltas* analysis for the CSH beats Wilkins et al. [2024]. Note that the values of $\sigma$ in Algorithm 1 and Algorithm 2 are not directly comparable, because we add noise twice in Algorithm 2. For a fair comparison, we instead use the total magnitude of noise in the plots. For the CSH we plot the value of $(\sigma^2 + \sigma^2/\sqrt{k})^{1/2} = (1 + 1/\sqrt{k})^{1/2}\sigma$. The dotted lines indicated the minimum magnitude of total noise for which GSHM and CSH satisfy $(\varepsilon, \delta)$-DP.

# 6 Extensions

The setting in Wilkins et al. [2024] is slightly different from ours. We will discuss how to adapt our technique to their setting and consider two extensions of the GSHM we did not include in the pseudocode of Algorithm 1.

*Additional sparsity threshold.* The mechanism of Wilkins et al. [2024] employs a second threshold $\tau' < \tau$ that allows to filter out infrequent data in a pre-processing step: All counters below $\tau'$ are removed before adding noise. The high threshold $\tau$ is then used to remove noisy counters similar to both Algorithms 1 and 2. This generalized setup allows them to account for pre-processing steps that the privacy expert has no control over. Our setting corresponds to the case where $\tau' = 1$, and it is straightforward to incorporate this constraint into our mechanism: For a given $\tau'$, we

<footnote n="1">¹in turn based on the privacy guarantees of the Facebook URL dataset [Messing et al. 2020].</footnote>
<figure><img src="image_4.png" /><figcaption>(a) Same $\epsilon, \delta, k$ as in Wilkins et al. [2024]</figcaption></figure>

<figure><img src="image_5.png" /><figcaption>(b) Some improvement also for smaller $k$.</figcaption></figure>

**Fig. 3.** The results of our experiments. Using the same parameters as in [Wilkins et al. 2024], the graphs show the minimum $\tau$ required to get $(0.35, 10^{-5})$-DP guarantees for a noise level $\sigma$. The green line denotes the tight analysis of Wilkins et al. [2024], the red shows the add-the-deltas [Google Anonymization Team 2020] approach and the blue and orange lines are our results. The marked points denote the minimum $\tau$ for each technique. **a)** Uses the same parameters as in Wilkins. As high values of $k$ are preferable for our mechanism, we bring down the threshold from $\approx 13950$ to $\approx 7860$, lowering it by $\approx 43\%$: **b)** We get some small improvement even for small $k$ values. Note that since our mechanism adds two noise samples the plot shows the total magnitude of noise.

simply have to replace $\tau$ with the difference between the two thresholds in all theorems. In fact, this situation is very similar to our result in Section 4 where we remove all values below a lower threshold $\tau' = 1 + H(X)^{(k+1)}$ before adding noise.

Note that the lower threshold of Wilkins et al. [2024] is assumed to be data independent. If it is, one must take care not to violate privacy. The privacy guarantees hold if we can give guarantees about the structure of pre-processed neighboring datasets similar to Lemma 4.1.

*Aggregator functions.* Wilkins et al. [2024] consider a setting where we are given an aggregator function $\mathcal{A}$ which returns a vector when applied to any dataset $X$.

If any $j \in [d]$ in the privatized released histogram $\tilde{H}(X)_j$, exceeds the threshold, the aggregator function is applied to all data points where $X_{i,j} = 1$. The aggregated values are then privatized by adding Gaussian noise which shape and magnitude can be set independently of the magnitude of noise added to the count. The privatized aggregate is then released along with $\tilde{H}(X)_j$. This setup is motivated by group-by database operations where we first want to privately estimate the count of each group together with some aggregates modeled by $\mathcal{A}$.

We did not consider aggregate functions in our analysis and instead focused on the classical setting, where we only wanted to privately release a sparse histogram while ignoring zero counters. Wilkins et al. accounts for the impact of the aggregator functions in the equivalent of $\delta_{\text{gauss}}$ in [Wilkins et al. 2024, Theorem 5.4, Corollary 5.4.1].

In short, the effect of aggregators can be accounted for as an increase in the $\ell_2$ sensitivity using a transformation of the aggregate function. The same technique could be applied to our mechanism. This would give us a similar improvement as Lemma 3.4 over the standard GSHM. It's not as clear how the mechanisms compare under the tighter analyses.

The core idea behind the correlated noise can also be used to improve some aggregate queries. This can be used even in settings where we do not want to add correlated noise to the counts. The mechanism of Lebeda uses an estimate of the dataset size $\tilde{n}$ to reduce the independent noise added
to each query. They spent part of the privacy budget to estimate $\tilde{n}$. However, in our setting, we already have a private estimate for the dataset size for the aggregate query in $\tilde{H}(X)_j$.

If each query is a sum query where users have a value between 0 and some value $C \in \mathbb{R}$, we can reduce the magnitude of noise by a factor of 2 by adding $(\tilde{n} - n)C/2$ to each sum (It follows from [Lebeda 2024, Lemma 3.6]). We can use a similar trick if $\mathcal{A}$ computes a sum of values in some range $[L, U]$. The standard approach would be to add noise with magnitude scaled to $\max(|L|, |U|)$ (see e.g. [Wilson et al. 2020, Table 1]). Instead, we can recenter values around zero. As an example, $\mathcal{A}$ contains a sum query with values in [100, 200]. We subtract $(L+U)/2$ from each point so that we instead sum values in [-50, 50] and reduce the sensitivity from 200 to 50. As post-processing, we add $150 \cdot \tilde{H}(X)_j$ to the estimate of the new sum. The error then depends on $\tilde{H}(X)_j - H(X)_j$. As with the Correlated Gaussian Mechanism, we gain an advantage over estimating the sum directly if $\mathcal{A}$ contains multiple such sums because we can reuse the estimate $\tilde{H}(X)_j$ for each sum.

# 7 From Theory towards Practice: Discrete Gaussian Noise

All mechanisms discussed in this paper achieve privacy guarantees using continuous Gaussian noise which is a standard tool in the differential privacy literature. However, real numbers cannot be represented exactly on computers which makes the implementation challenging. We can instead use the Discrete Gaussian Mechanism due to Canonne, Kamath, and Steinke [2022]. In this chapter, we modify the technique by Lebeda [2024] to make the mechanism compatible with discrete Gaussian noise $N_Z(0, \sigma^2)$ and then provide privacy guarantees for the discrete analogue to Algorithm 2 using $\rho$-zCDP. We first list required definitions and the privacy guarantees of the Multivariate Discrete Gaussian:

**Definition 7.1 (Discrete Gaussian Distribution).** Let $\sigma \in \mathbb{R}$ with $\sigma > 0$. The discrete Gaussian distribution with mean 0 and scale $\sigma$ is denoted $N_Z(0, \sigma^2)$. It is a probability distribution supported on the integers and defined by $\forall x \in \mathbb{Z}: \Pr_{X \sim N_Z(0, \sigma^2)} [X = x] = \frac{e^{-x^2/(2\sigma^2)}}{\sum_{y \in \mathbb{Z}} e^{-y^2/(2\sigma^2)}}$

**Definition 7.2 ([Bun and Steinke 2016] Zero-Concentrated Differential Privacy).** Given $\rho > 0$, a randomized mechanism $\mathcal{M}: \mathcal{U}^N \to \mathcal{Y}$ satisfies $\rho$-zCDP, if for every pair of neighboring datasets $X \sim X'$ and all $\alpha > 1$ it holds that

$$D_{\alpha}(\mathcal{M}(X)||\mathcal{M}(X')) \le \rho\alpha,$$

where $D_{\alpha}(\mathcal{M}(X)||\mathcal{M}(X'))$ denotes the $\alpha$-Rényi divergence between the two distributions $\mathcal{M}(X)$ and $\mathcal{M}(X')$. Furthermore, Zero-Concentrated Differential Privacy is immune to post-processing.

**Lemma 7.3 ([Bun and Steinke 2016] zCDP implies approximate DP).** If a randomized mechanism $\mathcal{M}$ satisfies $\rho$-zCDP, then $\mathcal{M}$ is $(\epsilon, \delta)$-DP for any $\delta > 0$ and $\epsilon = \rho + 2\sqrt{\rho \log(1/\delta)}$.

**Lemma 7.4 ([Canonne et al. 2022, Theorem 2.13] Multivariate Discrete Gaussian is zCDP).** Let $\sigma_1, \dots, \sigma_d > 0$ and $\rho > 0$. Let $q: \mathcal{U}^N \to \mathbb{Z}^d$ satisfy $\sum_{i \in [d]} (q(\mathbf{X})_i - q(\mathbf{X}')_i)^2 / \sigma_i^2 \le 2\rho$ for all neighboring datasets $X \sim X'$. Define a randomized algorithm $\mathcal{M}: \mathcal{U}^N \to \mathbb{Z}^d$ by $\mathcal{M}(\mathbf{X}) = q(\mathbf{X}) + Z$ where $Z_i \sim N_Z(0, \sigma_i^2)$ independently for each $i \in [d]$. Then $\mathcal{M}$ satisfies $\rho$-zCDP.

Next, we present a discrete variant of the Correlated Gaussian Mechanism and prove that it satisfies zCDP. We can then convert the privacy guarantees to approximate differential privacy. We combine this with the add-the-deltas technique for a discrete variant of Algorithm 2. This approach does not give the tightest privacy parameters, but it is significantly simpler than a direct analysis of approximate differential privacy for multivariate discrete Gaussian noise (see [Canonne et al. 2022, Theorem 2.14]). The primary contribution in this section is a simple change that makes the
correlated Gaussian mechanism compatible with the discrete Gaussian. We leave providing tighter analysis of the privacy guarantees open for future work.

**Algorithm 4** The Discrete Correlated Gaussian Mechanism

Input: Parameters $k$ and $\sigma$, monotonic histogram $H(X) \in \mathbb{N}^k$.

1: Let $\tilde{H} = \{0\}^k$.

2: Sample $Z_{corr} \sim \mathcal{N}_{\mathbb{Z}}(0, 4\sigma^2/\sqrt{k})$.

3: **for** each $i \in [k]$ **do**

4: &nbsp;&nbsp;&nbsp;&nbsp;Sample $Z_i \sim \mathcal{N}_{\mathbb{Z}}(0, 4\sigma^2)$.

5: &nbsp;&nbsp;&nbsp;&nbsp;Set $\tilde{H}_i = H(X)_i + (Z_i + Z_{corr})/2$.

6: **end for**

7: Release $\tilde{H}$.

**Lemma 7.5.** *Algorithm 4 satisfies $\rho$-zCDP where $\rho = (k + \sqrt{k})/(8\sigma^2)$.*

*PROOF.* Fix any pair of neighboring histograms $H(X)$ and $H(X')$. We prove the lemma for the case where $H(X) - H(X') \in \{0, 1\}^k$. The proof is symmetric when $H(X) - H(X') \in \{0, -1\}^k$.

Construct a new pair of histograms $\hat{H}(X), \hat{H}(X') \in \mathbb{N}^{k+1}$ such that $\hat{H}(X)_i = 2 \cdot H(X)_i$ for all $i \in [k]$ and $\hat{H}(X)_{k+1} = 0$. We set $\hat{H}(X)_i = 2 \cdot \hat{H}(X')_i - 1$ for all $i \in [k]$ and finally $\hat{H}(X)_{k+1} = 1$.

We clearly have that $\hat{H}(X) \in \mathbb{Z}^{k+1}$ for all possible $H(X)$ as required by Lemma 7.4. Now, we set $\sigma_i^2 = 4\sigma^2$ for $i \in [k]$ and $\sigma_{k+1}^2 = 4\sigma^2/\sqrt{k}$. We constructed $\hat{H}(X)$ and $\hat{H}(X')$ such that they differ by 1 in all entries for any pair of neighboring histograms. We therefore have that

$$ \sum_{i \in [k+1]} (\hat{H}(X)_i - \hat{H}(X')_i)^2 / \sigma_i^2 = \sum_{i \in [k+1]} 1/\sigma_i^2 = k/(4\sigma^2) + \sqrt{k}/(4\sigma^2) = 2\rho. $$

By Lemma 7.4 we have that $D_\alpha(M(X)||M(X')) \le \rho\alpha$ for all $\alpha > 1$, where $M(X) = \hat{H}(X) + Z$ and $Z_i \sim \mathcal{N}(0, \sigma_i^2)$. The output of $M(X)$ can be post-processes such that $\hat{H}_i = (M(X)_i + M(X)_{k+1})/2$. Notice that such a post-processing gives us the same output distribution as Algorithm 4 for both $H(X)$ and $H(X')$. The algorithm therefore satisfies $\rho$-zCDP because the $\alpha$-Rényi divergence cannot increase from post-processing by Definition 7.2. $\square$

Note that the scaling step is crucial for the privacy proof. It would not be sufficient to simply replace $Z_i \sim \mathcal{N}(0, \sigma^2)$ with $Z_i \sim \mathcal{N}_{\mathbb{Z}}(0, 4\sigma^2)$. We need to sample noise in discrete steps of length 1/2 instead of length 1. Otherwise, the trick of centering the differences between the histograms using the $k+1$ entry as an offset does not work. If we prefer a mechanism that always outputs integers, we can simply post-process the output.

**Lemma 7.6.** Let $Z_{corr} \sim \mathcal{N}_{\mathbb{Z}}(0, 4\sigma^2/\sqrt{k})$ and $Z_1, \dots, Z_k \sim \mathcal{N}_{\mathbb{Z}}(0, 4\sigma^2)$. Then for any $\tau > 0$ we have that
$$ \Pr[\exists i \in [k] : Z_{corr} + Z_i > 2\tau] \le 1 - \Pr\left[\mathcal{N}_{\mathbb{Z}}(0, 4\sigma^2/\sqrt{k}) \le \frac{2\tau k^{-1/4}}{k^{-1/4} + 1}\right] \cdot \Pr\left[\mathcal{N}_{\mathbb{Z}}(0, 4\sigma^2) \le \frac{2\tau}{k^{-1/4} + 1}\right]^k. $$

*PROOF.* The proof follows the same structure as for Lemma 3.2. If $Z_{corr} \le 2\tau k^{-1/4}/(k^{-1/4} + 1)$ and $\max_{Z_1, \dots, Z_j} Z_i = \tilde{Z} \le 2\tau/(k^{-1/4} + 1)$ then the sums cannot be above $2\tau$. The only difference is that we have to split up the probabilities. In the discrete case the probabilities slightly change when we rescale. $\square$

Finally, we can use replace the Gaussian noise in Algorithm 2 with discrete Gaussian noise. Using the *add-the-deltas* approach and the lemmas above we get that.
**THEOREM 7.7.** For parameters $k$, $\sigma$, and $\tau$, consider the mechanism $\mathcal{M}: \mathbb{N}^d \to \mathbb{Q}^d$ that given a histogram $H(X)$: (1) runs Algorithm 4 with parameters $k$ and $\sigma$ restricted to the support of $H(X)$ (2) removes all noisy counts less than or equal to $1 + \tau$. Then $\mathcal{M}$ satisfies $(\epsilon, \delta_{gauss} + \delta_{inf})$-DP for $k$-sparse monotonic histograms, where $\delta_{gauss}$ is such that $(k + \sqrt{k})/(8\sigma^2)$-zCDP implies $(\epsilon, \delta_{gauss})$-DP and

$$ \delta_{inf} = 1 - \Pr \left[ \mathcal{N}_{\mathbb{Z}}(0, 4\sigma^2/\sqrt{k}) \le \frac{2\tau k^{-1/4}}{k^{-1/4} + 1} \right] \cdot \Pr \left[ \mathcal{N}_{\mathbb{Z}}(0, 4\sigma^2) \le \frac{2\tau}{k^{-1/4} + 1} \right]^k $$

**PROOF.** The proof relies on the construction of an intermediate histogram from the proof of Theorem 3.3. We have that

$$ \begin{aligned} \Pr[\mathcal{M}(H(X)) \in Y] &\le \Pr[\mathcal{M}(H(\hat{X})) \in Y] + \delta_{inf} \\ &\le e^{\epsilon} \Pr[\mathcal{M}(H(X')) \in Y] + \delta_{gauss} + \delta_{inf}, \end{aligned} $$

where the first inequality follows from Lemma 7.6 and the second inequality follows from Lemma 7.5. Both inequalities rely on the fact that the histograms are $k$-sparse. $\square$

# 8 Conclusion and Open Problems

We introduced the *Correlated Stability Histogram* for the setting of $k$-sparse monotonic histograms and provided privacy guarantees using the *add-the-deltas* approach and a more fine-grained case-by-case analysis. We show that our mechanism outperforms the state-of-the-art – the *Gaussian Sparse Histogram Mechanism* – and improves the utility by up to a factor of 2. In addition to various extensions, we enriched our theoretical contributions with a step towards practice by including a version that works with discrete Gaussian noise.

Unlike the previous work [Wilkins et al. 2024], our bound in Theorem 3.5 is not tight. It would be interesting to derive exact bounds for our mechanism as well. Finally, we point out that the uncorrelated GSHM is still preferred in some settings. The CSH requires an upper bound on $||H(X)||_0$, whereas GSHM requires a bound on $||X_i||_0$. If we have access to a bound $||X_i||_0 \le k$ but no sparsity bound, we can apply our technique from Section 4. This approach works well when the dataset is close to $k$-sparse, but if the dataset is large with many high counters the pre-processing step can introduce high error. Furthermore, if histograms are $k$-sparse, but we additionally know that $||X_i||_0 \le m$, for some $m < k$, our improvement factor changes. If $m \le k/4$, the GSHM has a lower error than the CSH. However, in that setting, it might still be possible to reduce the error using the technique of Joseph and Yu [2024]. We leave exploring this regime for future work.

# Acknowledgments

Retschmeier carried out this work at Basic Algorithms Research Copenhagen (BARC), which was supported by the VILLUM Foundation grant 54451. *Providentia*, a Data Science Distinguished Investigator grant from the Novo Nordisk Fonden, supported Retschmeier. The work of Lebeda is supported by grant ANR-20-CE23-0015 (Project PRIDE).

# References

* Martin Aumüller, Christian Janos Lebeda, and Rasmus Pagh. 2022. Representing Sparse Vectors with Differential Privacy, Low Error, Optimal Space, and Fast Access. *Journal of Privacy and Confidentiality* 12, 2 (Nov. 2022). https://doi.org/10.29012/jpc.809

* Mitali Bafna and Jonathan Ullman. 2017. The price of selection in differential privacy. In *Conference on Learning Theory*. PMLR, PMLR, 151–168.

* Victor Balcer and Salil Vadhan. 2019. Differential Privacy on Finite Computers. *Journal of Privacy and Confidentiality* 9, 2 (Sep. 2019). https://doi.org/10.29012/jpc.679

* Borja Balle and Yu-Xiang Wang. 2018. Improving the Gaussian Mechanism for Differential Privacy: Analytical Calibration and Optimal Denoising. In *ICML (Proceedings of Machine Learning Research, Vol. 80)*. PMLR, 403–412.
Mark Bun, Kobbi Nissim, and Uri Stemmer. 2016. Simultaneous Private Learning of Multiple Concepts. In *Proceedings of the 2016 ACM Conference on Innovations in Theoretical Computer Science*, Cambridge, MA, USA, January 14-16, 2016, Madhu Sudan (Ed.). ACM, 369–380. https://doi.org/10.1145/2840728.2840747

Mark Bun and Thomas Steinke. 2016. Concentrated differential privacy: Simplifications, extensions, and lower bounds. In *Theory of Cryptography Conference*. Springer, 635–658.

Clement Canonne, Gautam Kamath, and Thomas Steinke. 2022. The Discrete Gaussian for Differential Privacy. *Journal of Privacy and Confidentiality* 12, 1 (Jul. 2022). https://doi.org/10.29012/jpc.784

David Durfee and Ryan M Rogers. 2019. *Practical differentially private top-k selection with pay-what-you-get composition*. Vol. 32. Curran Associates Inc., Red Hook, NY, USA.

Cynthia Dwork, Krishnaram Kenthapadi, Frank McSherry, Ilya Mironov, and Moni Naor. 2006a. Our Data, Ourselves: Privacy Via Distributed Noise Generation. In *Advances in Cryptology - EUROCRYPT 2006, 25th Annual International Conference on the Theory and Applications of Cryptographic Techniques*, St. Petersburg, Russia, May 28 - June 1, 2006, *Proceedings (Lecture Notes in Computer Science, Vol. 4004)*. Springer, 486–503. https://doi.org/10.1007/11761679_29

Cynthia Dwork, Frank McSherry, Kobbi Nissim, and Adam Smith. 2006b. Calibrating noise to sensitivity in private data analysis. In *Theory of Cryptography: Third Theory of Cryptography Conference, TCC 2006*, New York, NY, USA, March 4-7, 2006. *Proceedings* 3. Springer, 265–284.

Cynthia Dwork and Aaron Roth. 2014. The Algorithmic Foundations of Differential Privacy. *Foundations and Trends in Theoretical Computer Science* 9, 3-4 (2014), 211–407. https://doi.org/10.1561/0400000042

Google Anonymization Team. 2020. Delta for thresholding. https://github.com/google/differential-privacy/blob/main/common_docs/Delta_For_Thresholding.pdf. [Online; accessed 8-December-2024].

Michaela Gotz, Ashwin Machanavajjhala, Guozhang Wang, Xiaokui Xiao, and Johannes Gehrke. 2012. Publishing Search Logs—A Comparative Study of Privacy Guarantees. *IEEE Transactions on Knowledge and Data Engineering* 24, 3 (2012), 520–532. https://doi.org/10.1109/TKDE.2011.26

Matthew Joseph and Alexander Yu. 2024. Some Constructions of Private, Efficient, and Optimal K-Norm and Elliptic Gaussian Noise. In *The Thirty Seventh Annual Conference on Learning Theory*, June 30 - July 3, 2023, Edmonton, Canada (*Proceedings of Machine Learning Research*, Vol. 247). PMLR, 2723–2766. https://proceedings.mlr.press/v247/joseph24a.html

Aleksandra Korolova, Krishnaram Kenthapadi, Nina Mishra, and Alexandros Ntoulas. 2009. Releasing search queries and clicks privately. In *WWW*. ACM, 171–180. https://doi.org/10.1145/1526709.1526733

Christian Janos Lebeda. 2024. Better Gaussian Mechanism using Correlated Noise. arXiv:2408.06853 [cs.CR] https://arxiv.org/abs/2408.06853

Christian Janos Lebeda and Jakub Tetek. 2023. Better Differentially Private Approximate Histograms and Heavy Hitters using the Misra-Gries Sketch. In *PODS*. ACM, 79–88.

Frank McSherry and Kunal Talwar. 2007. Mechanism design via differential privacy. In *48th Annual IEEE Symposium on Foundations of Computer Science (FOCS'07)*. IEEE, IEEE, 94–103.

Solomon Messing, Christina DeGregorio, Bennett Hillenbrand, Gary King, Saurav Mahanti, Zagreb Mukerjee, Chaya Nayak, Nate Persily, Bogdan State, and Arjun Wilkins. 2020. Facebook Privacy-Protected Full URLs Data Set. https://doi.org/10.7910/DVN/TDOAPG

J. Misra and David Gries. 1982. Finding repeated elements. *Science of Computer Programming* 2, 2 (1982), 143–152. https://doi.org/10.1016/0167-6423(82)90012-0

Gang Qiao, Weijie J. Su, and Li Zhang. 2021. Oneshot Differentially Private Top-k Selection. In *Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event (Proceedings of Machine Learning Research, Vol. 139)*, Marina Meila and Tong Zhang (Eds.). PMLR, 8672–8681.

Bengt Rosén. 1997. Asymptotic theory for order sampling. *Journal of Statistical Planning and Inference* 62, 2 (1997), 135–158. https://doi.org/10.1016/S0378-3758(96)00185-1

Arjun Wilkins, Daniel Kifer, Danfeng Zhang, and Brian Karrer. 2024. Exact Privacy Analysis of the Gaussian Sparse Histogram Mechanism. *Journal of Privacy and Confidentiality* 14, 1 (Feb. 2024). https://doi.org/10.29012/jpc.823

Royce J. Wilson, Celia Yuxin Zhang, William Lam, Damien Desfontaines, Daniel Simmons-Marengo, and Bryant Gipson. 2020. Differentially Private SQL with Bounded User Contribution. *Proc. Priv. Enhancing Technol. 2020*, 2 (2020), 230–250. https://doi.org/10.2478/POPETS-2020-0025

Hao Wu and Hanwen Zhang. 2024. Faster Differentially Private Top-k Selection: A Joint Exponential Mechanism with Pruning. In *Proceedings of the 37th International Conference on Neural Information Processing Systems*. NeurIPS, NeurIPS.
## A Table of Symbols and Abbreviations

The following Table 1 summarizes the symbols and abbreviations used throughout the paper.

<table><caption>**Table 1.** Symbols used throughout the paper</caption><thead><tr><th>Symbol</th><th>Description</th></tr></thead><tbody><tr><td>GSHM</td><td>Gaussian Sparse Histogram Mechanism</td></tr><tr><td>CSH</td><td>Correlated Stability Histogram</td></tr><tr><td>U</td><td>Any aggregate query</td></tr><tr><td>X, X', X' &isin; U<sup>N</sup></td><td>Datasets on universe U</td></tr><tr><td>X ~ X'</td><td>Neighboring datasets</td></tr><tr><td>H(X)</td><td>Histogram H(X) = &Sigma;<sub>i</sub> X<sub>i</sub></td></tr><tr><td>H(X)<sup>(i)</sup></td><td>i'th largest item in H(X)</td></tr><tr><td>||H||<sub>0</sub></td><td>l<sub>0</sub>-norm of vector H (number of non-zeroes)</td></tr><tr><td>U, U'</td><td>Support of H(X), H(X')</td></tr><tr><td>&epsilon;, &delta;</td><td>Privacy Parameters</td></tr><tr><td>&tau; &gt; 0</td><td>Threshold is 1 + &tau;</td></tr><tr><td>&delta;<sub>gauss</sub></td><td>&delta; from Gaussian noise</td></tr><tr><td>&delta;<sub>inf</sub>; &delta;<sub>inf</sub>'</td><td>Probability of infinite privacy loss, for j counts</td></tr><tr><td>N(0, &sigma;<sup>2</sup>)</td><td>0-centered normal distribution</td></tr><tr><td>N<sub>Z</sub>(0, &sigma;<sup>2</sup>)</td><td>0-centered discrete normal distribution [Canonne et al. 2022]</td></tr><tr><td>&Phi;(x); &Phi;<sup>-1</sup>(x)</td><td>CDF of the normal distribution; inverse CDF</td></tr></tbody></table>

## B Proof of Theorem 3.5 (Tighter Analysis)

We omitted the proof of Theorem 3.5 from the main part of the paper. Before providing the proof of theorem, we prove a useful lemma. We use this lemma in the proof of the theorem to bound the effect of the magnitude for the Gaussian noise on the value of $\delta$.

**Lemma B.1.** Let $H(X)$ and $H(X')$ be a pair of $j$-sparse monotonic histograms with the same support. Then for Algorithm 2 with parameters $k \ge j$, $\sigma$ and $\tau$, we have

$$ \Pr[CSH(H(X)) \in Y] \le e^{\epsilon} \Pr[CSH(H(X')) \in Y] + \delta $$

$$ \text{for any } \epsilon \ge 0 \text{ where } \gamma = \min\left(\frac{1}{2}\sqrt{j + \sqrt{k}}, \sqrt{j}\right) \text{ and} $$

$$ \delta \ge \Phi\left(\frac{\gamma}{2\sigma} - \frac{\epsilon\sigma}{\gamma}\right) - e^{\epsilon}\Phi\left(-\frac{\gamma}{2\sigma} - \frac{\epsilon\sigma}{\gamma}\right). $$

**PROOF.** We show that the statement holds for each case of the minimum for $\gamma$ separately. In each case, we show that the output distribution is equivalent to post-processing a Gaussian noise mechanism. We start with the case of $\gamma = \frac{1}{2}\sqrt{j + \sqrt{k}}$. Notice that by Lemma 2.8, the inequality holds if we apply the correlated Gaussian mechanism to histograms with at most $j$ entries and set the magnitude of $Z_{cor}$ to $\sigma/\sqrt{k}$. Notice that the output distributions of CSH for both $H(X)$ or $H(X')$ as input is equivalent to running the Correlated Gaussian Mechanism restricted to their support followed by a post-processing step of removing values below $1 + \tau$.

Similarly, for the case of $\gamma = \sqrt{j}$ notice that $||H(X) - H(X')||_2 \le \gamma$. Therefore, we can output an $(\epsilon, \delta)$-DP estimate of the histogram using the Standard Gaussian Mechanism with the parameters
chosen according to the lemma. Now, notice that if we apply the Standard Gaussian Mechanism to the histograms, we can recover the output distribution of CSH by post-processing. We first sample noise $Z_{cor} \sim N(0, \sigma/\sqrt{k})$ and add the value to all entries, and then removing all noise counts below $1 + \tau$ and any count not in the support of the histograms.

The lemma thus holds since differential privacy is preserved under post-processing. $\square$

**THEOREM 3.5 (TIGHTER ANALYSIS).** Let $\gamma(j) = \min(\sqrt{j}, \frac{1}{2}\sqrt{j+\sqrt{k}})$, $\psi(m) = \Phi(\frac{\tau}{(1+k^{-1/4})\sigma})^{m+1}$, and $\hat{\varepsilon}(j) = \varepsilon + \ln(\psi(k-j))$. Then Algorithm 2 with parameters $k, \sigma$, and $\tau$ satisfies $(\varepsilon, \delta)$-differential privacy for $k$-sparse monotonic histograms, where

$$ \max \left[ 1 - \psi(k), \Phi\left(\frac{\sqrt{k} + \sqrt{k}}{4\sigma} - \frac{2\varepsilon\sigma}{\sqrt{k} + \sqrt{k}}\right) - e^{\varepsilon}\Phi\left(-\frac{\sqrt{k} + \sqrt{k}}{4\sigma} - \frac{2\varepsilon\sigma}{\sqrt{k} + \sqrt{k}}\right), \right. \\ \max_{j \in [k-1]} \left. 1 - \psi(k-j) + \Phi\left(\frac{\gamma(j)}{2\sigma} - \frac{\varepsilon\sigma}{\gamma(j)}\right) - e^{\varepsilon}\Phi\left(-\frac{\gamma(j)}{2\sigma} - \frac{\varepsilon\sigma}{\gamma(j)}\right), \right. \\ \left. \max_{j \in [k-1]} \Phi\left(\frac{\gamma(j)}{2\sigma} - \frac{\hat{\varepsilon}(j)\sigma}{\gamma(j)}\right) - e^{\hat{\varepsilon}(j)}\Phi\left(-\frac{\gamma(j)}{2\sigma} - \frac{\hat{\varepsilon}(j)\sigma}{\gamma(j)}\right) \right] \le \delta. $$

**PROOF.** We prove the theorem by considering all values of the sensitivity space of $k$-sparse monotonic histograms. We start with the simplest cases. If either $U = \emptyset$ or $U' = \emptyset$ we only have to consider the infinite privacy loss event. This gives us the first term of the max by Lemma 3.2. Similarly, when $U = U'$, we get the second term of the max using the proof for $\delta_{gauss}$ in Theorem 3.3.

For the remaining cases, we have to consider both the impact of Gaussian noise and the potential for the infinite privacy loss event similar to Theorem 3.3. We analyze the two cases of $U \subset U'$ and $U' \subset U$ separately. Without loss of generality, we assume that $\max(|U|, |U'|) = k$, since this is the worst-case for the privacy parameters. Furthermore, we have to analyze the mechanism when $\min(|U|, |U'|) = j$ for each possible $j \in [k-1]$.

First, we consider the case where $U' \subset U$. We construct an intermediate histogram $H(\hat{\mathbf{X}})$ as in the proof of Theorem 3.3. The histogram $H(\hat{\mathbf{X}})$ has support $U'$, and $H(\hat{\mathbf{X}})_i = H(\mathbf{X})_i$ for all $i \in U'$. Since $H(\hat{\mathbf{X}})$ and $H(\mathbf{X})$ are a pair of $j$-sparse monotonic histograms we have by Lemma B.1 that

$$ \Pr[\mathrm{CSH}(H(\hat{\mathbf{X}})) \in Y] \le e^{\varepsilon} \Pr[\mathrm{CSH}(H(\mathbf{X}')) \in Y] + \delta_{\mathrm{gauss}}(j), $$

where

$$ \delta_{\text{gauss}}(j) = \Phi\left(\frac{\gamma(j)}{2\sigma} - \frac{\varepsilon\sigma}{\gamma(j)}\right) - e^{\varepsilon}\Phi\left(-\frac{\gamma(j)}{2\sigma} - \frac{\varepsilon\sigma}{\gamma(j)}\right). $$

The histograms $H(\hat{\mathbf{X}})$ and $H(\mathbf{X})$ only differs the entries $U \setminus U'$. Since $|U \setminus U'| = (k-j)$ we have that

$$ \Pr[\mathrm{CSH}(H(\mathbf{X})) \in Y] \le \Pr[\mathrm{CSH}(H(\hat{\mathbf{X}})) \in Y] + \delta_{\inf}(j), $$

where $\delta_{\inf}(j) = 1 - \psi(k-j)$ follows from Lemma 3.2.

We recover the third term in the max using the values for $\delta_{\inf}(j)$ and $\delta_{gauss}(j)$ and the fact that

$$ \Pr[\mathrm{CSH}(H(\mathbf{X})) \in Y] \le \Pr[\mathrm{CSH}(H(\hat{\mathbf{X}})) \in Y] + \delta_{\inf}(j) \\ \le e^{\varepsilon} \Pr[\mathrm{CSH}(H(\mathbf{X}')) \in Y] + \delta_{\mathrm{gauss}}(j) + \delta_{\inf}(j). $$

Finally, we consider the case where $U \subset U'$. This is the most technically involved case in the proof. Here, the intermediate histogram $H(\hat{\mathbf{X}})$ does not give us the bound we want because it is not $k$-sparse. Instead, we use an alternative representation of each histogram similar to the technique used in [Lebeda 2024]. We consider a mechanism for this representation and show that the bound holds when the alternative representations are used as input for this mechanism. We then show
that we can recover the distribution of Algorithm 2 using post-processing. We first give the proof when $\gamma = \frac{1}{2}\sqrt{j + \sqrt{k}}$ and then show that it also holds for $\gamma = \sqrt{j}$.

Assume without loss of generality that $U = [j]$ and $U' = [k]$ (we can always reorder the elements of the new representation, but this assumption makes the presentation simpler). We construct a vector $g \in \mathbb{R}^{k+1}$ from $H(X)$ such that $g_i = H(X)_i$ for each $i \in [j]$ and $g_i = 0$ for any $i > j$. For $g' \in \mathbb{R}^{k+1}$ we set $g'_i = H(X')_i - 1/2$ for all $i \in [k]$ and we set $g'_{k+1} = \frac{1}{2}k^{1/4}$.

Now, we consider two mechanisms with input $\mathbb{R}^{k+1}$. The first mechanism $\mathcal{G}$ ignore entries from index $j+1$ to $k$ and adds noise independently from $\mathcal{N}(0, \sigma^2)$ to all entries with index $i \in [j]$ as well as the $k+1$'th entry. We want to show that $\Pr[\mathcal{G}(g) \in Y] \le e^{\hat{\epsilon}(j)} \cdot \Pr[\mathcal{G}(g') \in Y] + \hat{\delta}(j)$ for all $Y$ where

$$ \hat{\delta}(j) = \Phi \left( \frac{\frac{1}{2}\sqrt{j + \sqrt{k}}}{2\sigma} - \frac{\hat{\epsilon}(j)\sigma}{\frac{1}{2}\sqrt{j + \sqrt{k}}} \right) - e^{\hat{\epsilon}(j)} \Phi \left( -\frac{\frac{1}{2}\sqrt{j + \sqrt{k}}}{2\sigma} - \frac{\hat{\epsilon}(j)\sigma}{\frac{1}{2}\sqrt{j + \sqrt{k}}} \right). $$

Notice that $\mathcal{G}$ is equivalent to the standard Gaussian mechanism restricted to the domain $[j] \cup \{k+1\}$. At the same time, the distribution of $\mathcal{G}(g')$ is equivalent to running $\mathcal{G}(\hat{g})$ for a third vector $\hat{g}$ where $\hat{g}_i = \hat{g}_i$ for $i \in ([j] \cup \{k+1\})$ and $\hat{g}_i = 0$ for $j < i \le k$. The inequality above therefore follows from Lemma 2.5 if the $\ell_2$ distance between $g$ and $\hat{g}$ is at most $\frac{1}{2}\sqrt{j + \sqrt{k}}$ for any neighboring histograms. The absolute difference between $g_i$ and $\hat{g}_i$ is $1/2$ for each $i \in [j]$, while $g_{k+1}$ and $\hat{g}_{k+1}$ differ by $k^{1/4}/2$. The $\ell_2$ distance between the vectors is therefore always $\|g - \hat{g}\|_2 = (\sum_{i \in [k+1]} (g_i - \hat{g}_i)^2)^{1/2} = ((k^{1/4}/2)^2 + \sum_{i \in [j]} (1/2)^2)^{1/2} = \frac{1}{2}\sqrt{j + \sqrt{k}}$.

Next, consider a mechanism $\mathcal{F}$ that adds noise independently from $\mathcal{N}(0, \sigma^2)$ to all non-zero entries of a vector. Let $\tilde{g}$ be the noisy vector after adding noise to a vector $g$. If $\{j+1, \dots, k\}$ is in support of $g$ we check if $\tilde{g}_{k+1}/k^{1/4} + \tilde{g}_i > \tau$ for any $i \in \{j+1, \dots, k\}$. In that case, we output $\perp$; otherwise, we set all such entries to 0 and output the noisy vector $\tilde{g}$. Here, we use the output $\perp$ to group all events corresponding to the infinite privacy loss in the original representation.

We want to show that $\Pr[\mathcal{F}(g) \in Y] \le e^{\hat{\epsilon}} \Pr[\mathcal{F}(g) \in Y] + \hat{\delta}(j)$ for all $Y$. It is sufficient to show that the inequality holds for the set $Y_\epsilon = \{y \mid e^{\hat{\epsilon}} \le \mathcal{F}(g)(y)/\mathcal{F}(g')(y)\}$, where $\mathcal{F}(g)(y)$ denotes the density at $y$ (see [Balle and Wang 2018, Theorem 5]). Now, if $\Pr[\mathcal{G}(g') \in Y_\epsilon] \le \Pr[\mathcal{F}(g') \in Y_\epsilon]/\psi(k-j)$ the inequality holds because $\mathcal{G}(g)$ and $\mathcal{F}(g)$ has the same distribution and

$$ \begin{aligned} \Pr[\mathcal{F}(g) \in Y_\epsilon] &= \Pr[\mathcal{G}(g) \in Y_\epsilon] \le e^{\hat{\epsilon}} \Pr[\mathcal{G}(g') \in Y_\epsilon] + \hat{\delta}(j) \\ &\le e^{\hat{\epsilon}+\ln(\psi(k-j))} (\Pr[\mathcal{F}(g') \in Y_\epsilon]/\psi(k-j)) + \hat{\delta}(j) \\ &= e^{\hat{\epsilon}} \Pr[\mathcal{F}(g') \in Y_\epsilon] + \hat{\delta}(j), \end{aligned} $$

where the last equality follows from $1/\psi(k-j) = e^{-\ln(\psi(k-j))}$.

The missing piece above is to show that $\Pr[\mathcal{G}(g') \in Y_\epsilon] \le \Pr[\mathcal{F}(g') \in Y_\epsilon]/\psi(k-j)$. The equivalent inequality is easy to see in the non-correlated variant of the Gaussian Sparse Histogram Mechanism because $Y_\epsilon$ does not contain $\perp$ so $\Pr[\mathcal{F}'(g') \in Y_\epsilon] = \Pr[\mathcal{G}'(g') \in Y_\epsilon] \Pr[\perp]$, where $\perp$ is the complement of $\perp$, and $\mathcal{F}'$ and $\mathcal{G}'$ are the equivalents to $\mathcal{F}$ and $\mathcal{G}$ without the $(k+1)$'th entry. The value of $\psi(k-j)$ is a lower bound on the probability of $\perp$ occurring. Here we need to be a bit more careful here, but the inequality still holds because $\perp$ occurring increases the probability that $\tilde{g}'_{k+1}$ is small, which leads to a higher privacy loss event. We sketch the argument below

$$ \begin{aligned} \Pr[\mathcal{F}(g') \in Y_\epsilon]/\psi(k-j) &= \Pr[\mathcal{F}(g') \in Y_\epsilon \mid \perp] \Pr[\perp]/\psi(k-j) \\ &\ge \Pr[\mathcal{F}(g') \in Y_\epsilon \mid \perp] \ge \Pr[\mathcal{G}(g') \in Y_\epsilon], \end{aligned} $$
where the last inequality relies on $\Pr[\mathcal{F}(g') \in Y_\epsilon | \tilde{g}'_{k+1} \le \beta \cap \tau] = \Pr[\mathcal{G}(g') \in Y_\epsilon | \tilde{g}'_{k+1} \le \beta]$ for any $\beta \in \mathbb{R}$, and $\Pr[\mathcal{G}(g') \in Y_\epsilon | \tilde{g}'_{k+1} \le \beta] \ge \Pr[\mathcal{G}(g') \in Y_\epsilon]$. For any $\beta$ we also have that $\Pr[\tau | \mathcal{F}(g') \le \beta] \ge \Pr[\tau] $ which allows us to apply Bayes' theorem to find that $\Pr[\mathcal{F}(g')_{k+1} \le \beta | \tau] \ge \Pr[\mathcal{G}(g')_{k+1} \le \beta]$. Integrating over all values of $\beta$ gives the inequality.

Finally, we must show that Algorithm 2 is equivalent to post-processing $\mathcal{F}$. Let $\tilde{g}$ denote the output of $\mathcal{F}(g)$. Then we post-process the entries by first setting $\tilde{H}_i = \tilde{g}_i + \tilde{g}_i/k^{1/4}$ and then removing all values of $\tilde{H}_i$ below $1 + \tau$. If the output was $\perp$ we repeatable sample $\tilde{H} \sim \text{CSH}(H(X'))$ until $\tilde{H}_i \ne i$ for at least one $j < i \le k$. We then output the histogram $\tilde{H}$.

The proof is similar when $\gamma = \sqrt{j}$, but we use a different construction for $g'$. We set $g'_i = H(X')_i$ for all $i \in [k]$ and $g'_{k+1} = 0$. The inequality $\Pr[\mathcal{G}(g) \in Y] \le e^{\hat{\epsilon}(j)} \cdot \Pr[\mathcal{G}(g') \in Y] + \hat{\delta}(j)$ holds where $\frac{1}{2}\sqrt{j + \sqrt{k}}$ is replaced with $\sqrt{j}$ in $\hat{\delta}(j)$ because $\|g - \hat{g}\|_2 = (\sum_{i \in [j]} (g_i - \hat{g}_i)^2)^{1/2} \le (\sum_{i \in [j]} 1)^{1/2} = \sqrt{j}$.

Since all possible elements in the sensitivity space falls in one of the categories above, we can compute the value of all inequalities above. The maximum of all parameters gives us an upper bound for $\delta$. $\square$