On the Convergence of Deep Learning with Differential Privacy

Zhiqi Bu, Hua Wang, Qi Long, Weijie J. Su

TL;DR

This paper investigates the trade-offs between differential privacy (DP) and deep learning performance, specifically focusing on convergence and model calibration. They find that DP noise primarily impacts privacy risk, while per-sample gradient clipping significantly affects convergence and calibration. Crucially, larger clipping norms lead to better-calibrated models with comparable accuracy and privacy.

What Problem Does This Paper Address?

Deep learning models are increasingly used with sensitive data, raising privacy concerns. Differential privacy (DP) offers a rigorous way to protect this data, but it often comes at the cost of slower training (convergence) and less accurate or reliable models (mis-calibration). While DP training methods like DP-SGD are widely used, the theoretical understanding of why these trade-offs occur, particularly concerning convergence and calibration, has been limited. This paper aims to demystify these phenomena by providing a theoretical framework and empirical validation.

Methods

The authors employ a continuous-time analysis framework using the Neural Tangent Kernel (NTK) to model the dynamics of DP training. This approach allows them to disentangle the effects of two key DP components: noise addition and per-sample gradient clipping. They analyze how these components influence the NTK matrix and, consequently, the convergence and calibration of the models. They also investigate two styles of gradient clipping: "flat clipping" and "layerwise clipping."

Datasets

The paper uses several standard datasets for evaluation:

  • CIFAR10: Image classification dataset.
  • MNIST: Image classification dataset.
  • SNLI: Natural Language Inference dataset.
  • California Housing: Regression dataset.
  • Wine Quality: Regression dataset.

Key Insights and Ideas

  • Noise vs. Clipping: The most striking finding is that the noise added for privacy has no impact on the convergence or calibration of the model in the continuous-time limit. Instead, it solely affects the privacy risk. This is a significant theoretical result that shifts focus to the clipping mechanism.
  • Clipping's Dual Role: Per-sample gradient clipping, on the other hand, is shown to be the primary driver of changes in both convergence speed and model calibration.
  • The "Small Clipping Norm" Paradox: DP models trained with a small clipping norm tend to achieve higher accuracy but are poorly calibrated, meaning their confidence in predictions doesn't match their actual accuracy. They are often "over-confident."
  • The "Large Clipping Norm" Solution: Conversely, using a large clipping norm not only maintains the same privacy guarantee but also leads to significantly better calibration with comparable accuracy. This suggests a practical strategy for improving DP model reliability.
  • NTK as the Key: The analysis hinges on how clipping modifies the Neural Tangent Kernel (NTK) matrix, impacting its properties like symmetry and positive definiteness, which are crucial for convergence guarantees.

Key Results

  • Theoretical: The paper provides a continuous-time analysis of DP-SGD using the NTK, showing that noise addition does not affect convergence or calibration, while clipping does. They formally characterize how small clipping norms can break the positive semi-definiteness of the NTK, leading to non-monotonic loss decrease and potential convergence to non-zero loss. Large clipping norms, conversely, preserve the NTK's desirable properties.
  • Empirical: Experiments on CIFAR10, MNIST, and SNLI datasets demonstrate that:
  • DP models with small clipping norms are often over-confident and mis-calibrated.
  • DP models with large clipping norms achieve similar accuracy and privacy but are significantly more calibrated.
  • For large models like Transformers, large clipping norms are crucial for achieving both high accuracy and good calibration.

Limitations and Future Work

  • Discrete-time Analysis: The current analysis primarily focuses on the continuous-time limit (infinitesimal learning rate). The authors acknowledge that in the discrete-time setting, especially with non-negligible learning rates and noise, the noise addition can affect convergence. This is identified as a key area for future investigation.
  • Mini-batch Optimizers: The analysis is extended to mini-batch optimizers, but the dynamics are noted to become stochastic, requiring further study using stochastic differential equations.
  • Cross-entropy vs. Accuracy: The inconsistency between cross-entropy loss and prediction accuracy, and its connection to calibration, remains an intriguing area for theoretical understanding.
  • Global Clipping: While explored, the paper suggests that with large clipping norms, global clipping offers negligible differences from existing clipping methods in terms of convergence and calibration.

Summary updated

Abstract

Differentially private (DP) training preserves the data privacy usually at the cost of slower convergence (and thus lower accuracy), as well as more severe mis-calibration than its non-private counterpart. To analyze the convergence of DP training, we formulate a continuous time analysis through the lens of neural tangent kernel (NTK), which characterizes the per-sample gradient clipping and the noise addition in DP training, for arbitrary network architectures and loss functions. Interestingly, we show that the noise addition only affects the privacy risk but not the convergence or calibration, whereas the per-sample gradient clipping (under both flat and layerwise clipping styles) only affects the convergence and calibration. Furthermore, we observe that while DP models trained with small clipping norm usually achieve the best accurate, but are poorly calibrated and thus unreliable. In sharp contrast, DP models trained with large clipping norm enjoy the same privacy guarantee and similar accuracy, but are significantly more \textit{calibrated}. Our code can be found at \url{https://github.com/woodyx218/opacus_global_clipping}.
BibTeX
@article{bu2023convergence,
  author = {Zhiqi Bu and Hua Wang and Qi Long and Weijie J. Su},
  title = {{On the Convergence of Deep Learning with Differential Privacy}},
  journal = {Accepted by TMLR},
  year = {2023},
  url = {https://openreview.net/forum?id=K0CAGgjYS1},
}
Figure