Differentially Private Optimizers Can Learn Adversarially Robust Models

Zhiqi Bu, Yuan Zhang

Abstract: Machine learning models have shone in a variety of domains and attracted increasing attention from both the security and the privacy communities. One important yet worrying question is: Will training models under the differential privacy (DP) constraint have an unfavorable impact on their adversarial robustness? While previous works have postulated that privacy comes at the cost of worse robustness, we give the first theoretical analysis to show that DP models can indeed be robust and accurate, even sometimes more robust than their naturally-trained non-private counterparts. We observe three key factors that influence the privacy-robustness-accuracy tradeoff: (1) hyper-parameters for DP optimizers are critical; (2) pre-training on public data significantly mitigates the accuracy and robustness drop; (3) choice of DP optimizers makes a difference. With these factors set properly, we achieve 90% natural accuracy, 72% robust accuracy (+9% than the non-private model) under $l_2(0.5)$ attack, and 69% robust accuracy (+16% than the non-private model) with pre-trained SimCLRv2 model under $l_\infty(4/255)$ attack on CIFAR10 with $\epsilon=2$. In fact, we show both theoretically and empirically that DP models are Pareto optimal on the accuracy-robustness tradeoff. Empirically, the robustness of DP models is consistently observed across various datasets and models. We believe our encouraging results are a significant step towards training models that are private as well as robust.

Introduction: The Privacy-Robustness Conflict

In the development of trustworthy AI, two major concerns often appear to be in direct conflict: Privacy (protecting training data from leakage) and Adversarial Robustness (protecting models from malicious input perturbations). Previous research often highlighted an "upsetting tradeoff," suggesting that enforcing Differential Privacy (DP) during training inherently makes models more vulnerable to adversarial attacks.

This paper challenges that notion. The authors argue that the perceived tradeoff is not a fundamental limitation of privacy, but rather a consequence of improper hyperparameter tuning and a lack of theoretical understanding. By re-evaluating standard DP optimizers like DP-SGD, DP-Adam, and DP-RMSprop, they demonstrate that private models can actually surpass their non-private counterparts in robustness.

Theoretical Insight: DP as a Robust Regularizer

The core of the paper's argument lies in a theoretical analysis of linear classifiers under mixed Gaussian distributions. In standard non-private training, classes with higher variance tend to dominate the gradient, pushing the decision boundary toward the "easier" class and reducing the robustness of the "harder" class.

Decision boundaries for Natural, Adversarial, and DP models. The DP boundary aligns more closely with the robust adversarial boundary than the natural one, demonstrating how DP acts as a balancing mechanism.

DP optimization introduces per-sample gradient clipping and noise addition. The authors prove that the clipping mechanism acts as a regularizer that prevents any single high-variance class from dominating the learning process. As shown in Figure 1, the decision boundary learned via DP-SGD (dotted line) aligns much more closely with the optimal adversarial boundary (red line) than the standard natural boundary (green dashed line). This suggests that DP naturally encourages the learning of more robust features.

Practical Implementation: The "Small $R$, Large $\eta$" Rule

To achieve these robust results, the authors identify a critical hyperparameter regime: using a very small clipping norm ($R$) and a significantly larger learning rate ($\eta$) than typical non-private training.

Learned bias $b_{DP}$ as a function of clipping norm $R$. As $R$ decreases, the DP-learned bias approaches the optimal robust bias values ($b_\gamma$), confirming that small clipping norms are essential for robustness.

Setting a small $R$ effectively normalizes the gradients, allowing the optimizer to focus on the direction of the gradient rather than its magnitude. This "Automatic Clipping" prevents outliers from skewing the model. As illustrated in Figure 6, as the clipping norm $R$ decreases, the bias learned by the DP optimizer converges toward the theoretically optimal robust bias. Furthermore, the authors found that adaptive optimizers like DP-Adam are more resilient to the choice of $R$, making them easier to tune for robustness in complex architectures.

Experimental Results: Surpassing Non-Private Baselines

The theoretical findings were validated across multiple benchmarks, including MNIST, CIFAR10, and CelebA. The results were particularly striking on CIFAR10 using a SimCLRv2 model pre-trained on ImageNet:

  • Natural Accuracy: 90% at $\epsilon=2$.
  • Robust Accuracy: 72% under $l_2$ attacks, which is a 9% improvement over the non-private version of the same model.
  • Metric Agnosticism: The robustness benefits were consistent across various attack types (FGSM, PGD, AutoPGD) and distance metrics ($l_\infty$ and $l_2$).

On the large-scale CelebA dataset, ResNet18 and Vision Transformer (ViT) models trained with DP achieved robustness levels nearly identical to their non-private counterparts, debunking the myth that DP necessarily ruins performance in high-dimensional settings.

Conclusion and Future Directions

This research demonstrates that privacy and robustness are not mutually exclusive. When properly tuned, DP optimizers produce models that are Pareto optimal on the accuracy-robustness tradeoff. While the current high-performance results rely on pre-training on public data, this work provides a roadmap for building models that are both private and secure. Future research will look to extend these theoretical frameworks to deep, non-linear networks and other domains such as Natural Language Processing.

Summary updated

BibTeX
@article{bu2023differentially,
  author = {Zhiqi Bu and Yuan Zhang},
  title = {{Differentially Private Optimizers Can Learn Adversarially Robust Models}},
  journal = {Accepted by TMLR},
  year = {2023},
  url = {https://openreview.net/forum?id=o8VgRNYh6n},
}
Figure