NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Differentially Private Learning with Per-Sample Adaptive Clipping

Tianyu Xia, Shuheng Shen, Su Yao, Xinyi Fu, Ke Xu, Xiaolong Xu, Xing Fu

Abstract

Training models with Differential Privacy (DP) typically requires tuning a sensitive clipping threshold $C$ to balance information loss and noise injection. We present DP-PSAC, an algorithm utilizing a non-monotonic adaptive weight function that automatically adjusts clipping levels per sample. By suppressing noisy small gradients and clipping large ones, DP-PSAC achieves superior convergence and robustness compared to existing automatic clipping methods. Our evaluation across image and language benchmarks demonstrates that DP-PSAC matches or exceeds state-of-the-art performance while eliminating the need for extensive hyperparameter tuning.

Introduction

Differential Privacy (DP) in deep learning is primarily implemented via DP-SGD, which clips individual sample gradients to a maximum norm $C$ before adding noise. This process introduces two significant challenges: the "Hyperparameter Trap," where $C$ is extremely sensitive and difficult to tune, and "Privacy Leakage," where the search for an optimal $C$ consumes the privacy budget.

While recent methods like Auto-S and NSGD attempted to automate clipping by normalizing gradients, they inadvertently over-weight small gradients. In deep learning, these small gradients are often noise—frequently orthogonal or opposite to the true descent direction—leading to high convergence errors.

Methods: Per-Sample Adaptive Clipping

We propose Differentially Private Per-Sample Adaptive Clipping (DP-PSAC), which employs a non-monotonic weight function to address the limitations of previous automatic methods.

Unlike monotonic functions that assign increasingly larger weights to smaller gradients, the DP-PSAC weight function follows a bell-curve trajectory for small values and a standard clipping curve for large ones. Specifically, the weight $w$ for a gradient $g$ is defined as: $$w(g) = 1 / (\|g\| + \frac{r}{\|g\| + r})$$ where $r$ is a small regularization constant. This function effectively reduces the weight of "noisy" small gradients while scaling large gradients down to a constant $C$, coupling the clipping threshold with the learning rate.

The non-monotonic weight function of DP-PSAC compared to monotonic methods like Auto-S/NSGD.

Key Insights

A critical discovery in this work is that small gradients in a batch are often "junk." Analysis of cosine similarity reveals that gradients with small norms frequently point in directions unrelated or even counterproductive to the global update. By using a non-monotonic weight function that peaks and then tapers off for very small values, DP-PSAC achieves a tighter convergence error bound of $O(r^{-1/2})$, a significant improvement over the $O(r^{-1})$ bound of previous methods.

Experimental Results

We evaluated DP-PSAC on diverse datasets, including image classification (CIFAR10, Imagenette) and NLP tasks (GLUE benchmark).

Performance and Robustness

DP-PSAC consistently outperformed or matched DP-SGD and Auto-S. On the GLUE benchmark with $\epsilon=8$, DP-PSAC set new state-of-the-art marks, such as 88.03% accuracy on QNLI.

A key advantage of DP-PSAC is its stability. While DP-SGD's performance is highly sensitive to the clipping threshold, DP-PSAC remains robust across a wide range of values for the regularization parameter $r$. Typically, a fixed value of $r=0.1$ provides strong results across different tasks.

Heatmaps comparing the accuracy robustness of DP-PSAC (varying r) versus DP-SGD (varying clipping threshold).

Conclusion

DP-PSAC simplifies the deployment of differentially private models by removing the need to tune the clipping threshold $C$. By intelligently weighting gradients based on their norm, it avoids the pitfalls of over-weighting noise. Future work will explore data-driven adaptive weight functions to further optimize this strategy for complex, real-world scenarios.

Summary updated

BibTeX
@inproceedings{xia2023differentially,
  author = {Tianyu Xia and Shuheng Shen and Su Yao and Xinyi Fu and Ke Xu and Xiaolong Xu and Xing Fu},
  title = {{Differentially Private Learning with Per-Sample Adaptive Clipping}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.1609/aaai.v37i9.26242},
}
Figure