Bounded Space Differentially Private Quantiles

Daniel Alabi, Omri Ben-Eliezer, Anamay Chaturvedi

Abstract: Estimating the quantiles of a large dataset is a fundamental problem in both the streaming algorithms literature and the differential privacy literature. However, all existing private mechanisms for distribution-independent quantile computation require space at least linear in the input size $n$. In this work, we devise a differentially private algorithm for the quantile estimation problem, with strongly sublinear space complexity, in the one-shot and continual observation settings. Our basic mechanism estimates any $\alpha$-approximate quantile of a length-$n$ stream over a data universe $\mathcal{X}$ with probability $1-\beta$ using $O\left( \frac{\log (|\mathcal{X}|/\beta) \log (\alpha \epsilon n)}{\alpha \epsilon} \right)$ space while satisfying $\epsilon$-differential privacy at a single time point. Our approach builds upon deterministic streaming algorithms for non-private quantile estimation instantiating the exponential mechanism using a utility function defined on sketch items, while (privately) sampling from intervals defined by the sketch. We also present another algorithm based on histograms that is especially well-suited to the multiple quantiles case. We implement our algorithms and experimentally evaluate them on synthetic and real-world datasets.

1. Introduction

Quantile estimation—identifying values that partition a sorted dataset into specific fractions—is a foundational task in data science, used for calculating medians, percentiles, and identifying outliers. However, performing this task at scale introduces two major challenges:

  1. Streaming Scale: Massive datasets often arrive as continuous streams. Storing the entire dataset to find a quantile requires $O(n)$ space, which is impractical for large or infinite streams. Non-private "sketches," such as the Greenwald-Khanna (GK) sketch, address this by using sublinear space.
  2. Privacy: Individual data points in a stream, such as medical records or GPS coordinates, are often sensitive. Differential Privacy (DP) provides a rigorous mathematical guarantee that an individual's presence in the dataset will not be leaked.

Until now, a gap existed: existing DP quantile mechanisms required $O(n)$ space, while sublinear-space sketches were not private. This work bridges that gap, providing the first DP algorithms for quantile estimation with strongly sublinear space complexity.

2. Methodology

The authors propose two primary algorithms that integrate streaming sketches with DP mechanisms.

2.1 DPExpGK: The Exponential Mechanism on Sketches

The flagship algorithm, DPExpGK, adapts the Exponential Mechanism—a standard DP tool that selects an output based on a "utility score"—to work with the Greenwald-Khanna (GK) sketch.

The primary challenge is that the Exponential Mechanism typically requires evaluating every item in the data universe $\mathcal{X}$, which is memory-intensive. The authors solve this by defining a utility function based on the rank intervals provided by the GK sketch. By partitioning the data universe into intervals where the utility is constant, they can use the Gumbel-max trick to efficiently sample an answer. This turns a potentially infinite search space into a small, discrete one.

Figure 1: Illustration of a data set $S'$ mapped to a totally ordered domain $\mathcal{X}$, showing the discrete elements and intervals used for private sampling.

2.2 DPHistGK and Continual Observation

The authors also introduce DPHistGK, a histogram-based approach that applies the Laplace mechanism to a histogram built from the GK sketch. While it lacks the universal theoretical bounds of DPExpGK, it performs exceptionally well on specific distributions, such as Normal distributions.

To handle streams where estimates must be updated as new data arrives, the authors extend their algorithms to the continual observation setting. They use a "checkpointing" strategy, only re-running the private estimation when the stream has grown significantly enough to justify the expenditure of the privacy budget.

3. Experimental Evaluation

The algorithms were evaluated on both synthetic and real-world datasets, including a Taxi Service Trajectory dataset (~1.5M records) and a Gas Sensor dataset (~4M records).

Key Results: * Space Efficiency: In experiments on the Gas Sensor dataset, DPExpGK used orders of magnitude less space than the full-space baseline (DPExpFull). While the baseline's space usage exploded linearly with stream length, DPExpGK remained nearly flat, confirming its $O(\log n)$ space complexity. * Accuracy: While DPExpGK introduces slight error due to the sketch's approximation, the relative error remains very low (often $10^{-4}$ to $10^{-3}$) and stable as the stream grows. * Speed: The optimized implementation using the Gumbel-max trick was significantly faster than the full-space baseline for large-scale datasets.

4. Conclusion

This research demonstrates that it is possible to achieve differential privacy in quantile estimation using only logarithmic space. By leveraging the interval structure of deterministic sketches, the proposed algorithms provide a scalable and private solution for streaming data. Future work may involve exploring randomized sketches like the KLL sketch or investigating tighter bounds for streams with random arrival orders.

Summary updated

BibTeX
@article{alabi2023bounded,
  author = {Daniel Alabi and Omri Ben-Eliezer and Anamay Chaturvedi},
  title = {{Bounded Space Differentially Private Quantiles}},
  journal = {Accepted by TMLR},
  year = {2023},
  url = {https://openreview.net/forum?id=sixOD8YVvM},
}
Figure