Sparsified SGD with Memory

Sebastian U. Stich, Jean-Baptiste Cordonnier, Martin Jaggi

Introduction

In large-scale distributed machine learning, the primary bottleneck is rarely computation—it is communication. Training deep neural networks requires workers to constantly exchange gradient vectors to update model parameters. Because these vectors are typically dense and massive, often spanning millions or billions of dimensions, the communication overhead severely limits scalability.

To mitigate this, researchers frequently employ sparsification. Instead of transmitting the entire gradient, a worker might only send the $k$ largest entries (top-$k$) or $k$ random entries. While this heuristic works surprisingly well in practice, it has historically lacked a solid theoretical foundation. Specifically, simply discarding the small entries of a gradient introduces a biased error that can prevent the model from converging to the true optimum. This paper bridges that gap by providing the first rigorous theoretical analysis of sparsified Stochastic Gradient Descent (SGD) equipped with error compensation, proving that communication can be compressed by orders of magnitude while maintaining the exact same convergence rate as standard, dense SGD.

Methods: Sparsified SGD with Memory (MEM-SGD)

The authors analyze an algorithm called MEM-SGD. The core innovation that makes sparsification theoretically sound is an error compensation (or feedback) mechanism.

Instead of discarding the unsent portions of the gradient, the algorithm stores them locally in a memory vector ($m_t$). During the next iteration, the worker adds the newly computed gradient to this memory and then selects the top-$k$ elements to transmit.

Algorithms for MEM-SGD and its parallel variant, illustrating the local memory update step.

To prove the convergence of this approach, the authors utilize several key technical components:

  • $k$-contraction Operators: A generalized mathematical framework for compression schemes (like top-$k$ or random-$k$) that bounds the compression error.
  • Perturbed Iterate Analysis: The authors define a "virtual" sequence of iterates representing the uncompressed model path, proving that the actual sparsified iterates remain closely bounded to this ideal trajectory.
  • Quadratic Learning Rate Weighting: An averaging scheme for iterates that assigns more weight to later steps, helping achieve the optimal $O(1/T)$ convergence rate.

Key Insights

  • Memory is the "Secret Sauce": Without memory, sparsified SGD is biased and often fails to reach high precision. By using memory, the "ignored" gradient information is merely delayed, not permanently lost.
  • Identical Leading Terms: The most striking theoretical finding is that the leading term in the convergence rate for MEM-SGD is $O(G^2/\mu T)$—exactly the same as vanilla SGD. The compression penalty only affects the lower-order, faster-decaying terms.
  • Top-$k$ vs. Random-$k$: While both approaches are theoretically sound, empirical results show that top-$k$ (sending the largest magnitude entries) consistently outperforms random selection by prioritizing the most informative updates.
  • The Delay Parameter: The theory introduces a shift parameter ($a$) in the learning rate schedule $\eta_t = \gamma / (t + a)$. Setting $a \approx d/k$ (where $d$ is the dimension) is crucial to prevent the initial high learning rate from overwhelming the memory mechanism.

Empirical Results

The authors evaluated MEM-SGD on standard logistic regression benchmarks, including the dense epsilon dataset (400,000 samples, 2,000 features) and the sparse RCV1-test dataset (~677,000 samples, >47,000 features).

Training loss compared against epochs and total communicated data, showing MEM-SGD's massive communication savings over standard SGD and Quantized SGD (QSGD).

The results demonstrate massive communication savings. On the dense epsilon dataset, using top-1 sparsification reduced the total communicated data by a factor of 1,000 ($10^3$) compared to standard SGD, without sacrificing final model accuracy. Furthermore, MEM-SGD significantly outperformed QSGD (Quantized SGD, which reduces bit-precision rather than the number of entries), achieving comparable convergence with two orders of magnitude fewer bits transferred.

Additionally, in multi-core experiments, a lock-free parallel implementation of MEM-SGD scaled linearly with the number of cores, mirroring the efficiency of "Hogwild!" but with vastly lower memory bandwidth requirements.

Limitations and Future Work

While groundbreaking, the theoretical proofs in this paper rely on the assumption of strongly convex and smooth functions. Although MEM-SGD is widely applicable to non-convex deep learning tasks in practice, formal convergence proofs for those settings remain open. Additionally, while the authors provide a theoretical heuristic for the learning rate shift parameter ($a \approx d/k$), finding the optimal value in practice may require tuning. Finally, extending the perturbed iterate analysis to fully asynchronous, distributed settings is a promising direction for future research.

Summary updated

BibTeX
@inproceedings{stich2018sparsified,
  author = {Sebastian U. Stich and Jean-Baptiste Cordonnier and Martin Jaggi},
  title = {{Sparsified SGD with Memory}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2018},
  url = {https://openreview.net/forum?id=B1EpHub_br},
}
Figure