On the efficacy of group-wise clipping in differentially private optimization

Zhiqi Bu, Ruixuan Liu, Yu-Xiang Wang, Sheng Zha, George Karypis · Submission to ICLR 2024 · Withdrawn

TL;DR

Differentially private deep learning relies on per-sample gradient clipping, but standard practice clips all model parameters simultaneously—creating steep memory bottlenecks during training. This paper analyzes group-wise clipping (partitioning parameters into $M$ groups before clipping), proving that while increasing group count theoretically loosens convergence bounds, it dramatically lowers peak memory without adding computational overhead. Crucially, the accuracy gap between all-layer and group-wise clipping vanishes on larger models, enabling memory-efficient private fine-tuning of vision and language transformers.

What Problem Does This Paper Address?

Differentially Private Stochastic Gradient Descent (DP-SGD) bounds user privacy leakage by computing gradients per-sample, clipping each gradient vector to a maximum norm $R$, and injecting calibrated Gaussian noise.

Most implementations use all-layer (flat) clipping, treating the entire parameter vector as one single group ($M = 1$). While all-layer clipping typically delivers the highest final model accuracy, it requires caching intermediate activation gradients across the entire network until the entire backward pass completes, leading to severe memory bloat. Prior alternatives like layer-wise clipping ($M = \text{number of layers}$) save memory, but were reported to be slow, prone to accuracy degradation, and reliant on finicky clipping threshold heuristics. This paper investigates the entire continuum of group-wise clipping, formalizing its mathematical convergence, peak memory profile, and practical trade-offs.

Methods

  • Group-Wise Book-Keeping (BK): The authors adapt the Book-Keeping (BK) algorithm to group-wise clipping. In an $M$-group setup, per-sample gradient norms are aggregated within a group $G_m$, the group clipping factor $C^{(m)}_i$ is applied, and the corresponding activations and output gradients are immediately freed from memory. All group variations share the same asymptotic computational complexity and execution speed.
  • Automatic Non-Adaptive Thresholds: Instead of tuning separate clipping thresholds per group, the authors distribute thresholds evenly via $R_m = 1/\sqrt{M}$ combined with automatic clipping ($C(g) = 1/(\|g\|_2 + 0.01)$).
  • Uniform vs. Non-Uniform Grouping: Beyond dividing networks evenly by transformer blocks (uniform), the authors explore non-uniform groupings that balance memory peaks across early and late backward-propagation stages.
  • Theoretical Analysis: The authors prove a high-probability convergence bound for DP-SGD under group-wise clipping for non-convex, smooth objectives, as well as a counter-example theorem showing that layer-wise clipping is mathematically not a generalization or superset of all-layer clipping.

Datasets

The authors evaluate downstream fine-tuning benchmarks across vision and language:

  • Vision: CIFAR-10, CIFAR-100, SVHN, GTSRB, and Food101 (using Vision Transformers: ViT-small and ViT-large).
  • Language Classification: MNLI (m/mm), QQP, QNLI, and SST-2 from the GLUE benchmark (using RoBERTa-base and RoBERTa-large).
  • Language Generation: E2E restaurant review dataset (using GPT-2 small, medium, and large).

No new benchmarks were created; all tasks are established DP transfer learning baselines.

Key Insights and Ideas

  • Equal Speed, Distinct Memory: Different grouping choices only reorder parameter gradient updates during the backward pass. Under the BK algorithm, group-wise clipping runs at essentially the same wall-clock speed as non-DP training (~1.1× non-DP overhead), debunking earlier claims that all-layer clipping is inherently 1.5–2× slower than layer-wise clipping.
  • The Group Count Penalty: Theorem 1 proves that DP-SGD achieves the standard $O(T^{-1/4})$ asymptotic convergence rate, but the bound scales negatively with $\sqrt{M}$. More groups introduce extra noise variance, explaining why flat clipping ($M=1$) yields better theoretical and empirical optimization than many fine-grained groups.
  • Finer Grouping Is Not Strictly Better: It is intuitive to think layer-wise clipping contains all-layer clipping as a special case if thresholds are tuned optimally. Theorem 2 disproves this: no assignment of per-group thresholds can perfectly reproduce all-layer clipping across multiple heterogeneous per-sample gradients.
  • Scale Closes the Accuracy Gap: On smaller models, fine-grained grouping hurts accuracy noticeably (e.g., a ~10% drop from all-layer to layer-wise on ViT-small on CIFAR-100 at $\epsilon=2$). But on large models, this gap shrinks to ~1–2% in vision, vanishes in RoBERTa classification, and actually reverses in GPT-2 text generation, where block-wise clipping outperforms all-layer clipping.
  • Non-Uniform Allocation Beats the Pareto Frontier: Memory usage peaks when backward propagation crosses group boundaries. Designing non-uniform partitions that equalize memory peaks achieves near-optimal accuracy while slashing peak VRAM.

Key Results

  • Memory vs. Accuracy Trade-Off (Vision): On CIFAR-100 ($\epsilon = 2$) with ViT-large:
  • All-layer ($M=1$): 89.59% accuracy at 23.52 GB peak memory.
  • Uniform $M=2$: 88.36% accuracy at 21.89 GB.
  • Non-uniform $M=2$: 88.89% accuracy at 21.75 GB (recovering accuracy while cutting VRAM).
  • Memory Reductions (NLP): On QNLI ($\epsilon = 3$) with RoBERTa-base:
  • All-layer ($M=1$): 86.91% accuracy at 15.75 GB.
  • Uniform $M=2$: 86.22% accuracy at 12.22 GB (saving >3.5 GB peak VRAM with minimal accuracy degradation).
  • Generative Language Modeling: Fine-tuning GPT-2 large on E2E ($\epsilon = 3$):
  • Block-wise clipping ($M=36$) achieved 65.23 BLEU / 8.467 NIST, outperforming all-layer clipping (64.18 BLEU / 7.937 NIST).

Limitations and Future Work

  • Combinatorial Grouping Search: The set of valid layer partitions grows according to the Bell number ($>10^{11}$ partitions for 18 layers). The authors rely on coarse, hand-crafted heuristics rather than an automated algorithm to find optimal non-uniform groupings.
  • Threshold Tuning: The study restricts itself to fixed $1/\sqrt{M}$ thresholds to avoid hyperparameter tuning and privacy budgeting overheads, leaving the interaction between optimal grouping and adaptive thresholding partially unaddressed.
  • Parameter-Efficient Regimes: The authors note that extending group-wise clipping to parameter-efficient fine-tuning (PEFT) frameworks (e.g., LoRA, prompt tuning) remains an important, open direction.

Summary updated

BibTeX
@misc{bu2023efficacy,
  author = {Zhiqi Bu and Ruixuan Liu and Yu-Xiang Wang and Sheng Zha and George Karypis},
  title = {{On the efficacy of group-wise clipping in differentially private optimization}},
  year = {2023},
  eprint = {2310.19215},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.19215},
}
Figure