Privacy-Aware Rejection Sampling

Jordan Awan, Vinayak Rao

TL;DR

While differential privacy (DP) guarantees mathematical protection for sensitive data, real-world implementations can leak information through side channels like execution time. This paper quantifies how rejection sampling leaks privacy through data-dependent runtimes and introduces three modifications—including a squeeze-function-based adaptive rejection sampler—that guarantee exact sampling with data-independent runtimes.

What Problem Does This Paper Address?

Many foundational differential privacy tools, such as the exponential mechanism, require sampling from complex, unnormalized target distributions of the form $\exp(g(x))$. Practitioners typically sample from these distributions using computational techniques like Markov chain Monte Carlo (MCMC) or rejection sampling.

Rejection sampling produces exact (unbiased) draws from the target distribution, but it carries a hidden vulnerability: the probability of accepting a proposal depends on the underlying dataset. Consequently, the number of iterations until a sample is accepted varies with the data. If an adversary can observe execution time (a timing side-channel attack), this runtime leaks information about individual records in the dataset.

Methods

The authors treat the sampler's runtime as an additional output that must satisfy DP jointly with the returned sample. They propose three privacy-preserving modifications to rejection sampling:

  1. Constant-Runtime Truncated Sampler: Run the rejection sampler for a pre-determined, fixed number of iterations $N$. If a proposal is accepted within $N$ steps, return the first one; otherwise, return a fallback draw.
  2. Additive Geometric Wait-Time: Leverage the memoryless property of the geometric distribution. After accepting a sample, the algorithm introduces an artificial geometric delay scaled so that the total execution time follows $\text{Geom}(1/c)$ across all datasets, matching the worst-case acceptance probability.
  3. Implicit Wait-Time via Squeeze Functions: Use lower and upper bounding functions ($c_L L(x) \le \tilde{\pi}(x) \le c_U U(x)$) where the ratio $c_L / c_U$ is constant across all datasets. This guarantees exact sampling while enforcing a strictly data-independent runtime without needing to compute the dataset's normalizing constant.

The authors also extend this squeeze-function approach to Adaptive Rejection Sampling for log-Hölder densities over bounded convex domains, iteratively refining piecewise proposal and squeeze bounds without exposing data-dependent timing signals.

Standard Rejection Sampling:
  Data D ---> Acceptance prob p_D ---> Runtime ~ Geom(p_D)  [LEAKS DATA!]

Privacy-Aware Squeeze Sampling:
  Data D ---> Fixed ratio c_L / c_U  ---> Runtime ~ Geom(c_L / c_U) [DATA-INDEPENDENT]

Datasets

Not discussed in the paper. (The paper is purely theoretical and does not evaluate on empirical datasets.)

Key Insights and Ideas

  • Rejection sampling runtime completely breaks pure $\epsilon$-DP: Because geometric distribution tails have unbounded likelihood ratios as the step count $t \to \infty$, the runtime of standard rejection sampling never satisfies pure $\epsilon$-DP unless the acceptance probability is completely invariant across all neighboring datasets ($R = 1$). It can only be bounded under relaxed $(\epsilon, \delta)$-DP.
  • Squeeze functions as timing shields: Squeeze functions are traditionally used in computational statistics to avoid evaluating expensive target densities. Here, the authors repurpose them to decouple the sampler's runtime from the dataset.
  • Tractable exponential mechanisms: The authors prove that utility functions that are both strongly concave and $L$-smooth—as well as objective functions used in the $K$-norm gradient mechanism (KNG)—admit explicit analytic squeeze bounds, enabling timing-safe exact sampling.

Key Results

  • Quantified Privacy Leakage: For standard rejection sampling with runtime $T_D \sim \text{Geom}(p_D)$ and ratio $R = \sup \frac{\log(1-p_D)}{\log(1-p_{D'})}$, the runtime satisfies $(\epsilon, \delta)$-DP with: $$\delta(\epsilon) = \left(1 - \frac{1}{R}\right) \exp\left(\frac{-\epsilon - \log R}{R - 1}\right)$$
  • Truncated Sampler Efficiency: Setting $N = \frac{\log(1/\delta)}{\log(1/(1-\alpha_0))}$ (where $\alpha_0$ is a lower bound on the acceptance probability) preserves $(\epsilon_0, \delta_0 + \delta)$-DP, scaling only logarithmically in $1/\delta$.
  • Data-Independent Squeeze Sampler: Guarantees exact target sampling with an overall runtime distributed as $\text{Geom}(c_L / c_U)$.
  • Concrete Acceptance Rates:
  • For $\alpha$-strongly concave and $L$-smooth log-densities in $\mathbb{R}^d$, the squeeze method achieves a data-independent acceptance rate of $(\alpha / L)^{d/2}$.
  • For the $K$-norm gradient mechanism with strongly convex and $L$-smooth utilities, the acceptance rate is $(\alpha / L)^d$.

Limitations and Future Work

  • Curse of Dimensionality: In both the strongly concave and KNG settings, the guaranteed data-independent acceptance probability scales exponentially with dimension $d$ (e.g., $(\alpha / L)^{d/2}$). In high dimensions, rejection rates will be high, leading to long average runtimes.
  • Utility Loss in Truncation: While the constant-runtime truncated sampler requires minimal assumptions, it introduces an approximation error if no sample is accepted within $N$ steps.
  • Prerequisites for Adaptive Sampling: The proposed adaptive rejection sampler requires bounded domains ($C \subset \mathbb{R}^d$) and known Hölder continuity parameters $(s, H)$, which may not always be readily available in complex machine learning models.

Summary updated

Abstract

Differential privacy (DP) offers strong protection against adversaries with arbitrary side-information and computational power. However, many implementations of DP mechanisms leave themselves vulnerable to side channel attacks, such as timing attacks. As many privacy mechanisms, such as the exponential mechanism, do not lend themselves to easy implementations, when sampling methods such as MCMC or rejection sampling are used, the runtime can leak privacy. In this work, we quantify the privacy cost due to the runtime of a rejection sampler in terms of $(\epsilon,\delta)$-DP. We also propose three modifications to the rejection sampling algorithm, to protect against timing attacks by making the runtime independent of the data. We also use our techniques to develop an adaptive rejection sampler for log-Holder densities, which also has data-independent runtime.
BibTeX
@article{awan2023privacy,
  author = {Jordan Awan and Vinayak Rao},
  title = {{Privacy-Aware Rejection Sampling}},
  journal = {J. Mach. Learn. Res.},
  year = {2023},
}
Figure