Unbiased Gradient Estimation through Stochastic Rounding

This direction is merged into another direction: stochastic rounding. Its last version stays readable and citable here.

Version 1 of 126 papers28 conceptsfrozen 2026-10-04

When training modern deep learning models, we are constantly fighting a war against precision. To speed up training or fit larger models into memory, we want to use fewer bits—moving from 32-bit floats to 16-bit (BF16), 8-bit, or even binary representations.

However, standard rounding (rounding to the nearest representable number) creates a "stalling" problem. If an optimizer calculates a weight update of $0.001$, but the hardware can only represent increments of $0.01$, the update is rounded to zero. Do this a thousand times, and the model learns nothing, even though the cumulative update should have been $1.0$.

Stochastic Rounding (SR) solves this by turning rounding into a probabilistic act. Instead of always rounding $0.001$ to $0$, we round it to $0.01$ with a 10% probability and to $0$ with a 90% probability.

The Power of Unbiased Estimation

The core intuition behind why this works is the concept of the unbiased estimator. As noted by Petros Drineas and Ilse C. F. Ipsen in Stochastic Rounding 2.0, SR ensures that the expected value of the rounded number is exactly equal to the original high-precision value.

Mathematically, if we are rounding a value $x$ to the nearest neighbors $q_1$ and $q_2$: $$E[SR(x)] = x$$

This property is transformative for optimization. In Training Quantized Nets: A Deeper Understanding, Hao Li and colleagues demonstrate that while deterministic rounding causes training to stall in non-convex landscapes, SR allows the network to perform a "greedy search." Because the errors are random and zero-mean, they don't accumulate into a systematic bias. Over thousands of iterations, the "signal" of the small updates survives the "noise" of the quantization.

Breaking the Communication Bottleneck

This principle isn't just for saving memory on a single chip; it is the foundation of efficient distributed training. In large-scale systems, GPUs spend more time "talking" (sharing gradients) than "thinking" (computing).

Dan Alistarh and his team introduced QSGD (Quantized Stochastic Gradient Descent), which uses stochastic quantization to compress gradients before they are sent over the network. Because the compressed gradients remain unbiased estimators of the true gradients, the authors prove that the model converges with the same mathematical guarantees as full-precision SGD.

Later iterations of this idea, such as Global-QSGD by Jihao Xin and Samuel Horváth, adapt this to work with Allreduce, the standard communication primitive used in data centers, enabling massive speedups without sacrificing accuracy.

Scaling to Large Language Models

The most recent frontier for this research is the training of Large Language Models (LLMs). Traditionally, LLMs require "mixed-precision" training, where a high-precision master copy of the weights is kept to avoid the stalling problem.

In Stochastic Rounding for LLM Training, Kaan Ozkara and Tao Yu show that by using SR in the optimizer update step, models can be trained entirely in 16-bit (BF16). This removes the need for 32-bit "shadow weights," reducing memory usage by 30% and significantly increasing throughput. The stochasticity allows the optimizer to "feel" the weight updates that are smaller than the smallest representable BF16 value.

Beyond Simple Rounding: Dithering and Noise

The idea of using randomness to preserve signal has several facets across the literature:

  • Dithering: Simon Wiedemann and Temesgen Mehari propose Dithered Backprop, adding uniform noise before quantization. This induces sparsity (up to 92%) while maintaining an unbiased error distribution.
  • Sign-based Compression: In federated learning, where data is often heterogeneous, simple sign-based compression (sending only the direction of the gradient) often fails. Zhiwei Tang and Tsung-Hui Chang developed z-SignFedAvg, which injects a specific "z-distribution" of noise to make even 1-bit sign updates asymptotically unbiased.
  • Secure Computation: Even in the realm of privacy, Marcel Keller and Ke Sun found that probabilistic rounding is the key to making Secure Multi-Party Computation match the accuracy of standard training.

Summary

The transition from deterministic to stochastic rounding represents a shift in how we view numerical error. Instead of seeing quantization as a loss of information to be minimized, this research direction treats it as a sampling process. By ensuring that our low-precision samples are unbiased, we allow the inherent robustness of stochastic gradient descent to handle the noise, unlocking the ability to train massive models on increasingly "thin" silicon.

Papers in this version

History & citationVersion 1 · 2026-10-04

Merged into another direction · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_unbiased_gradient_estimation_through_sto_2cbb5475,
  title = {Unbiased Gradient Estimation through Stochastic Rounding},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/unbiased-gradient-estimation-through-stochastic-rounding/rdr_2cbb54758c8946e7b0a0be23ef5e1dae},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-24},
}

This exact version (version 1, frozen text):

@misc{lacuna_unbiased_gradient_estimation_through_sto_2cbb5475_v1,
  title = {Unbiased Gradient Estimation through Stochastic Rounding},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/unbiased-gradient-estimation-through-stochastic-rounding/rdr_2cbb54758c8946e7b0a0be23ef5e1dae/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-24},
}