Stability and Generalization of the Decentralized Stochastic Gradient Descent

Tao Sun, Dongsheng Li, Bao WangarXiv 2021

TL;DR

This paper provides the first comprehensive theoretical analysis of stability and generalization for Decentralized Stochastic Gradient Descent (D-SGD). The authors reveal a critical trade-off: while decentralization removes the communication bottleneck of a central server, it inherently deteriorates algorithmic stability, with the degree of "instability" tied directly to the connectivity of the underlying network graph.

What Problem Does This Paper Address?

In the world of large-scale machine learning, Stochastic Gradient Descent (SGD) is the standard tool. While we have a deep understanding of how centralized SGD generalizes—meaning how well a model trained on a specific dataset performs on unseen data—the same cannot be said for its decentralized counterpart, D-SGD.

In D-SGD, multiple "nodes" (like different servers or sensors) train on local data and share their parameters only with immediate neighbors in a network, rather than a central coordinator. While this is faster and more scalable, it introduces a "mixing" challenge: how does the network structure affect the final model's reliability? Before this paper, there were no formal stability or generalization guarantees for D-SGD, leaving researchers to wonder if decentralized models were inherently more prone to overfitting than centralized ones.

Methods

The authors tackle this by reformulating D-SGD as an operator iteration with an added error term that accounts for the decentralized communication. They analyze a general version of the algorithm that includes projections (keeping parameters within a specific feasible set), which is mathematically more challenging but more realistic for many applications.

Key to their analysis is the mixing matrix ($W$), which defines how nodes average their parameters. They characterize the graph's influence using the spectral gap—specifically the second-largest eigenvalue ($\lambda$) of $W$. A smaller $\lambda$ indicates a better-connected graph (like a "Complete" graph), while a $\lambda$ closer to 1 indicates poor connectivity (like a "Cycle" graph).

The paper establishes uniform stability bounds—a measure of how much the model changes if one training example is swapped—across three regimes:

  1. General Convex: Where the loss function is "bowl-shaped."
  2. Strongly Convex: Where the "bowl" has a sharp, well-defined minimum.
  3. Non-convex: The complex landscapes typical of deep learning.

Datasets

The theoretical findings were verified using three distinct benchmarks:

  • Body Fat dataset: Used for linear regression tasks to test the general convex case.
  • ijcnn1 dataset: Used for regularized logistic regression to test the strongly convex case.
  • CIFAR-10: Used with a ResNet-20 architecture to test the non-convex case.

The authors tested these models across six different network topologies, including Random, Star, Cycle, k-NNG, Bipartite, and Complete graphs, to see how network structure influenced stability (see Figure 1 in the paper for these structures).

Graph structures used for testing

Key Insights and Ideas

  • The Decentralization Penalty: The authors prove that D-SGD is inherently less stable than centralized SGD. The stability bound for D-SGD contains an additional term that does not vanish unless the graph is perfectly connected ($\lambda = 0$).
  • Graph Topology is a Hyperparameter: The network structure directly impacts generalization. As shown in Figure 2, better-connected graphs (like "Complete") exhibit much lower absolute loss differences (better stability) than poorly connected ones (like "Cycle").
  • Convexity as a Stabilizer: In strongly convex settings, D-SGD eventually becomes stable regardless of the graph, provided enough iterations occur. However, in general convex settings, the stability can oscillate significantly.
  • Non-convex Chaos: For deep learning models (non-convex), the stability is much worse. The absolute loss difference oscillates "chaotically," suggesting that decentralized deep learning is significantly more sensitive to small changes in training data than convex models.
Figure 2: Comparison of the absolute loss difference un- der different graphs. (a), (b) and (c) correspond to the general convex, strongly convex, and nonconvex cases, respectively. In the strongly convex case, the curves be- come stable after enough iterations for all graphs. In the general convex case, the absolute loss difference oscil- lates and inferior to the strongly convex case. D-SGD performs worst in the nonconvex tests in terms of sta- bility.

Key Results

  • Strongly Convex Stability: The stability bound is $O(\frac{1}{mn} + \frac{1}{1-\lambda})$. This shows that while increasing the total data size ($mn$) helps, the graph structure ($1-\lambda$) sets a fundamental floor for how stable the algorithm can be.
  • General Convex Stability: The bound is $O(\frac{\ln T}{mn} + C_\lambda \ln T)$, where $T$ is the number of iterations. This indicates that stability worsens logarithmically over time.
  • Empirical Divergence: In the convex linear regression tests (Figure 3), the authors found that D-SGD could actually diverge on a Cycle graph if the learning rate was too high, highlighting the practical risks of poor network connectivity.
Stability results for linear regression (convex)

Limitations and Future Work

While this work lays the theoretical foundation, the authors note several open paths:

  • Tightening Bounds: The current bounds for general convex and non-convex cases are relatively loose; future work could aim for tighter estimates.
  • High Probability Bounds: The current results are "in expectation." Proving that these stability guarantees hold with high probability for any single run would be a significant next step.
  • Momentum Variants: Most modern deep learning uses momentum (like Adam). Extending this analysis to decentralized versions of these accelerated algorithms is a clear future direction.

Summary updated

BibTeX
@misc{sun2021stability,
  author = {Tao Sun and Dongsheng Li and Bao Wang},
  title = {{Stability and Generalization of the Decentralized Stochastic Gradient Descent}},
  year = {2021},
  eprint = {2102.01302},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2102.01302},
}
Figure