$z$-SignFedAvg: A Unified Stochastic Sign-based Compression for Federated Learning

Zhiwei Tang, Yanmeng Wang, Tsung-Hui Chang

TL;DR

$z$-SignFedAvg introduces a unified noisy perturbation framework for sign-based gradient compression in Federated Learning (FL). It is the first sign-based method to support multiple local updates (FedAvg-style) while achieving convergence rates that can match uncompressed algorithms, effectively overcoming the divergence issues typically seen with sign-based methods on heterogeneous data.

What Problem Does This Paper Address?

Federated Learning requires frequent communication between a central server and many clients, which becomes a massive bottleneck when training large-scale models. To save bandwidth, researchers use sign-based compression, which reduces each gradient coordinate to a single bit (1 or -1).

However, sign-based methods like SignSGD have a fatal flaw: they often diverge when clients have heterogeneous data (non-i.i.d. settings). While "stochastic" sign methods and "error-feedback" techniques have been proposed to fix this, they generally suffer from slow convergence rates and do not allow for multiple local SGD updates—a key feature of the popular FedAvg algorithm that further reduces communication frequency. This paper aims to bridge the gap between extreme 1-bit compression and the high performance of FedAvg.

Methods

The authors propose a novel noisy perturbation scheme using a general symmetric noise distribution, termed the $z$-distribution.

  1. The $z$-Distribution: This is a family of distributions parameterized by $z$. When $z=1$, it is a standard Gaussian distribution; as $z \to \infty$, it converges to a uniform distribution on $[-1, 1]$.
  2. $z$-SignFedAvg Algorithm: Instead of taking the sign of the raw gradient, clients perform $E$ local SGD steps, inject a specific amount of $z$-distributed noise, and then take the sign of the accumulated update.
  3. Asymptotic Unbiasedness: The core mathematical insight is that by injecting noise $\sigma\xi_z$ before the sign operation, the compressed update becomes an asymptotically unbiased estimator of the true update as the noise scale $\sigma$ increases.
  4. Plateau Criterion: To avoid the tedious manual tuning of the noise scale $\sigma$, the authors introduce an adaptive strategy that increases noise whenever the objective function stops improving, similar to how learning rates are often decayed.

Datasets

The authors evaluated their approach on several standard benchmarks:

  • Synthetic Consensus Problem: A simple 10-client setup to verify theoretical convergence properties.
  • MNIST: Used in an "extremely non-i.i.d." setting where each client only holds data for a single digit.
  • EMNIST: A larger-scale federated dataset with 3,579 clients.
  • CIFAR-10: Partitioned among 100 clients using a Dirichlet distribution to simulate data heterogeneity.

Key Insights and Ideas

  • Noise as a Bias Controller: Traditionally, noise is seen as a nuisance or a tool for privacy. Here, it is a control knob for compression bias. Injecting the right amount of noise "smooths" the sign operator, making it behave more linearly in expectation.
  • Unification of Existing Methods: The $z$-distribution provides a single framework to understand previous stochastic sign methods. It shows that Gaussian and uniform noise are just two points on a spectrum of possible perturbation schemes.
  • Matching Uncompressed Rates: The most surprising theoretical result is that with uniform noise ($z=\infty$), $z$-SignFedAvg can achieve the same $O(\tau^{-1/2})$ convergence rate as uncompressed FedAvg, provided the noise scale is large enough. This suggests that 1-bit compression doesn't inherently require a slower convergence rate.
  • Linear Speedup: The paper proves that $z$-SignFedAvg achieves linear speedup with respect to the number of clients, a property previously unproven for sign-based methods in heterogeneous settings.

Key Results

  • Convergence Speed: In non-i.i.d. MNIST tests, $z$-SignFedAvg (specifically 1-SignSGD and $\infty$-SignSGD) significantly outperformed existing biased methods like Error-Feedback (EF-SignSGD) and previous stochastic sign methods.
  • Communication Efficiency: As shown in Figure 3(c), the proposed algorithms reach high test accuracy with orders of magnitude fewer bits transmitted compared to uncompressed SGD.
  • Local Update Benefit: Experiments on EMNIST (Figure 4) and CIFAR-10 (Figure 5) demonstrate that $z$-SignFedAvg successfully inherits the benefits of multiple local steps ($E > 1$), accelerating convergence in terms of communication rounds.
Performance of various SignSGD algorithms on non-i.i.d MNIST. The proposed methods (1-SignSGD and $\infty$-SignSGD) converge much faster and reach higher accuracy than vanilla SignSGD or Sto-SignSGD.

Limitations and Future Work

  • Noise Scale Sensitivity: While the Plateau criterion helps, the performance of the algorithm is still sensitive to the initial noise scale $\sigma$. If $\sigma$ is too small, the algorithm may still diverge on highly heterogeneous data.
  • Assumption on Gradient Noise: The theoretical proofs for $z < \infty$ require a bounded higher-order moment of the minibatch gradient noise (Assumption 2), which might be stronger than the standard bounded variance assumption.
  • Downlink Compression: This paper focuses on uplink compression (client to server). The authors note that future work could integrate downlink compression to further reduce the total communication cost.
  • Privacy Integration: While the authors propose a Differentially Private (DP) variant, a deeper exploration of the inherent privacy-utility tradeoff when using noise for both compression and DP is a promising research direction.

Summary updated

Abstract

Federated Learning (FL) is a promising privacy-preserving distributed learning paradigm but suffers from high communication cost when training large-scale machine learning models. Sign-based methods, such as SignSGD \cite{bernstein2018signsgd}, have been proposed as a biased gradient compression technique for reducing the communication cost. However, sign-based algorithms could diverge under heterogeneous data, which thus motivated the development of advanced techniques, such as the error-feedback method and stochastic sign-based compression, to fix this issue. Nevertheless, these methods still suffer from slower convergence rates. Besides, none of them allows multiple local SGD updates like FedAvg \cite{mcmahan2017communication}. In this paper, we propose a novel noisy perturbation scheme with a general symmetric noise distribution for sign-based compression, which not only allows one to flexibly control the tradeoff between gradient bias and convergence performance, but also provides a unified viewpoint to existing stochastic sign-based methods. More importantly, the unified noisy perturbation scheme enables the development of the very first sign-based FedAvg algorithm ($z$-SignFedAvg) to accelerate the convergence. Theoretically, we show that $z$-SignFedAvg achieves a faster convergence rate than existing sign-based methods and, under the uniformly distributed noise, can enjoy the same convergence rate as its uncompressed counterpart. Extensive experiments are conducted to demonstrate that the $z$-SignFedAvg can achieve competitive empirical performance on real datasets and outperforms existing schemes.
BibTeX
@inproceedings{tang2024z,
  author = {Zhiwei Tang and Yanmeng Wang and Tsung-Hui Chang},
  title = {{$z$-SignFedAvg: A Unified Stochastic Sign-based Compression for Federated Learning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i14.29454},
}
Figure