TL;DR
Local SGD, a popular distributed optimization method, has surprisingly weak theoretical guarantees that are often worse than simple minibatch SGD. This paper provides the first theoretical analysis showing when local SGD can outperform minibatch SGD (for quadratic objectives and in specific regimes for general convex objectives), but crucially, also demonstrates scenarios where it's demonstrably worse, even than a naive "thumb-twiddling" baseline.
What Problem Does This Paper Address?
Training large machine learning models requires distributed optimization. Local SGD (also known as Federated Averaging) is a common approach where multiple workers compute gradients locally for a few steps before synchronizing. Despite its widespread use, its theoretical understanding has lagged. Existing analyses showed that local SGD's error guarantees were often worse than a simpler minibatch SGD strategy, which computes gradients on a larger batch but communicates less frequently. This paper aims to bridge this gap by providing a more nuanced theoretical understanding of local SGD's performance, identifying its strengths and weaknesses compared to minibatch SGD.
Methods
The authors analyze local SGD under a specific computational model where $M$ workers each perform $K$ local SGD steps before averaging their parameters over $R$ communication rounds. This results in a total of $T = KR$ gradient computations per worker.
Key techniques include:
- Quadratic Objectives: They prove that for quadratic functions, local SGD (and an accelerated variant) strictly dominates minibatch SGD and achieves minimax optimality. This is achieved by showing that the averaged iterate of local SGD behaves like $KR$ steps of a single-machine SGD with reduced variance.
- General Convex Objectives: They derive the first theoretical guarantee for local SGD that sometimes improves over minibatch SGD. This occurs in regimes where the number of machines ($M$) is large and the number of local steps ($K$) is comparable to or greater than the number of communication rounds ($R$).
- Lower Bounds: Crucially, they construct a specific objective function and demonstrate through a lower bound that local SGD can indeed perform worse than minibatch SGD in certain regimes (specifically, when $K$ is small relative to $R$). This highlights that the previous "worse than minibatch" results weren't just analytical artifacts.
- Empirical Validation: They validate their theoretical findings with experiments on a logistic regression task, showing the predicted performance differences between local SGD, minibatch SGD, and a "thumb-twiddling" baseline.
Datasets
Not discussed in the paper. The theoretical analysis uses synthetic objective functions (quadratic, piecewise-quadratic) and the empirical evaluation uses a logistic regression task on a constructed dataset of 50,000 points in $\mathbb{R}^{25}$.
Key Insights and Ideas
- Local SGD isn't always better: The common intuition that more local updates must be better is challenged. While local SGD can be superior, there are specific settings where its performance degrades significantly.
- The $K$ vs. $R$ trade-off is critical: The relative values of local steps ($K$) and communication rounds ($R$) are paramount. When $K$ is large relative to $R$, local SGD tends to shine. When $K$ is small, it can falter.
- Minibatch SGD's strength: Minibatch SGD's advantage lies in its ability to compute more accurate gradients, which is beneficial when the number of local steps is limited.
- Quadratic objectives are special: For quadratic functions, the analysis simplifies dramatically, allowing for strong guarantees and minimax optimality for local SGD variants. This is not generally true for non-quadratic objectives.
- A "problematic regime" exists: The paper identifies a regime where local SGD is demonstrably worse than even a simple baseline, suggesting caution is needed when choosing it.
Key Results
- Quadratic Objectives: Local SGD achieves an error bound that scales with $(KR)^{-1}$ (optimization term) compared to minibatch SGD's $R^{-1}$, making it strictly better. An accelerated local SGD variant is shown to be minimax optimal.
- General Convex Objectives:
- An upper bound is derived showing local SGD can outperform minibatch SGD when $M$ is large and $K \ge R$.
- A lower bound demonstrates that local SGD can be worse than minibatch SGD when $K$ is small relative to $R$. The crossover point is roughly between $K < \sqrt{R}$ and $K < R$.
- Empirical Results: Experiments confirm that local SGD can perform worse than minibatch SGD for small $K$ (e.g., $K=5$) but improves as $K$ increases, aligning with theoretical predictions.
Limitations and Future Work
- Tightness of Bounds: The authors acknowledge that their upper and lower bounds for general convex objectives are not yet perfectly tight, with some terms differing by powers of $K$.
- Optimal Algorithm: The paper motivates the development of a new algorithm that could combine the benefits of both local SGD and minibatch SGD to achieve optimal performance across all regimes.
- Non-convex Objectives: The analysis primarily focuses on convex and quadratic objectives. Extending these results to non-convex settings remains an open area.
- Heterogeneous Data: The current analysis assumes i.i.d. data across workers. The behavior of local SGD with heterogeneous data (as in Federated Learning) is a separate, important research direction.
Summary updated