A Joint Exponential Mechanism For Differentially Private Top-k

Jennifer Gillenwater, Matthew Joseph, Andrés Muñoz Medina, Mónica Ribero

Abstract

We present a differentially private algorithm for releasing the sequence of $k$ elements with the highest counts from a data domain of $d$ elements. The algorithm is a "joint" instance of the exponential mechanism, and its output space consists of all $O(d^k)$ length-$k$ sequences. Our main contribution is a method to sample this exponential mechanism in time $O(dk\log(k) + d\log(d))$ and space $O(dk)$. Experiments show that this approach outperforms existing pure differential privacy methods and improves upon even approximate differential privacy methods for moderate $k$.

Introduction

Identifying the top $k$ most frequent items in a dataset—such as the most popular movies, common search queries, or best-selling products—is a fundamental task in data analysis. However, performing this task while guaranteeing Differential Privacy (DP) is challenging. The standard approach, known as the "peeling" mechanism, involves iteratively finding the top item, removing it, and repeating the process $k$ times.

The primary drawback of peeling is the requirement to split the privacy budget $\epsilon$ across $k$ steps (composition). As $k$ increases, the noise added to each step grows, which significantly degrades the accuracy of the final sequence. This paper introduces a "joint" exponential mechanism that selects the entire sequence of $k$ items simultaneously, bypassing the need for budget composition and offering superior accuracy.

The Joint Selection Problem

An alternative to iterative selection is to use the exponential mechanism over the space of all possible length-$k$ sequences. By scoring and selecting the sequence as a single unit, the mechanism avoids the privacy budget splitting inherent in peeling.

However, for a dataset with $d$ unique items, there are $O(d^k)$ possible sequences. For real-world datasets where $d$ can be in the hundreds of thousands, calculating probabilities for an exponentially large output space is computationally intractable. The authors bridge this gap by developing an efficient sampling algorithm that makes joint selection practical.

Methodology

The authors propose Joint, an instance of the exponential mechanism that scores sequences based on their proximity to the true top-$k$ counts.

The Utility Function

The mechanism uses a specific scoring function: $u^*(D, S) = -\max_{i \in [k]} (c_i - c_{s_i})$. In this formulation, a sequence's penalty is determined by its "worst" item—specifically, the item whose count falls furthest below the true $i$-th highest count in the dataset.

Efficient Sampling Algorithm

The core innovation is the observation that while there are $O(d^k)$ sequences, there are only $dk$ unique possible utility scores. The score is always the difference between one of the top $k$ true counts and one of the $d$ available item counts. The algorithm proceeds as follows:

  1. Grouping: Sequences are grouped by their utility scores.
  2. Counting: The algorithm counts how many valid sequences share each score using a dynamic programming approach.
  3. Sampling Score: A utility score is sampled based on its total probability mass.
  4. Sampling Sequence: A sequence is sampled uniformly from the group corresponding to the chosen score.

This approach reduces the time complexity to $O(dk \log(k) + d \log(d))$ and requires only $O(dk)$ space, making it feasible for large-scale datasets.

Empirical Evaluation

The authors evaluated the Joint mechanism on six real-world datasets representing long-tail distributions, including Goodreads review counts (Books), Amazon grocery reviews (Foods), and MovieLens ratings (Movies).

Key Results

  • Pure DP Dominance: The Joint mechanism consistently outperforms the best pure DP baseline (Permute-and-Flip Peeling) across all tested datasets and error metrics, including $L_\infty$, $L_1$, and $k$-relative error.
  • Competitive with Approximate DP: Remarkably, Joint often outperforms approximate DP baselines (like CDP-Peel) for moderate values of $k$ (up to $k \approx 100$). This is significant because approximate DP usually enjoys a substantial theoretical advantage over pure DP.
  • Scalability: The algorithm is highly practical. On the largest dataset (Foods, $d \approx 166,000$), extracting the top 200 items takes approximately one minute on standard hardware.

Insights and Limitations

The Joint mechanism's performance is heavily influenced by the "gaps" between item counts. It excels on datasets with clear separations between top items (e.g., Movies or Books), whereas peeling methods suffer as $k$ increases regardless of the underlying distribution.

However, the algorithm assumes a specific user contribution model where users can contribute to all item counts (up to 1 per item). In scenarios where users are restricted to a single item total (e.g., a single vote), simpler Laplace noise methods may still be preferable. Additionally, while a "Permute-and-Flip" version of the joint mechanism could theoretically improve utility, it currently faces numerical instability issues at high $k$, leaving an open challenge for future engineering.

Summary updated

Abstract

We present a differentially private algorithm for releasing the sequence of $k$ elements with the highest counts from a data domain of $d$ elements. The algorithm is a "joint" instance of the exponential mechanism, and its output space consists of all $O(d^k)$ length-$k$ sequences. Our main contribution is a method to sample this exponential mechanism in time $O(dk\log(k) + d\log(d))$ and space $O(dk)$. Experiments show that this approach outperforms existing pure differential privacy methods and improves upon even approximate differential privacy methods for moderate $k$.
BibTeX
@inproceedings{gillenwater2022joint,
  author = {Jennifer Gillenwater and Matthew Joseph and Andrés Muñoz Medina and Mónica Ribero},
  title = {{A Joint Exponential Mechanism For Differentially Private Top-k}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=m1qornzuXB},
}
Figure