Distributed Mean Estimation with Optimal Error Bounds

Dan Alistarh, Saleh Ashkboos, Peter Davies

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 $\mu = \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 $\mu$, but $\mu$ 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.

Introduction

Distributed Mean Estimation (DME) is a cornerstone of modern distributed machine learning. In a typical setup, $n$ worker nodes compute local gradients or vectors and must communicate them to a central server to determine the global average. As model sizes grow, the communication overhead of sending high-dimensional vectors (often in the millions of dimensions) becomes a primary bottleneck.

To mitigate this, researchers have historically relied on quantization—reducing the precision of vectors to save bits. However, existing methods like Quantized SGD (QSGD) suffer from a significant theoretical and practical limitation: their error bounds are tied to the norm of the input vectors (their distance from the origin). This paper demonstrates that this "origin bias" is unnecessary. By leveraging lattice theory, we provide a method where the estimation error depends only on the variance between inputs, allowing for significantly more efficient communication when data is clustered far from the origin.

The Problem: The Origin Bias

In many distributed optimization scenarios, such as parallel SGD, the vectors $x_v$ held by different machines are often very close to one another but may have a large absolute magnitude. Standard quantization techniques round each vector relative to the origin $(0,0, \dots, 0)$. If the vectors are clustered around a distant point, the quantization grid must be large enough to encompass the distance from the origin, leading to high quantization noise.

This paper asks: Why should our error depend on the distance from the origin if the machines already have a rough idea of where the mean should be? By shifting the focus from absolute norms to the distance between inputs, we can achieve much tighter error bounds for the same communication budget.

Methodology: Lattice-Based Quantization

The core of our approach is a shift from simple scalar quantization to high-dimensional Lattice-Based Quantization. Lattices provide a more efficient way to pack space than the standard coordinate-wise grids used in previous work.

1. Lattice Rounding and Coloring

Instead of rounding each coordinate independently, our algorithm rounds vectors to the nearest point in a high-dimensional lattice. Because a lattice contains an infinite number of points, we cannot simply send a point's index. Instead, we employ a lattice coloring scheme. Multiple lattice points are assigned the same "color" (a short bit-string).

2. Proximity-Based Decoding

The receiver (server) decodes the message by identifying the lattice point that matches the received color and is closest to a local estimate of the mean. This works effectively because, in iterative processes like SGD, the server usually has a good prior estimate from the previous timestep.

3. RobustAgreement

To ensure the system is robust to poor initial estimates of the data's spread, we introduce RobustAgreement. This is an error-detection loop that iteratively increases the bit-rate until the decoding is successful, ensuring that the algorithm remains stable even when the variance is higher than expected.

4. Practical Implementation: LQSGD

While optimal lattices (like the Leech lattice) are theoretically superior, they are computationally expensive in high dimensions. We propose LQSGD, a practical variant that uses a standard cubic lattice combined with a random rotation (via the Walsh-Hadamard Transform). This approach is computationally efficient and remains near-optimal, losing only a logarithmic factor in dimension $d$.

Key Insights

  • Variance-Centric Estimation: DME is fundamentally about reducing variance. By centering the quantization around the data rather than the origin, we achieve a "one-shot" centering effect that significantly improves precision.
  • Information-Theoretic Optimality: We prove that the communication-to-error trade-off of our lattice-based method is asymptotically optimal, matching the lower bounds for this problem class.
  • Sublinear Communication: Our framework allows for communication using sublinear bits relative to the dimension $d$ if the user is willing to accept higher variance, a property rarely achieved in high-dimensional estimation.

Experimental Results

We evaluated our method across synthetic benchmarks and real-world datasets, including ImageNet (ResNet18) and CIFAR-100 (ResNet20).

  • Variance Reduction: In Least-Squares Regression experiments, LQSGD was the only method to achieve true variance reduction at low bitrates, where the output variance was lower than the variance of the individual inputs.
  • Neural Network Training: When using 4 bits per entry, LQSGD consistently outperformed QSGD and PowerSGD in validation accuracy on both ImageNet and CIFAR-100.
  • Power Iteration: The method showed dramatic improvements in finding principal eigenvectors. In power iteration, the distance between inputs is often orders of magnitude smaller than the vector norms, making our origin-independent approach particularly effective.

Conclusion and Future Work

By breaking the dependency on input norms, lattice-based quantization sets a new standard for distributed mean estimation. Our results show that focusing on the relative distance between data points rather than their absolute position allows for more efficient and accurate distributed learning.

Future research will explore the application of these techniques in Federated Learning, where data heterogeneity and non-centered distributions make origin-independent estimation even more critical. Additionally, finding computationally efficient approximations for even higher-performing lattices remains an open and promising challenge.

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 $\mu = \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 $\mu$, but $\mu$ 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{alistarh2021distributed,
  author = {Dan Alistarh and Saleh Ashkboos and Peter Davies},
  title = {{Distributed Mean Estimation with Optimal Error Bounds}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=t86MwoUCCNe},
}

Loading related content...

Figure