New Bounds For Distributed Mean Estimation and Variance Reduction

Peter Maxwell Davies, Vijaykrishna Gurunanthan, Niusha Moshrefi, Saleh Ashkboos, Dan Alistarh

TL;DR

This paper introduces a novel approach to distributed mean estimation and variance reduction by leveraging lattice theory for quantization. Unlike prior methods that bound errors by input norms, this work establishes bounds based on the distance between inputs, which is more robust when the mean itself has a large norm. This leads to theoretically optimal communication-variance trade-offs and practical improvements in experiments.

What Problem Does This Paper Address?

In distributed machine learning, multiple machines often need to collaboratively estimate a common value, such as the mean of their local data or the average of gradient updates. This process, known as distributed mean estimation (DME) and variance reduction, is crucial for efficient training of large models. A key challenge is minimizing the communication cost between machines while ensuring accurate estimation. Existing methods typically bound the error of the final estimate by the norm of the input vectors. However, this approach performs poorly when the individual input vectors are close to each other but their common mean has a large norm. This scenario is common in practice, leading to suboptimal error bounds. This paper addresses this limitation by developing methods that bound errors based on the variance or distance between inputs, rather than their absolute norms.

Methods

The core innovation of this paper lies in its use of lattice-based quantization. Instead of quantizing individual coordinates independently, the authors map high-dimensional vectors to nearby points on a carefully chosen lattice. This allows for:

  • Lattice Coloring: A novel coloring scheme for lattices is introduced. This scheme ensures that even if multiple lattice points share the same "color" (i.e., are represented by the same bit-string), they are sufficiently far apart. This property is crucial for decoding and error detection.
  • Error Detection: The lattice coloring mechanism enables the detection of decoding errors. If the encoded and decoded vectors are too far apart, the system can identify this and potentially increase the communication precision. This is particularly useful for variance reduction where input distances are probabilistic.
  • Robust Agreement Protocol: A protocol is developed that iteratively attempts quantization and decoding, increasing communication bits if errors are detected, until successful decoding is achieved. This ensures reliable communication even with noisy inputs.
  • Cubic Lattice Extension: To address the computational cost of optimal lattices for $\ell_2$-norm, the authors propose an extension using the standard cubic lattice combined with a random rotation. This provides near-optimal bounds with efficient computation.

Datasets

The paper evaluates its methods on synthetic datasets for:

  • Least-Squares Regression
  • Distributed Power Iteration
  • Neural Network Training (ResNet18 on ILSVRC, ResNet20 on CIFAR-100)

Key Insights and Ideas

  • Input Variance vs. Input Norm: The paper argues that for distributed mean estimation and variance reduction, bounding output error by input variance (or distance between inputs) is more natural and leads to better theoretical guarantees than bounding by input norm, especially when the mean has a large norm.
  • Lattice Theory for Communication: Lattice theory provides a powerful framework for designing efficient and robust quantization schemes. The geometric properties of lattices allow for controlled trade-offs between communication cost and estimation error.
  • Optimal Communication-Variance Trade-offs: The proposed lattice-based methods achieve communication-variance trade-offs that are asymptotically optimal, meaning they are theoretically the best possible.
  • Practicality Matters: While optimal lattices can be computationally expensive, the use of cubic lattices with random rotations offers a practical solution that retains strong theoretical guarantees with efficient computation.

Key Results

  • Theoretical Bounds: The paper establishes new upper and lower bounds for distributed mean estimation and variance reduction. These bounds are shown to be tight and depend on input variance/distance rather than input norm.
  • Algorithm Performance:
    • Mean Estimation: Achieves $O(d \log q)$ communication bits per machine with $O(y^2/q)$ output variance.
  • Variance Reduction: Achieves $O(d \log n)$ communication bits per machine with $O(\sigma^2/n)$ output variance.
  • Sublinear Communication: For $q < 1$, achieves $O(dq)$ communication bits per machine.
  • Experimental Validation: Experiments on various tasks (least-squares, neural network training, power iteration) demonstrate that the proposed LQSGD and RLQSGD methods achieve lower output variance and faster convergence compared to existing methods like QSGD and Hadamard-based schemes, especially when input variance is low relative to input norm. For instance, in Figure 3 and 4, LQSGD is shown to achieve variance reduction, meaning its output variance is lower than the input variance of the batch gradients.

Limitations and Future Work

  • Computational Cost of Optimal Lattices: The paper acknowledges that optimal lattices for $\ell_2$-norm can be computationally prohibitive for high dimensions. The cubic lattice extension offers a practical workaround but introduces a logarithmic factor in the error bound.
  • Sublinear Quantization Implementation: The naive implementation of the sublinear quantization scheme is noted as not computationally feasible for high dimensions. Future work will explore adaptations for efficient implementation.
  • Practical Applications: The authors plan to explore practical applications of their schemes in federated or decentralized distributed learning.

Summary updated

Abstract

We consider the problem of distributed mean estimation (DME), in which $n$ machines are each given a local $d$-dimensional vector $x_v \in \mathbb{R}^d$, and must cooperate to estimate the mean of their inputs $μ= \frac 1n\sum_{v = 1}^n x_v$, while minimizing total communication cost. DME is a fundamental construct in distributed machine learning, and there has been considerable work on variants of this problem, especially in the context of distributed variance reduction for stochastic gradients in parallel SGD. Previous work typically assumes an upper bound on the norm of the input vectors, and achieves an error bound in terms of this norm. However, in many real applications, the input vectors are concentrated around the correct output $μ$, but $μ$ itself has large norm. In such cases, previous output error bounds perform poorly. In this paper, we show that output error bounds need not depend on input norm. We provide a method of quantization which allows distributed mean estimation to be performed with solution quality dependent only on the distance between inputs, not on input norm, and show an analogous result for distributed variance reduction. The technique is based on a new connection with lattice theory. We also provide lower bounds showing that the communication to error trade-off of our algorithms is asymptotically optimal. As the lattices achieving optimal bounds under $\ell_2$-norm can be computationally impractical, we also present an extension which leverages easy-to-use cubic lattices, and is loose only up to a logarithmic factor in $d$. We show experimentally that our method yields practical improvements for common applications, relative to prior approaches.
BibTeX
@inproceedings{davies2021new,
  author = {Peter Maxwell Davies and Vijaykrishna Gurunanthan and Niusha Moshrefi and Saleh Ashkboos and Dan Alistarh},
  title = {{New Bounds For Distributed Mean Estimation and Variance Reduction}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=t86MwoUCCNe},
}
Figure