Revisiting Hyperparameter Tuning with Differential Privacy

Youlong Ding, Xueyang Wu

TL;DR

Tuning hyperparameters in privacy-preserving machine learning typically leaks private information, causing the total privacy budget to scale with the number of configurations tested. This paper introduces a "propose-test" framework with a doubling step that decouples privacy loss from the number of hyperparameter candidates, bounding it instead by the utility gained over tuning. As a result, practitioners can perform an exhaustive grid search over arbitrarily large hyperparameter spaces with only a modest, utility-dependent privacy overhead.

What Problem Does This Paper Address?

In standard machine learning, finding optimal hyperparameters (like learning rates, clipping norms, or batch sizes) requires dozens or hundreds of training runs. In differentially private (DP) machine learning, this poses a major dilemma:

  1. Privacy Leakage: Hyperparameter choices reflect patterns in the underlying dataset and can leak sensitive information (e.g., enabling membership inference attacks).
  2. Composition Explosion: By basic or advanced DP composition, evaluating $K$ models causes the privacy parameter to inflate by $O(K\epsilon)$ or $\tilde{O}(\sqrt{K}\epsilon)$. Reporting only the single-run privacy parameter of the best-performing model violates differential privacy standards.
  3. Restricted Search Spaces: Existing solutions like RandTune randomly sample $K$ candidates from a distribution to keep the total privacy budget bounded to $2\epsilon$ or $3\epsilon$. However, if the candidate pool is large, the probability of sampling high-performing hyperparameters drops precipitously.

The authors ask: Can we exhaustively search an arbitrarily large hyperparameter pool without scaling privacy loss with the number of trials?

Methods

The authors propose Propose-test Hyperparameter Tuning with Doubling Step (Algorithm 1), which combines several classical algorithmic techniques:

  • Subsample and Aggregate for Sensitivity Control: The training set is split into $k$ disjoint subsets. Candidate models are trained on each subset (either non-privately or privately), and their accuracy on a validation set is averaged. This bounds the validation utility's $\ell_1$ sensitivity to at most $1/k$.
  • Sparse Vector Technique (AboveThreshold): Rather than outputting the exact validation accuracies of all candidate configurations, the algorithm tests whether any candidate's noisy utility exceeds a proposed threshold ($\hat{u} = u + \text{step} \times g + \text{Laplace noise}$). Only candidates that surpass this threshold trigger a state update.
  • Doubling Step Exploration: Inspired by lowest common ancestor (LCA) algorithms on trees, the search dynamically adjusts step sizes along a utility granularity $g$. If a candidate surpasses the threshold, the utility estimate jumps and the step size doubles (step *= 2). If no candidate meets the threshold, the step size is halved (step = ⌊step / 2⌋).
  • Final Model Training: Once the best hyperparameter configuration $s^*$ is selected, a final model is trained on the full training set using DP-SGD with parameters $(\epsilon, \delta)$.

By advanced composition, the overall process satisfies: $$\left(\epsilon + \tilde{O}\left(\sqrt{\frac{u^* - u_0}{g}}\right)\epsilon_0,\, \delta\right)\text{-differential privacy}$$ where $u_0$ is the baseline utility, $u^*$ is the achieved utility, and $\epsilon_0$ is the step budget parameter.

Datasets

  • Real-world benchmarks: Not discussed in the paper (no standard vision or NLP benchmarks such as CIFAR or ImageNet are evaluated).
  • Synthetic Evaluation: The authors evaluate the algorithm using a synthetic simulation where true utility values $u_s$ for $|S| = 100$ hyperparameters are drawn independently from a uniform distribution over $(0, 1)$, evaluated with $k = 10$ partitions, utility granularity $g = 0.01$, and $\epsilon_0 = 0.1$.

Key Insights and Ideas

  • Privacy Loss Tied to Utility, Not Search Size: The privacy parameter does not depend on the number of hyperparameter configurations $|S|$, enabling full grid search over huge search spaces. Instead, it scales with how much utility $(u^* - u_0)$ the search actually discovers.
  • Non-Private Candidate Evaluations: Candidate evaluations during tuning do not strictly require private training algorithms (provided hyperparameter behavior correlates between private and non-private regimes), because the privacy guarantee is enforced downstream by the partition-averaging and threshold noise.
  • Logarithmic Empirical Scaling: Although the worst-case theoretical iteration count is $O((u^* - u_0)/g)$—corresponding to alternating success/failure zig-zagging—the doubling step behaves like $O(\log_2 \frac{u^* - u_0}{g})$ in practice, drastically reducing the effective privacy loss.

Key Results

  • Empirical Iteration Complexity: In numerical simulations across 1,000 random seeds, the utility accumulated exponentially at early stages and converged with $>99.9\%$ probability.
  • Sub-Linear Growth: When varying $(u^* - u_0)/g$ from $0$ to $50,000$, the number of query iterations required by the doubling-step mechanism grew almost purely logarithmically, plateauing at fewer than $15$ iterations.
  • Analytical Privacy Bound: Guarantees $(\epsilon + \tilde{O}(\sqrt{\frac{u^* - u_0}{g}})\epsilon_0, \delta)$-DP regardless of candidate pool size $|S|$, whereas standard composition scales as $\tilde{O}(\sqrt{|S|}\epsilon)$.

Limitations and Future Work

  • Lack of Empirical ML Validation: The evaluation is limited to synthetic simulations; the paper does not demonstrate the method on real-world datasets, deep neural networks, or standard DP-SGD benchmarks.
  • Partitioning Data Overhead: Splitting $D_{\text{train}}$ into $k$ disjoint subsets reduces the effective sample size per model to $N/k$, which could significantly degrade utility estimation when training data is scarce.
  • Theory vs. Practice Gap: The theoretical worst-case bound on iterations is $O((u^* - u_0)/g)$, whereas empirical runs display logarithmic scaling $O(\log \frac{u^* - u_0}{g})$. Formally proving this logarithmic bound under distributional noise remains open.

Summary updated

BibTeX
@inproceedings{ding2022revisiting,
  author = {Youlong Ding and Xueyang Wu},
  title = {{Revisiting Hyperparameter Tuning with Differential Privacy}},
  booktitle = {MLSW @ NeurIPS},
  year = {2022},
  url = {https://openreview.net/forum?id=6Xfp10iIbP3},
}
Figure