On Optimal Hyperparameters for Differentially Private Deep Transfer Learning
Aki Rehn, Linzh Zhao, Mikko A. Heikkilä, Antti Honkela
TL;DR
This paper addresses how to optimally set two DP hyperparameters, the clipping bound $C$ and batch size $B$, during differentially private transfer learning. It challenges the common practice of fixing $(C,B)$ across tasks by showing that optimal values shift with privacy level, backbone capability, and compute budgets due to changes in gradient distributions and DP noise accumulation. A key theoretical contribution is the exact optimal clipping bound $C^*$ that minimizes mean squared error: $C^* = \frac{N_{C^*}^T G_{C^*}}{N_{C^*}^T N_{C^*} + \sigma^2 d}$, paired with insights that clipping acts as gradient re-weighting and that cumulative DP noise governs batch-size effectiveness under fixed epochs. The authors propose practical guidance: tune $C$ and $B$ jointly to match problem difficulty and privacy constraints, leveraging a minimum-step plus cumulative-noise criterion and recognizing the plateau behavior of DP noise in fixed-epoch regimes. These findings have practical implications for DP deployments, suggesting that adaptive hyperparameter strategies can significantly improve DP transfer learning performance, especially on harder problems or constrained compute budgets.
Abstract
Differentially private (DP) transfer learning, i.e., fine-tuning a pretrained model on private data, is the current state-of-the-art approach for training large models under privacy constraints. We focus on two key hyperparameters in this setting: the clipping bound $C$ and batch size $B$. We show a clear mismatch between the current theoretical understanding of how to choose an optimal $C$ (stronger privacy requires smaller $C$) and empirical outcomes (larger $C$ performs better under strong privacy), caused by changes in the gradient distributions. Assuming a limited compute budget (fixed epochs), we demonstrate that the existing heuristics for tuning $B$ do not work, while cumulative DP noise better explains whether smaller or larger batches perform better. We also highlight how the common practice of using a single $(C,B)$ setting across tasks can lead to suboptimal performance. We find that performance drops especially when moving between loose and tight privacy and between plentiful and limited compute, which we explain by analyzing clipping as a form of gradient re-weighting and examining cumulative DP noise.
