When we train neural networks in low precision—moving from 32-bit floats down to 8-bit or even 4-bit integers—we encounter a fundamental problem: most updates are smaller than the smallest representable difference in the low-precision format. Under standard deterministic rounding (rounding to the nearest neighbor), these tiny gradients are simply rounded to zero. The model stops learning, not because it has converged, but because its "signal" cannot survive the quantization process.
Researchers have found a surprisingly simple solution to this: Stochastic Rounding (SR). By treating rounding as a probabilistic event rather than a deterministic rule, we can preserve the signal of small updates across thousands of iterations.
The Intuition: Unbiasedness over Precision
The core idea behind stochastic rounding is to ensure that the quantization process is an unbiased estimator.
Suppose we want to round a value $x = 0.3$ to the nearest integers, 0 or 1. In deterministic rounding, $0.3$ always becomes $0$. If we perform 1,000 updates of $0.3$, the total change is $0$. However, in stochastic rounding, we round $0.3$ up to $1$ with a $30\%$ probability and down to $0$ with a $70\%$ probability. Over 1,000 updates, we will have roughly 300 ones and 700 zeros. The average update is $0.3$—exactly the original value.
As Daniel Golovin and colleagues noted in Large-Scale Learning with Less RAM via Randomization, this mechanism prevents the systematic error accumulation that plagues low-precision online learning. By ensuring the expected value of the update remains correct, the "noise" introduced by quantization eventually cancels out over time.
Preventing Gradient Stalling
In high-dimensional optimization, gradients often become very small as the model nears a local minimum. Sanjoy Dasgupta and his team demonstrated in Low Precision Streaming PCA that without stochastic rounding, iterative algorithms "stall." When the updates are smaller than the minimum quantization step, deterministic rounding kills the progress entirely. Stochastic rounding allows the algorithm to keep moving, as even a tiny gradient has a non-zero probability of triggering a discrete step.
This is particularly critical in the backward pass of neural network training. Ron Banner and researchers at Intel showed in Scalable Methods for 8-bit Training of Neural Networks that applying SR to gradients allows 8-bit training to match the accuracy of full-precision models. Without it, the "Gradients Bifurcation"—where weights diverge due to rounding bias—destroys the training process.
Scaling to 4-bit Large Language Models
The frontier of this research currently lies in 4-bit training, where the dynamic range is extremely narrow. At this level, even the format of the numbers matters. Brian Chmiel and Daniel Soudry introduced Logarithmic Unbiased Quantization (LUQ) in Accurate Neural Training with 4-bit Matrix Multiplications at Standard Formats, combining logarithmic scaling with SR to handle the wide distribution of gradients in deep networks.
Recent breakthroughs have pushed this even further into the realm of Large Language Models (LLMs). NVIDIA researchers recently demonstrated in Pretraining Large Language Models with NVFP4 that a 12-billion-parameter model could be trained from scratch using 4-bit floating point precision. Similarly, Albert Tseng and his team at AWS AI used SR to achieve "near-lossless" 4-bit training in Training LLMs with MXFP4. In both cases, the probabilistic nature of SR was the "algorithmic safeguard" that prevented the model from diverging over trillions of tokens.
Beyond Backpropagation: Distributed and Zeroth-Order Learning
The utility of stochastic rounding extends beyond standard gradient descent:
- Federated Learning: In distributed settings, communication is the bottleneck. Cong Shen showed in Design and Analysis of Uplink and Downlink Communications for Federated Learning that transmitting weight differentials with SR allows for constant, low-bit quantization without losing convergence.
- Zeroth-Order Optimization: For extremely memory-constrained fine-tuning, Jiajun Zhou proposed QuZO, which uses SR to keep zeroth-order gradient estimators unbiased, enabling LLM fine-tuning with 5.47× less memory.
- Decision Trees: Even non-neural architectures benefit. Yu Shi demonstrated in Quantized Training of Gradient Boosting Decision Trees that SR allows GBDTs to train with 2-bit gradients, providing a massive speedup on hardware.
By shifting our perspective from "how much precision do we need?" to "how can we keep our errors unbiased?", stochastic rounding has turned low-precision training from a lossy compromise into a mathematically sound strategy for scalable AI.