Abstract
Due to the high communication overhead when training machine learning models in a distributed environment, modern algorithms invariably rely on lossy communication compression. However, when untreated, the errors caused by compression propagate, and can lead to severely unstable behavior, including exponential divergence. Almost a decade ago, Seide et al. [2014] proposed an error feedback (EF) mechanism, which we refer to as EF14, as an immensely effective heuristic for mitigating this issue. However, despite steady algorithmic and theoretical advances in the EF field in the last decade, our understanding is far from complete. In this work, we address one of the most pressing issues. In particular, in the canonical nonconvex setting, all known variants of EF rely on very large batch sizes to converge, which can be prohibitive in practice. We propose a surprisingly simple fix which removes this issue both theoretically and in practice: the application of Polyak's momentum to the latest incarnation of EF due to Richtárik et al. [2021] known as EF21. Our algorithm, for which we coin the name EF21-SGDM, improves the communication and sample complexities of previous error feedback algorithms under standard smoothness and bounded variance assumptions, and does not require any further strong assumptions such as bounded gradient dissimilarity. Moreover, we propose a double momentum version of our method that improves the complexities even further. Our proof seems to be novel even when compression is removed from the method, and as such, our proof technique is of independent interest in the study of nonconvex stochastic optimization enriched with Polyak's momentum.
Introduction
In distributed and Federated Learning, the "communication bottleneck" remains a primary obstacle to scaling model training. To mitigate this, researchers employ lossy compression techniques—such as Top-$K$ sparsification or quantization—to reduce the volume of data transmitted between clients and the central server. While effective at saving bandwidth, these techniques introduce compression errors. If these errors are not managed, they accumulate over iterations, potentially leading to model divergence.
The standard remedy is Error Feedback (EF), a mechanism that tracks compression errors and reintroduces them into subsequent update steps. While the recent EF21 algorithm significantly advanced the theoretical foundations for full-gradient descent, its application to stochastic gradients (SGD) remained problematic. Specifically, to guarantee convergence in stochastic settings, EF21 required "mega-batches"—sampling thousands of data points per step—which is often impractical in resource-constrained environments or applications like Reinforcement Learning. Furthermore, previous theoretical guarantees often relied on restrictive assumptions, such as "Bounded Gradients," which rarely hold in complex, real-world non-convex landscapes.
Methodology: The Momentum Fix
This paper proposes a mathematically elegant solution to the mega-batch problem: the integration of Polyak’s Momentum (the Heavy Ball method) into the error feedback loop.
EF21-SGDM
The primary algorithm, EF21-SGDM, incorporates a momentum estimator directly into the EF21 framework. Rather than compressing raw, noisy stochastic gradients, the clients maintain a momentum buffer. This buffer serves as a temporal smoother, effectively reducing the variance of the updates before they undergo compression and transmission. This stabilization allows the algorithm to function reliably even with a batch size as small as $B=1$.
EF21-SGD2M
To further optimize performance, the authors introduce a double momentum variant, EF21-SGD2M. By employing two distinct momentum steps, the algorithm achieves superior sample complexity in the non-asymptotic regime, which is critical for the early stages of training where rapid progress is essential.
Theoretical Framework
The core contribution of this work is a novel theoretical analysis. The authors developed a specialized Lyapunov function to track the "energy" of the system. This mathematical tool simultaneously accounts for three critical factors: the objective function value, the momentum estimation error, and the compression error. This approach allows for convergence proofs under standard smoothness and bounded variance assumptions, moving away from the restrictive "Bounded Gradient Dissimilarity" required by previous methods.
Experimental Validation
The effectiveness of EF21-SGDM was evaluated across several benchmarks:
- Synthetic Quadratics: Used to demonstrate stability. While standard EF21-SGD diverged immediately when using small batch sizes, EF21-SGDM converged smoothly to the optimum.
- MNIST and real-sim: Validated the method on classic classification and large-scale logistic regression tasks.
- CIFAR-10 with ResNet-18: Demonstrated the algorithm's utility in deep learning. EF21-SGDM achieved a test accuracy of 83.3%, outperforming both standard SGD (81.5%) and previous error-feedback variants while maintaining the same communication budget.
Key Insights
- Momentum as a Stabilizer: Beyond its traditional role in accelerating training, momentum here acts as a vital variance reduction tool that stabilizes biased updates inherent in error feedback.
- Linear Speedup: The method achieves a linear speedup relative to the number of nodes ($n$). Doubling the number of workers effectively halves the stochastic portion of the training time, a property previously elusive in error-feedback analysis.
- Optimal Complexity: EF21-SGDM reaches an asymptotic sample complexity of $\mathcal{O}(\sigma^2 n^{-1} \epsilon^{-4})$, matching the best-known rates for non-compressed SGD while providing the benefits of communication compression.
Conclusion and Future Work
EF21-SGDM successfully bridges the gap between the theoretical benefits of error feedback and the practical constraints of small-batch stochastic training. While the method introduces a slight memory overhead (requiring the storage of momentum and error states), the gains in stability and communication efficiency are substantial. Future research may extend this momentum-based stabilization to other biased optimization techniques, such as gradient clipping, adaptive step sizes (e.g., Adam), or bidirectional compression schemes.
Summary updated