Hyper-Sphere Quantization: Communication-Efficient SGD for Federated Learning

Xinyan Dai, Xiao Yan, Kaiwen Zhou, Han Yang, Kelvin Kai Wing Ng, James Cheng, Yu FanarXiv 2019

TL;DR

This paper introduces Hyper-Sphere Quantization (HSQ), a novel gradient compression technique for federated learning that significantly reduces communication costs. HSQ achieves a new state-of-the-art per-iteration communication cost of $O(\log d)$ while maintaining convergence, making federated learning more accessible and efficient.

What Problem Does This Paper Address?

Federated learning (FL) enables training machine learning models across decentralized devices (like smartphones) without centralizing sensitive user data. However, a major hurdle in FL is the high cost of communicating model gradients between these devices and a central server. The limited bandwidth of user devices makes this communication a significant bottleneck, often leading to slow training or preventing users with less bandwidth from participating. Existing gradient compression methods, while effective in data centers with high-speed networks, are not sufficiently efficient for the stringent requirements of FL. The paper aims to bridge this gap by developing a communication-efficient gradient compression method specifically tailored for federated learning.

Methods

The core innovation of this paper is Hyper-Sphere Quantization (HSQ), a general framework for gradient compression. Unlike previous methods that quantize individual gradient elements or rely on sparsity, HSQ quantizes the entire gradient vector (or segments of it) using a shared vector codebook.

Here's how it works:

  • Vector Codebook: A codebook $C$ of $m$ unit-norm vectors (codewords) is shared between the server and clients.
  • Approximation: A gradient segment $g$ is approximated by a tuple $(\tilde{u}, c)$, where $c$ is a codeword from the codebook and $\tilde{u}$ is a quantized "pseudo-norm" representing the magnitude along that codeword's direction. The approximated gradient is then $\tilde{g} = \tilde{u}c$.
  • Trade-offs: HSQ offers a continuum of trade-offs between communication efficiency and gradient accuracy by adjusting parameters like the segment length ($d'$) and the number of quantization levels for the pseudo-norm ($s$).
  • Variants: The paper proposes two variants:
  • Unbiased-HSQ: Selects codewords probabilistically to ensure the gradient approximation is unbiased.
  • Greedy-HSQ: Selects the codeword with the highest correlation to the gradient, which is biased but often performs better empirically.
  • Theoretical Guarantees: The authors provide theoretical convergence proofs for both convex and non-convex objective functions under their proposed framework.

Datasets

The paper evaluates HSQ on several standard datasets for image classification:

  • ImageNet (ILSVRC-12): Used for experiments on data-center-based distributed training.
  • CIFAR-10, CIFAR-100: Used for evaluating compression ratios and convergence accuracy.
  • Fashion MNIST: Used for federated learning simulations.
  • VGG19, ResNet50, ResNet101: These are the neural network architectures trained on the datasets.

Key Insights and Ideas

  • Vector Quantization for Gradients: The paper demonstrates that vector quantization (VQ) techniques, traditionally used for data compression and similarity search, can be effectively adapted for gradient compression in machine learning, opening up new avenues for research.
  • Continuum of Trade-offs: HSQ's configurable nature allows for a flexible balance between communication cost and accuracy, making it adaptable to various federated learning scenarios and device capabilities.
  • Federated Learning Advantage: The paper highlights that the large number of devices in FL makes averaging out gradient variance more feasible. This allows for more aggressive compression (higher communication efficiency) with HSQ, as the impact of increased gradient variance can be mitigated by aggregating more noisy gradients.
  • Greedy vs. Unbiased: While Unbiased-HSQ has theoretical guarantees, the Greedy-HSQ variant, despite being biased, often shows superior empirical performance, suggesting that practical convergence can be achieved with a slightly biased but more accurate approximation.

Key Results

  • Communication Cost Reduction: HSQ achieves a per-iteration communication cost of $O(\log d)$ at its highest compression ratio, a significant improvement over the $O(\sqrt{d} \log d)$ of previous state-of-the-art methods like QSGD.
  • Accuracy Preservation: Experiments show that HSQ significantly reduces communication costs while maintaining competitive convergence accuracy. For example, on Fashion MNIST, HSQ with $d=256$ reduced SGD's communication cost by approximately 585x with only a 0.8% loss in final classification accuracy.
  • Performance on Benchmarks: HSQ demonstrated strong performance on VGG19 and ResNet50/101, often outperforming baselines like SGD, SignSGD, TernGrad, and QSGD in terms of both compression ratio and convergence accuracy.
  • Data-Center Performance: HSQ also showed benefits in data-center distributed training, reducing per-epoch time by 14.4% on ILSVRC-12 with minimal degradation in final accuracy.

Limitations and Future Work

  • Codebook Generation: While the paper discusses codebook generation (e.g., using K-means), it notes that obtaining gradients for codebook learning before training starts is a challenge. The paper suggests using standard orthonormal bases or random Gaussian vectors as practical alternatives.
  • Theoretical vs. Empirical: While Unbiased-HSQ has theoretical convergence guarantees, Greedy-HSQ, which performs better empirically, has a more complex theoretical analysis due to its biased nature.
  • Future Work: The authors suggest that the rich literature on vector quantization techniques could inspire further research in gradient compression. They also mention that practical federated learning scenarios with even more users might allow for even larger compression ratios (larger $d$) than tested in their simulations. The paper also notes that while the coordinator typically transmits uncompressed model updates, HSQ can also be used for this purpose with minimal accuracy degradation.

Summary updated

BibTeX
@misc{dai2019hyper,
  author = {Xinyan Dai and Xiao Yan and Kaiwen Zhou and Han Yang and Kelvin Kai Wing Ng and James Cheng and Yu Fan},
  title = {{Hyper-Sphere Quantization: Communication-Efficient SGD for Federated Learning}},
  year = {2019},
  eprint = {1911.04655},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.04655},
}
Figure