Differentially Private Weighted Sampling

Edith Cohen, Ofir Geri, Tamás Sarlós, Uri Stemmer

Abstract

Common datasets have the form of elements with keys (e.g., transactions and products) and the goal is to perform analytics on the aggregated form of key and frequency pairs. A weighted sample of keys by (a function of) frequency is a highly versatile summary that provides a sparse set of representative keys and supports approximate evaluations of query statistics. We propose private weighted sampling (PWS): A method that sanitizes a weighted sample as to ensure element-level differential privacy, while retaining its utility to the maximum extent possible. PWS maximizes the reporting probabilities of keys and estimation quality of a broad family of statistics. PWS improves over the state of the art even for the well-studied special case of private histograms, when no sampling is performed. We empirically observe significant performance gains of 20%-300% increase in key reporting for common Zipfian frequency distributions and accurate estimation with x2-8 lower frequencies. PWS is applied as a post-processing of a non-private sample, without requiring the original data. Therefore, it can be a seamless addition to existing implementations, such as those optimizes for distributed or streamed data. We believe that due to practicality and performance, PWS may become a method of choice in applications where privacy is desired.

Introduction

In modern data analytics, massive datasets are often summarized into "key-frequency" pairs—such as search queries and their counts. To manage this scale, weighted sampling is used to create small, representative summaries. However, sharing these summaries can leak sensitive information about individuals. The gold standard for protection is Differential Privacy (DP).

Traditional approaches to making histograms private, such as adding Laplace noise and thresholding, perform poorly on "sparse" data where many keys have low frequencies. In these cases, noise often drowns out the signal, causing useful keys to be dropped or reported with high error. Private Weighted Sampling (PWS) addresses this by treating sampling and sanitization as a single, optimized process, leveraging the inherent "privacy-boosting" effect of random sampling.

Methodology: The PWS Sanitizer

Unlike traditional methods that sanitize the original dataset, PWS acts as a post-processing step on an existing non-private weighted sample.

  1. End-to-End Privacy Analysis: PWS utilizes the principle that random sampling naturally amplifies privacy. By integrating the sampling rate directly into DP constraints, PWS allows for a "lighter" sanitization phase.
  2. Optimal Reporting Probabilities: The framework calculates the maximum possible probability ($\pi_i$) that a key with frequency $i$ can be included in the private sample without violating DP.
  3. Frequency Sanitization: For frequency estimation, PWS uses piecewise constant probability density functions (PDFs) to maximally separate different frequencies, ensuring the sanitized sample reflects the true relative order of keys.
  4. Maximum Likelihood Estimation (MLE): To avoid the high variance and negative values typical of "unbiased" DP estimators on sparse data, PWS employs an MLE that accepts a small amount of bias to achieve significantly lower Mean Squared Error (MSE).

Experimental Evaluation

The authors evaluated PWS using Zipfian frequency distributions ($\alpha = 0.5, 1, 2$), which are standard models for real-world data like word frequencies and web traffic.

Key Results

PWS demonstrates substantial improvements over the state-of-the-art Stability-based Histograms (SbH):

  • Increased Visibility: Key reporting increases by 20% to 300% for common Zipfian distributions.
  • Better Accuracy: Accurate frequency estimation is achieved for keys with frequencies 2x to 8x lower than previous methods.
  • Faster Convergence: Reporting probabilities reach 1 much faster as frequency increases compared to baselines.
Reporting gain and fraction of keys reported for PWS (Opt) vs SbH across Zipfian distributions.

Discussion and Insights

A core insight of PWS is that sampling is a privacy feature, not a hurdle. By accounting for the privacy benefits of sampling, PWS reports significantly more low-frequency keys. Furthermore, PWS is theoretically optimal for ordinal statistics, maximizing the probability that keys are reported in their correct relative rank (e.g., for "Top-K" lists).

Comparison of reporting probabilities for PWS (Opt) and SbH across different frequencies in private histograms.

Because PWS is a post-processing step, it is highly practical for existing distributed or streaming data pipelines.

Limitations and Future Work

Despite its gains, PWS cannot bypass the fundamental limits of DP: keys with extremely low frequencies (near 1) remain difficult to report with high probability because they are highly identifying. Future work includes extending PWS to composable private sketches (like MinHash) to support private set operations across multiple datasets and developing methods to privately determine optimal sampling thresholds.

Summary updated

BibTeX
@inproceedings{cohen2021differentially,
  author = {Edith Cohen and Ofir Geri and Tamás Sarlós and Uri Stemmer},
  title = {{Differentially Private Weighted Sampling}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2021},
  url = {https://openreview.net/forum?id=t78VtJIgIw},
}
Figure