DPVIm: Differentially Private Variational Inference Improved

Joonas Jälkö, Lukas Prediger, Antti Honkela, Samuel Kaski

Abstract

Differentially private (DP) release of multidimensional statistics typically considers an aggregate sensitivity, e.g. the vector norm of a high-dimensional vector. However, different dimensions of that vector might have widely different magnitudes and therefore DP perturbation disproportionately affects the signal across dimensions. We observe this problem in the gradient release of the DP-SGD algorithm when using it for variational inference (VI), where it manifests in poor convergence as well as high variance in outputs for certain variational parameters, and make the following contributions: (i) We mathematically isolate the cause for the difference in magnitudes between gradient parts corresponding to different variational parameters. Using this as prior knowledge we establish a link between the gradients of the variational parameters, and propose an efficient while simple fix for the problem to obtain a less noisy gradient estimator, which we call aligned gradients. This approach allows us to obtain the updates for the covariance parameter of a Gaussian posterior approximation without a privacy cost. We compare this to alternative approaches for scaling the gradients using analytically derived preconditioning, e.g. natural gradients. (ii) We suggest using iterate averaging over the DP parameter traces recovered during the training, to reduce the DP-induced noise in parameter estimates at no additional cost in privacy. Finally, (iii) to accurately capture the additional uncertainty DP introduces to the model parameters, we infer the DP-induced noise from the parameter traces and include that in the learned posteriors to make them noise aware. We demonstrate the efficacy of our proposed improvements through various experiments on real data.

Introduction

Variational Inference (VI) is a cornerstone of Bayesian machine learning, enabling the approximation of complex posterior distributions. However, integrating Differential Privacy (DP)—typically via DP-SGD—introduces a significant challenge known as disparate perturbation. In standard DP-SGD, gradients are clipped to a fixed threshold and Gaussian noise is added. In the context of VI, the gradients for mean parameters ($m_q$) often dwarf those for scale or variance parameters ($s_q$). Because noise is added relative to the global clipping threshold, the smaller signal in variance parameters is frequently overwhelmed, leading to poor convergence or inaccurate uncertainty estimates.

Methodology

The authors propose three primary improvements to address the limitations of vanilla DPVI:

1. Aligned Gradients

This is the core innovation of DPVIm. The authors demonstrate that the gradient for the variance parameter is mathematically linked to the gradient of the mean. By releasing only the mean gradient under DP and deriving the variance gradient as a post-processing step, they leverage DP's "post-processing immunity." This provides variance updates without additional privacy cost and ensures noise levels remain proportional to the signal.

Algorithm 1: The aligned gradient procedure for a single step.

While natural gradients are often used to accelerate VI, the authors show that in a DP context, they can reverse the disparate perturbation problem, making mean gradients the "small" ones drowned by noise. To mitigate this, they extend the alignment principle to natural gradients.

Algorithm 2: The aligned natural gradient procedure for a single step.

2. Iterate Averaging

To dampen the randomness introduced by DP noise, the authors implement iterate averaging over the final stages of training. This provides a more stable and unbiased estimate of the optimal parameters without consuming extra privacy budget.

3. Noise-Aware Posteriors

DP noise adds inherent uncertainty to model parameters. By treating the training process as an Ornstein-Uhlenbeck (OU) process, the authors analyze parameter fluctuations during the final training stages. This allows them to estimate "DP-induced noise" and incorporate it into the final posterior, resulting in models that are aware of their own privacy-related uncertainty.

Experimental Evaluation

The proposed methods were evaluated across several benchmarks:

  • UK Biobank (UKB): Modeling SARS-CoV-2 infection risk using personal health data.
  • US Census 1990: Predicting poverty indicators in a large-scale dataset.
  • Adult Dataset: A standard UCI benchmark for income classification.
  • Simulated Data: Testing extensions to full-rank covariance matrices, where parameter counts grow quadratically.

Key Results and Discussion

  • Robustness: Aligned DPVI is significantly more robust to initialization than vanilla DPVI, which often requires precise tuning of starting standard deviations to avoid divergence.
  • Accuracy: In UKB and US Census experiments, the "Aligned" variant consistently achieved lower Mean Proportional Absolute Error (MPAE) compared to vanilla and preconditioned baselines.
  • Scalability: The method scales effectively to full-rank Gaussian posteriors. In simulated linear regression, Aligned DPVI achieved higher predictive log-likelihoods than vanilla DPVI, which struggled to manage the privacy budget over the quadratic number of covariance parameters.

Conclusion

DPVIm addresses the "sensitivity bottleneck" in high-dimensional DP optimization by mathematically aligning gradients. While the method is robust, future work could focus on automating the detection of these gradient links within computational graphs (e.g., JAX or PyTorch) and refining the heuristics used to trigger iterate averaging.

Summary updated

BibTeX
@article{jalko2023dpvim,
  author = {Joonas Jälkö and Lukas Prediger and Antti Honkela and Samuel Kaski},
  title = {{DPVIm: Differentially Private Variational Inference Improved}},
  journal = {Accepted by TMLR},
  year = {2023},
  url = {https://openreview.net/forum?id=GlhM6XX1wv},
}
Figure