Batch Clipping and Adaptive Layerwise Clipping for Differential Private Stochastic Gradient Descent

Toan N. Nguyen, Phuong Ha Nguyen, Lam M. Nguyen, Marten van DijkarXiv 2023 · DOI

Introduction

Training deep neural networks with Differential Privacy (DP) often encounters a fundamental conflict with modern architectural components, most notably Batch Normalization (BN). Standard Differential Private Stochastic Gradient Descent (DP-SGD) relies on Individual Clipping (IC), which computes and clips gradients for each sample independently. This approach breaks the batch dependencies required by BN, frequently leading to convergence failure in deep architectures like ResNet-18.

This paper introduces Batch Clipping (BC) and an enhanced Adaptive Layerwise Clipping (ALC) to bridge this gap. By proving that clipping batch-averaged gradients maintains the same privacy guarantees as individual clipping, the authors enable the use of BN in private training, allowing complex models to converge where traditional methods fail.

Methodology

The proposed framework modifies the DP-SGD pipeline through two primary mechanisms:

Batch Clipping (BC)

Instead of the computationally expensive and BN-incompatible process of clipping individual sample gradients, BC averages a small batch of gradients before applying the clipping operation. The authors provide a formal proof within the $f$-DP (Gaussian DP) framework, demonstrating that BC offers privacy guarantees identical to standard individual clipping. This preservation of batch-level statistics is crucial for the functional integrity of Batch Normalization layers.

Enhanced Adaptive Layerwise Clipping (ALC)

Neural networks exhibit significant variance in gradient scales across different layers. A global clipping constant often "suffocates" some layers with excessive noise while failing to constrain others.

Gradient norm distribution across different layers of ResNet-18. The wide variance motivates the use of Adaptive Layerwise Clipping (ALC).

To address this, the authors utilize a small "public" (non-private) dataset to estimate typical gradient norms per layer. They then set layer-specific clipping constants ($C_h$) that scale with a global master constant ($C$), ensuring noise is proportional to each layer's signal.

Experimental Results

The methods were evaluated on CIFAR-10 and MNIST using ResNet-18 and simpler ConvNet architectures.

Convergence and Performance

The most significant result is the successful training of ResNet-18 on CIFAR-10. While standard IC-based DP-SGD fails to converge, the combination of BC and ALC achieves 67% accuracy at a noise level of $\sigma = 0.01875$.

Comparison of Batch Clipping (BC), Individual Clipping (IC), and prior adaptive methods (Zhang et al.) on CIFAR-10. BC significantly outperforms IC, which fails to converge.

As shown in Figure 3, BC not only enables convergence but also outperforms previous state-of-the-art adaptive methods. The enhanced ALC provides faster convergence and higher final accuracy by better managing the noise-to-signal ratio across the network.

Discussion and Limitations

While BC and ALC represent a major step forward, several challenges remain. High accuracy on ResNet-18 currently requires relatively low noise levels (weak DP). Achieving similar performance under "strong" privacy regimes ($\sigma > 1.0$) remains an open challenge. Additionally, treating $L$ layers independently introduces a $\sqrt{L}$ factor into the noise requirement. The authors suggest layer grouping or "Sparsification" (freezing converged weights) as potential mitigations. Finally, the reliance on a public proxy dataset for ALC may be problematic in domains where no such data exists.

Conclusion

By rethinking the clipping mechanism and accounting for layerwise gradient dynamics, this work provides a theoretically grounded path for training modern, deep architectures with differential privacy. Batch Clipping, in particular, resolves the long-standing incompatibility between DP and Batch Normalization, unlocking the potential of ResNets in private machine learning.

Summary updated

BibTeX
@misc{nguyen2023batch,
  author = {Toan N. Nguyen and Phuong Ha Nguyen and Lam M. Nguyen and Marten van Dijk},
  title = {{Batch Clipping and Adaptive Layerwise Clipping for Differential Private Stochastic Gradient Descent}},
  year = {2023},
  eprint = {2307.11939},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2307.11939},
}
Figure