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

Thijs Vogels, Hadrien Hendrikx, Martin Jaggi

In the world of distributed machine learning, "decentralized" training (D-SGD) is often seen as the scrappy underdog to centralized training. Instead of every worker talking to a central server, they only communicate with their immediate neighbors in a graph. For years, the gold standard for measuring how well these graphs perform was the spectral gap—a mathematical value representing how quickly information spreads across the entire network.

However, a new paper from researchers at EPFL argues that the spectral gap is a misleading metric that fails to explain why decentralized learning actually works in the real world. This work reveals that traditional decentralized learning theory is too pessimistic: it incorrectly suggests that sparse networks require smaller learning rates than training alone. By introducing a new metric called the "effective number of neighbors," the authors prove that decentralized averaging actually enables larger learning rates and faster convergence, even in infinite graphs where the spectral gap is zero.

The Problem: Disconnects with Reality

In data-parallel optimization, the goal of collaboration is simple: by averaging gradients or models, workers reduce noise (variance), which allows them to use a larger learning rate and train faster.

Existing theory for D-SGD relies heavily on the spectral gap of the communication graph. This creates two major disconnects with reality:

  1. The Learning Rate Paradox: Current theory suggests that as a graph becomes sparser (like a large ring), you must decrease your learning rate to maintain consensus. In practice, researchers find they can use larger learning rates when collaborating than when training alone.
  2. The Infinite Graph Failure: For an infinitely large ring graph, the spectral gap is zero. Traditional theory predicts such a system would never converge. Yet, empirically, workers in large rings still benefit significantly from their immediate neighbors and converge just fine.
Empirical performance vs. theoretical predictions for decentralized learning rates.

The authors set out to find a theory that matches the empirical "aha!" moment: you don't need the whole world to agree (global consensus); you just need to be in sync with your local neighborhood.

A New Metric: Effective Number of Neighbors

The researchers approached the problem by moving away from the spectral gap and defining a new, problem-independent metric: the "effective number of neighbors" ($n_W$).

This value measures how much a "random walk" process on the graph reduces variance. It captures the benefit of multi-hop connections without requiring global consensus. By analyzing D-SGD on isotropic random quadratics, they could see precisely how the graph topology influences the maximum stable learning rate.

The effective number of neighbors metric across different graph topologies.

Building on this, they developed a new convergence proof for smooth (strongly) convex objectives. Unlike previous proofs, this one uses a "local closeness" matrix that accounts for workers being close to their neighbors, even if they are far from the global average.

Key Insights and Results

The paper validates its theoretical findings using synthetic data (isotropic random quadratics) and deep learning benchmarks (training a VGG-11 on CIFAR-10 across 32 workers using various topologies).

  • Local Consensus is Enough: Enforcing global consensus is counter-productive. If you force every worker to stay close to the global average, you have to slow down the learning rate. If you only care about local neighborhoods, you can train much faster.
  • The Spectral Gap is Not Predictive: The authors show that a "Star" graph has a better spectral gap than a "Ring," yet the Ring performs better in deep learning tasks. The spectral gap is a global worst-case bound; it ignores the local variance reduction that actually drives performance.
  • Collaboration = Variance Reduction: Even sparse averaging reduces gradient noise from the very first step. This noise reduction is what "unlocks" the ability to use higher learning rates.
  • Predictive Power: The new effective neighbors metric correlates strongly with actual training loss across a wide variety of topologies. The spectral gap, by comparison, shows almost no correlation with performance.
  • Matching Centralized Performance: The theory accurately describes how different topologies (like a 4x8 Torus or a Hypercube) can support learning rates nearly as large as a fully connected (centralized) graph, despite having much lower communication overhead.

Limitations and Future Work

While this paper takes a massive step forward in understanding decentralized optimization, a few frontiers remain. The primary analysis assumes workers sample from the same data distribution (i.i.d.). Extending this "local analysis" to heterogeneous data is a key next step. Furthermore, while the formal proofs are for convex functions, the deep learning experiments are non-convex. Bridging this theoretical gap for non-convex landscapes remains a known challenge in the field.

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