NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Learning Differentially Private Mechanisms

Subhajit Roy, Justin Hsu, Aws Albarghouthi

Abstract

Differential privacy is a formal, mathematical definition of data privacy that has gained traction in academia, industry, and government. The task of correctly constructing differentially private algorithms is non-trivial, and mistakes have been made in foundational algorithms. Currently, there is no automated support for converting an existing, non-private program into a differentially private version. In this paper, we propose a technique for automatically learning an accurate and differentially private version of a given non-private program. We show how to solve this difficult program synthesis problem via a combination of techniques: carefully picking representative example inputs, reducing the problem to continuous optimization, and mapping the results back to symbolic expressions. We demonstrate that our approach is able to learn foundational algorithms from the differential privacy literature and significantly outperforms natural program synthesis baselines.

Introduction

Implementing differential privacy (DP) is notoriously difficult and error-prone, even for experts. Developers must manually determine where to add noise, how much to add (the scale), and then mathematically prove the result is private. Mistakes are common—even foundational algorithms like the "Sparse Vector Technique" have had published versions with subtle privacy bugs.

Currently, developers have two choices: use pre-built DP building blocks (which may not fit their specific needs) or write and prove new algorithms from scratch. There is a distinct lack of automated support for converting a standard, non-private program into a private one. The search space for these "noise functions" is infinite, and testing for privacy violations is computationally expensive, making traditional program synthesis techniques fail. This paper introduces KOLAHAL, a tool that automatically synthesizes symbolic noise expressions for non-private program sketches.

The KOLAHAL Pipeline

KOLAHAL (Hindi for "loud noise") employs a three-step synthesis pipeline to bridge the gap between non-private sketches and private solutions.

1. Mechanism Sketching and Example Selection

The user provides a "sketch"—the original program with "holes" at locations where Laplace or Exponential noise should be added. Using a state-of-the-art testing tool called STATDP, the system identifies "challenging" inputs (neighboring databases) where the privacy guarantee is most likely to be violated.

Statistical testing of differential privacy using p-values to identify the 'Zone of Confusion'.

The tool specifically hunts for counterexamples where the statistical tester is "uncertain" (p-values in the middle range). These examples represent the boundary of the privacy guarantee and are the most useful for refining the synthesis.

2. Numerical Optimization

Instead of jumping straight to symbolic math (like $2/\epsilon$), KOLAHAL first treats the noise scales as real-valued numbers. It uses Differential Evolution—a global optimization algorithm—to find a "noise region" where the program is private and the privacy loss is "tight" (meaning it doesn't add more noise than necessary).

The optimization landscape for noise scales, showing the loss function used to find valid privacy regions.

To make this fast, they use importance sampling to reuse random noise draws across thousands of candidate settings. Defining "accuracy" for any arbitrary program is hard, but the authors realized that a "tight" privacy guarantee—where the privacy loss is exactly $\epsilon$—serves as an excellent proxy. If you add just enough noise to satisfy the limit, you are likely maximizing accuracy.

3. Symbolic Synthesis

Finally, the tool searches a grammar of symbolic expressions (involving variables like $\epsilon$ and input sizes) to find formulas that land within the previously discovered numerical "noise region." Searching for symbolic expressions (like 4 / epsilon) is hard because the search space is discrete and jagged. By solving a continuous numerical version of the problem first, the authors create a "map" that tells the symbolic search exactly where to look.

Evaluation and Results

The authors evaluated KOLAHAL on 9 foundational algorithms from differential privacy literature, including Basic (Sum, Histogram), Selection (Noisy Max, Above Threshold), and Complex (Sparse Vector Technique, SmartSum) mechanisms.

Key findings include:

  • Success across the board: KOLAHAL successfully synthesized all 9 benchmarks, including complex ones like SVT that stumped simpler baselines.
  • Efficiency: By using optimization to prune the search space, KOLAHAL was 2x to 20x faster than a version without the optimization phase.
  • Discovery: Interestingly, the tool found a new, valid variant of the "Above Threshold" algorithm that wasn't the standard textbook version but still satisfied the privacy requirements.
  • Robustness: It outperformed four baseline synthesis strategies, proving that the combination of example selection and continuous optimization is essential for complex DP tasks.

Limitations and Future Work

While powerful, KOLAHAL currently only supports "pure" $\epsilon$-differential privacy and cannot change the underlying logic of the program sketch. Furthermore, because it relies on a statistical tester (STATDP), the output isn't guaranteed to be private. The authors suggest that the synthesized candidates should still be passed to a formal verifier for a final "stamp of approval." Future work includes extending support to $(\epsilon, \delta)$-privacy and Rényi DP.

Summary updated

BibTeX
@inproceedings{roy2021learning,
  author = {Subhajit Roy and Justin Hsu and Aws Albarghouthi},
  title = {{Learning Differentially Private Mechanisms}},
  booktitle = {IEEE Symposium on Security and Privacy},
  year = {2021},
  url = {https://openreview.net/forum?id=QzWibUDb-W},
}
Figure