CosSGD: Communication-Efficient Federated Learning with a Simple Cosine-Based Quantization

Yang He, Hui-Po Wang, Maximilian Zenk, Mario Fritz

TL;DR

This paper introduces CosSGD, a novel cosine-based quantization method for federated learning that significantly reduces communication costs by compressing model weights and gradients. CosSGD achieves this by quantizing values based on their importance (larger magnitudes are quantized more precisely) rather than their distribution, leading to competitive model performance even at very low bitrates.

What Problem Does This Paper Address?

Federated Learning (FL) enables collaborative model training across decentralized devices without sharing private data, addressing privacy and computation concerns. However, a major hurdle in FL is the substantial communication overhead between clients and the server, especially as models grow in complexity. Existing methods for compressing model updates (weights and gradients) through quantization often lead to a significant drop in model performance when using very low bitrates (e.g., 1-bit or 2-bit compression). This paper aims to bridge this gap by developing a quantization technique that achieves high compression ratios while preserving model accuracy.

Methods

The core innovation is a cosine-based nonlinear quantization scheme. Unlike traditional linear quantization that divides the value range uniformly, CosSGD leverages the observation that larger magnitude gradients and weights are more informative for training. It quantizes these important values with finer precision by mapping them to angles derived from their cosine values. This approach is applied to both model weights (server-to-client) and gradients (client-to-server) to reduce round-trip communication. The method is designed to be computationally efficient, requiring minimal additional data for dequantization and no extra training. An unbiased version of the quantization is also proposed, building upon existing probabilistic schemes.

Datasets

  • CIFAR-10: Used for image classification tasks.
  • BraTS 2019: Used for 3D brain tumor semantic segmentation tasks.

Key Insights and Ideas

  • Importance of Magnitude over Distribution: The paper challenges the common assumption that quantization should focus on the distribution of values. Instead, it highlights that the magnitude of gradients/weights is a more critical factor for model performance, and these larger values should be quantized with higher precision.
  • Cosine Function for Non-linearity: The cosine function provides a simple yet effective way to create non-uniform quantization intervals, allowing for more precise representation of important (large magnitude) values.
  • Low-Bit Performance Breakthrough: The research demonstrates that achieving competitive performance with very low bitrates (2-bit and even 1-bit) is possible with their method, overcoming a significant limitation of prior linear quantization techniques.
  • Computational Efficiency: The cosine-based approach is computationally lightweight, making it suitable for resource-constrained edge devices common in FL.

Key Results

  • CosSGD achieves competitive model performance compared to float32 training, even at 2-bit quantization, outperforming previous linear and non-linear methods on CIFAR-10 and BraTS datasets.
  • On CIFAR-10, their 2-bit quantization method achieved comparable results to float32 training, whereas 2-bit linear quantization showed a significant performance gap.
  • The method demonstrated effectiveness in reducing communication costs, achieving very high compression ratios (e.g., over 1000x with extreme compression combined with sparsification).
  • The paper shows that their method can compress model weights with 4-bits quantization while maintaining performance, a feat not achieved by other methods.

Limitations and Future Work

  • Unbiased Quantization Performance: While the paper presents both biased and unbiased versions, the experimental results often highlight the performance of the biased version. The paper notes that unbiased quantization (e.g., Eq. 3) improves performance, but the biased version is used for analysis to understand quantization intervals.
  • Gradient Clipping: The method relies on gradient clipping to obtain the bound $b_v$. The effectiveness and necessity of this step for all scenarios might be a point for further investigation.
  • Future Work: The paper suggests combining their quantization with other techniques like gradient sparsification and lossless data compression (e.g., Deflate) to further reduce communication costs, which they demonstrate in their experiments. The flexibility and compatibility of their method with existing FL frameworks and techniques are also emphasized.

Summary updated

BibTeX
@misc{he2020cossgd,
  author = {Yang He and Hui-Po Wang and Maximilian Zenk and Mario Fritz},
  title = {{CosSGD: Communication-Efficient Federated Learning with a Simple Cosine-Based Quantization}},
  year = {2020},
  eprint = {2012.08241},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2012.08241},
}
Figure