Abstract
We systematically study the calibration of classifiers trained with differentially private stochastic gradient descent (DP-SGD) and observe miscalibration across a wide range of vision and language tasks. Our analysis identifies per-example gradient clipping in DP-SGD as a major cause of miscalibration, and we show that existing approaches for improving calibration with differential privacy only provide marginal improvements in calibration error while occasionally causing large degradations in accuracy. As a solution, we show that differentially private variants of post-processing calibration methods such as temperature scaling and Platt scaling are surprisingly effective and have negligible utility cost to the overall model. Across 7 tasks, temperature scaling and Platt scaling with DP-SGD result in an average 3.1-fold reduction in the in-domain expected calibration error and only incur at most a minor percent drop in accuracy.
Introduction
Differential Privacy (DP) has emerged as the gold standard for training machine learning models with strong privacy guarantees. The primary algorithm, Differentially Private Stochastic Gradient Descent (DP-SGD), ensures privacy by clipping individual gradients and adding Gaussian noise. While much research has focused on the "utility-privacy trade-off"—the drop in accuracy required to maintain privacy—this paper investigates a critical but overlooked dimension of model trustworthiness: calibration.
A well-calibrated model provides confidence scores that accurately reflect the probability of being correct. For instance, if a model predicts a label with 90% confidence, it should be correct 90% of the time. In safety-critical domains like healthcare or autonomous systems, understanding when a model is uncertain is as vital as the prediction itself. We find that DP-trained models are severely miscalibrated, exhibiting a phenomenon we call "polarization."
The Polarization Phenomenon
Our investigation reveals that DP-SGD models tend to be "stubbornly" overconfident. Instead of their confidence decreasing as accuracy drops (as seen in standard models), DP models polarize their predictions toward extreme values of 0 or 1.
As shown in Figure 1, the confidence histogram for the DP model shows massive spikes at the edges. This polarization means the model outputs high-confidence predictions even when it is likely to be incorrect, leading to a high Expected Calibration Error (ECE).
Identifying the Cause: Gradient Clipping
Through a series of ablation studies, we isolated the components of DP-SGD to determine the root cause of this miscalibration. By testing models with noise but no clipping, and vice versa, we discovered that per-example gradient clipping is the primary driver.
When the clipping threshold is low (required for tighter privacy), the model's ability to represent uncertainty breaks down. Interestingly, this miscalibration occurs long before significant drops in accuracy are observed. Furthermore, we found that DP models exhibit a very small "calibration generalization gap"—they are equally miscalibrated on both training and test data, unlike non-private models which often overfit and lose calibration primarily on unseen data.
Differentially Private Recalibration
To address this, we propose using standard post-hoc calibration methods—Temperature Scaling (TS) and Platt Scaling (PS)—adapted for differential privacy.
Our approach utilizes sample splitting:
- Training: 90% of the private data is used to train the base model via DP-SGD.
- Recalibration: The remaining 10% is used to train a simple recalibrator (the scaling function).
- Privacy Guarantee: We provide a formal analysis proving that this split allows the entire pipeline to remain $(\epsilon, \delta)$-differentially private without increasing the total privacy budget spent.
Key Results
We evaluated our methods across 7 diverse tasks, including vision (CIFAR-10, ViT features) and language (fine-tuning RoBERTa on GLUE tasks).
- Significant ECE Reduction: DP-Temperature Scaling (DP-TS) and DP-Platt Scaling (DP-PS) achieved an average 3.1-fold reduction in ECE across all tasks.
- Minimal Utility Cost: The accuracy cost of reserving 10% of the data for calibration was negligible, typically less than 1%.
- Out-of-Domain Robustness: The recalibration also improved performance on out-of-domain (OOD) tasks, where DP models are traditionally even more prone to overconfidence.
- Superiority over Complex Methods: Simple post-hoc scaling consistently outperformed more complex internal modifications like Global Clipping or DP-SGLD in both accuracy and ECE.
Conclusion
Miscalibration is a significant, yet solvable, side effect of training with differential privacy. By identifying gradient clipping as the culprit and applying private post-hoc scaling, we can restore the trustworthiness of DP models with almost no cost to their accuracy. This work provides a practical path forward for deploying private AI in high-stakes environments where uncertainty quantification is essential.
Summary updated