Beyond spectral gap: The role of the topology in decentralized learning

Thijs Vogels, Hadrien Hendrikx, Martin Jaggi

This paper, presented at NeurIPS 2022, identifies a major disconnect between decentralized learning theory and practice. While standard theory suggests that sparse communication requires smaller learning rates to maintain consensus, empirical evidence shows it actually enables larger ones. The authors introduce the "effective number of neighbors" metric, which accurately predicts performance across diverse network topologies where traditional "spectral gap" analysis fails.

TL;DR

The authors show that decentralized averaging speeds up learning primarily by reducing gradient variance, which allows for more aggressive learning rates. They replace the traditional, often misleading "spectral gap" metric with a new "effective number of neighbors" measure that accurately predicts the performance of various communication topologies in deep learning.

What Problem Does This Paper Address?

In decentralized stochastic gradient descent (D-SGD), workers optimize a model by computing local gradients and averaging their parameters with a few neighbors in a communication graph.

Traditional theory for D-SGD has two major flaws when applied to the common setting where all workers share the same data distribution (i.i.d.):

  1. The Learning Rate Paradox: Theory suggests that to keep workers in "consensus" (having similar models), one must use a smaller learning rate than if training alone. In practice, researchers use larger learning rates to get faster convergence.
  2. The Spectral Gap Failure: Performance is usually tied to the "spectral gap" of the graph—a measure of how well-connected it is. Theory predicts that as a ring-shaped network grows, its performance should drop to zero because the spectral gap vanishes. Experiments show the opposite: larger rings actually perform better.

Methods

The authors bridge this gap by shifting the focus from global consensus to variance reduction.

  • Quadratic Toy Model: They first analyze D-SGD on an isotropic quadratic problem, which allows for exact convergence rate calculations. This model mimics the initial, high-noise phase of deep learning.
  • Effective Number of Neighbors ($n_W(\gamma)$): They introduce a new, problem-independent metric. It measures how much a graph topology reduces variance in a "random walk" process where noise is repeatedly added and averaged. Crucially, this metric depends on a decay parameter $\gamma$, which is linked to the learning rate.
  • New Convergence Theory: They provide proofs for smooth (strongly) convex objectives that don't rely solely on the spectral gap. Instead, their analysis considers the entire spectrum of the communication matrix, acknowledging that workers only need to stay close to their "local" neighborhood, not the entire network.

Datasets

The authors validated their theory using:

  • CIFAR-10: Training a VGG-11 model.
  • Fashion MNIST: Training a simple Multi-Layer Perceptron (MLP).
  • Synthetic Quadratics: Used for the initial theoretical derivations and to study the impact of data heterogeneity.

Key Insights and Ideas

  • Averaging as a Variance Buffer: Averaging doesn't just help asymptotically; it reduces gradient noise from the very first step. This lower noise is what "unlocks" the ability to use higher learning rates, leading to the observed speedups.
  • Local Consensus is Sufficient: Forcing every worker in a 1,000-node network to be identical is counter-productive. The paper shows that as long as workers are similar to their nearby neighbors, the optimization succeeds.
  • The Learning Rate/Topology Trade-off: There is a sweet spot for the learning rate. Too small, and you don't benefit from the speedup; too large, and the "cost of consensus" (workers drifting too far apart) outweighs the benefits of noise reduction.
Figure 1: ‘Time to target’ for D-SGD [11] with constant learning rates on an i.i.d. isotropic quadratic dataset (Section 3). The noise disappears at the optimum. Compared to optimizing alone, 32 workers in a ring (left) are faster for any learning rate, but the largest improvement comes from being able to use a large learning rate. This benefit is not captured by current theory, which prescribes a smaller learning rate than training alone. On the right, we see that rings of increasing size enable larger learning rates and faster optimization. Because a ring’s spectral gap goes to zero with the size, this cannot be explained by current theory.

Key Results

  • Predictive Power: The "effective number of neighbors" metric shows a strong correlation with actual training loss in deep learning experiments across diverse topologies (stars, trees, hypercubes, etc.). In contrast, the spectral gap shows almost no correlation.
  • Ring Scaling: The theory correctly predicts that increasing the size of a ring network improves performance up to a saturation point, matching empirical observations and contradicting previous spectral-gap-based theories.
  • Optimal Learning Rates: The new theory prescribes maximum learning rates that are much closer to those used by practitioners. For example, in a 32-worker ring, the optimal learning rate is significantly higher than what a single worker could use.
Figure 6: Cifar-10 training loss vs. metrics. The 'effective number of neighbors' (left) explains relative performance much better than the spectral gap (right).

Limitations and Future Work

  • Convexity Assumptions: While the empirical results hold for deep learning, the formal proofs are currently limited to (strongly) convex objectives. Extending this "local neighborhood" analysis to non-convex landscapes is a key open challenge.
  • Data Heterogeneity: The paper focuses primarily on the i.i.d. case. While the authors provide some initial evidence that their insights hold for "mildly" heterogeneous data, a full theoretical extension to the non-i.i.d. setting is left for future work.

Summary updated

BibTeX
@inproceedings{vogels2022beyond,
  author = {Thijs Vogels and Hadrien Hendrikx and Martin Jaggi},
  title = {{Beyond spectral gap: The role of the topology in decentralized learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=IhOimtH5pa},
}
Figure