On the Interaction Between Differential Privacy and Gradient Compression in Deep Learning

Jimmy LinarXiv 2022 · DOI · arXiv

Abstract

In the context of Federated Learning, researchers often face a dual challenge: protecting user privacy and minimizing communication overhead. Traditionally, Differential Privacy (DP) and Gradient Compression (GC) are viewed as independent burdens that both degrade model performance. This paper, based on the research of Jimmy Lin from the University of Toronto, investigates the interaction between these two techniques. The findings reveal a surprising synergy: rather than compounding errors, aggressive gradient compression can act as a variance-reducing regularizer that improves the accuracy of models trained under differential privacy.

Introduction

As machine learning models are increasingly trained on sensitive decentralized data, two technologies have become essential: Differentially Private Stochastic Gradient Descent (DPSGD) and Gradient Compression. DPSGD protects against data leakage by injecting Gaussian noise into gradients, while compression techniques like sparsification or low-rank factorization reduce the bandwidth required for model updates.

Conventional wisdom suggests that combining these techniques would lead to a "double hit" on model utility. However, this research explores the hypothesis that the relationship is more complex. By analyzing the bias-variance trade-off inherent in gradient estimation, this study demonstrates that compression can actually filter out the noise required for privacy, leading to more stable and accurate deep learning outcomes.

Methodology

Compression Techniques

The study focuses on two primary methods of gradient compression:

  1. Deep Gradient Compression (DGC): A sparsification approach that transmits only the most significant gradient values (the top-k residuals).
  2. PowerSGD: A method that treats gradients as matrices and utilizes low-rank factorization to compress the update.

Privacy Mechanism

Privacy is enforced using DPSGD via the Opacus library. This involves clipping individual gradients to a maximum norm ($C$) and adding Gaussian noise scaled by a noise multiplier. The privacy budget is tracked using RDP (Rényi Differential Privacy) and converted to $(\epsilon, \delta)$ guarantees.

The Denoise Algorithm

A novel contribution of this work is the Denoise algorithm. This intermediate processing step utilizes temporal averaging—maintaining a "velocity" or exponential moving average of past gradients—and error feedback. This mechanism is designed to distinguish the persistent underlying gradient signal from the transient, zero-mean Gaussian noise introduced by the DP mechanism.

The Bias-Variance Synergy

The core theoretical insight of the paper is derived from a Bias-Variance Decomposition of the gradient estimation. In a standard non-private setting, compression introduces bias (a systematic deviation from the true gradient). However, in a private setting, the dominant source of error is the variance introduced by the Gaussian noise.

Lin’s research demonstrates that aggressive compression drastically reduces this variance. In high-noise scenarios, the reduction in variance is so significant that it outweighs the added bias, resulting in a lower total Mean Squared Error (MSE) for the gradient update. Essentially, compression acts as a filter that prevents the model from "overfitting" to the privacy noise.

Experimental Results

The study evaluated these interactions across four tasks: language classification (Surnames/LSTM), image classification (CIFAR-10/CNN and CIFAR-100/ResNet-18), and textual entailment (SNLI/BERT).

Key Findings

  • Accuracy Recovery: In the Surnames task, a model trained with high privacy ($\epsilon = 50.92$) achieved a 10.4% increase in accuracy when PowerSGD compression was applied, compared to the uncompressed private version. This confirms that compression can be a utility-enhancing tool in private settings.
  • Denoise Effectiveness: The proposed Denoise algorithm successfully mitigated the negative impacts of DP noise on test accuracy by up to 24.6% and reduced the impact of sparsification by up to 15.1%.
  • Model Scale and Sensitivity: The research found that larger models (BERT and ResNet-18) are disproportionately sensitive to DP noise. In high-dimensional parameter spaces, the noise can become so overwhelming that the model fails to learn, remaining at "random guess" accuracy. This suggests that the benefits of compression are most visible when the model is small enough to converge under the initial noise floor.
  • Optimal Clipping: The study challenges the heuristic of clipping gradients at the median norm. Instead, it suggests that the optimal clipping radius ($C$) must be mathematically balanced against the model's dimensionality and the specific noise multiplier used.

Conclusion and Future Work

This research reframes the relationship between privacy and efficiency. Rather than a zero-sum trade-off, the interaction between Differential Privacy and Gradient Compression offers a unique opportunity for optimization. By aggressively compressing gradients, practitioners can simultaneously reduce bandwidth and improve the accuracy of private models by filtering out injected noise.

Future research directions include exploring the interaction with coordinate-wise quantization and developing adaptive clipping mechanisms that can automatically adjust to the noise-reduction properties of the chosen compression algorithm.

Summary updated

Abstract

While differential privacy and gradient compression are separately well-researched topics in machine learning, the study of interaction between these two topics is still relatively new. We perform a detailed empirical study on how the Gaussian mechanism for differential privacy and gradient compression jointly impact test accuracy in deep learning. The existing literature in gradient compression mostly evaluates compression in the absence of differential privacy guarantees, and demonstrate that sufficiently high compression rates reduce accuracy. Similarly, existing literature in differential privacy evaluates privacy mechanisms in the absence of compression, and demonstrates that sufficiently strong privacy guarantees reduce accuracy. In this work, we observe while gradient compression generally has a negative impact on test accuracy in non-private training, it can sometimes improve test accuracy in differentially private training. Specifically, we observe that when employing aggressive sparsification or rank reduction to the gradients, test accuracy is less affected by the Gaussian noise added for differential privacy. These observations are explained through an analysis how differential privacy and compression effects the bias and variance in estimating the average gradient. We follow this study with a recommendation on how to improve test accuracy under the context of differentially private deep learning and gradient compression. We evaluate this proposal and find that it can reduce the negative impact of noise added by differential privacy mechanisms on test accuracy by up to 24.6%, and reduce the negative impact of gradient sparsification on test accuracy by up to 15.1%.
BibTeX
@misc{lin2022interaction,
  author = {Jimmy Lin},
  title = {{On the Interaction Between Differential Privacy and Gradient Compression in Deep Learning}},
  year = {2022},
  eprint = {2211.00734},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2211.00734},
}
Figure