Stochastic rounding turns rounding errors into a residual: randomized Kaczmarz in low precision
This paper demonstrates that employing stochastic rounding in the low-precision Randomized Kaczmarz method transforms rounding errors into a martingale-driven "rounding residual," thereby achieving an optimal error floor of order without iterative refinement and significantly outperforming traditional round-to-nearest arithmetic in both accuracy and convergence stability.
Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the author. For technical accuracy, refer to the original paper. Read full disclaimer
In the world of high-speed computing, there is a constant tension between speed and accuracy. Modern supercomputers and graphics processors are designed to perform billions of calculations every second, but to keep up with this pace, they often rely on a simplified way of storing numbers. Instead of keeping every tiny detail of a value, these machines use a "low-precision" format that trims away the least significant digits. This is like taking a high-resolution photograph and compressing it into a smaller file: the image looks fine from a distance, but up close, the fine details are gone. This trade-off saves massive amounts of memory and energy, allowing machines to solve complex problems in fields like medical imaging and artificial intelligence much faster. However, there is a catch. When a computer is forced to round off numbers at every single step of a calculation, those tiny errors do not disappear; they pile up. In many mathematical methods used to solve systems of equations, this accumulation of errors eventually causes the calculation to stall, getting stuck at a level of inaccuracy that cannot be improved, no matter how long the computer keeps running.
A researcher at Xuchang University has recently explored a different way to handle these rounding errors, turning a persistent problem into a manageable feature. The study focuses on a specific method called the randomized Kaczmarz algorithm, which is widely used to solve large systems of equations by repeatedly adjusting a guess based on one piece of information at a time. Traditionally, when this method uses low-precision storage with standard rounding rules, it hits a hard ceiling of accuracy. The researcher discovered that by changing how the computer rounds numbers—using a technique called stochastic rounding, where a number is rounded up or down based on a random chance rather than a fixed rule—the nature of the error changes completely. Instead of getting stuck, the calculation continues to fluctuate around the correct answer, and the average of these fluctuations becomes remarkably precise. The study proves that this random approach prevents the errors from accumulating in a way that blocks progress, effectively turning the rounding mistakes into a harmless background noise rather than a barrier.
The core of this discovery lies in how the computer handles the tiny discrepancies that occur when a number is forced into a low-precision format. In the standard method, known as round-to-nearest, the computer always picks the closest available number. If the calculation lands exactly halfway between two options, it follows a fixed rule. Over millions of steps, this deterministic behavior causes the errors to align and reinforce each other, eventually trapping the solution in a local grid point that is slightly off from the true answer. The researcher found that in these scenarios, the calculation stops improving entirely, regardless of how many more steps are taken. By contrast, stochastic rounding introduces a deliberate element of chance. When a number falls between two representable values, the computer flips a coin to decide whether to round up or down, with the probability of each outcome matching how close the number is to either option. This randomness ensures that the errors do not build up in a single direction; instead, they cancel each other out over time.
The study demonstrates that this random rounding transforms the nature of the error. Rather than acting as a blockage, the errors behave like a consistent, unpredictable disturbance that the algorithm can navigate around. The researcher showed that the long-term average of the calculation's distance from the true solution is determined by a specific formula involving the size of the rounding errors and the properties of the system being solved. Crucially, this new approach allows the method to reach an accuracy level that is far superior to the standard method, especially for difficult problems where the equations are tightly coupled or "ill-conditioned." In tests using a 16-bit number format, which is common in modern graphics cards, the standard method produced errors that were twelve times larger than those produced by the stochastic method for the raw calculation steps. When the results were averaged over time, the advantage grew even larger, with the stochastic method being thirty-seven times more accurate.
The research also addressed a practical concern: how much randomness is actually needed to achieve this benefit. Generating random numbers takes time and computational resources, so the researcher investigated whether a small number of random bits would suffice. The findings suggest that for most problems, a surprisingly small amount of randomness is enough. Specifically, the number of random bits required grows very slowly as the difficulty of the problem increases. In the experiments, using just a few extra bits of randomness—roughly the number of bits needed to count up to the square root of the problem's difficulty—was enough to match the performance of an ideal random system. This means that the computational cost of adding this randomness is minimal, making it a highly efficient upgrade for existing hardware.
Furthermore, the study looked at how this method performs when combined with other techniques, such as iterative refinement, where a rough solution is repeatedly polished to improve its accuracy. The researcher found that using stochastic rounding as the engine for the initial rough calculations allowed the refinement process to converge much faster and reach a higher final accuracy than using standard rounding. In one set of tests involving a condition number of 640, the standard method required five refinement steps to reach the limit of accuracy, while the stochastic method reached the same limit in just three steps. In even more difficult scenarios, the standard method failed to reach the limit even after six steps, whereas the stochastic method succeeded.
The paper also examined how these findings hold up in real-world applications, such as reconstructing images from medical scans. In a simulation of a computed tomography scan, the researcher compared the performance of both rounding methods. The results showed that for well-behaved problems, the standard method was sometimes slightly better, but for more challenging cases, the stochastic method provided a clear advantage. The study confirmed that the theoretical predictions matched the experimental results with high precision, with the measured errors falling within a few percent of the predicted values across dozens of different test configurations. This consistency suggests that the behavior is not a fluke of specific test cases but a fundamental property of how stochastic rounding interacts with this type of algorithm.
Ultimately, this work provides a clear roadmap for improving the reliability of low-precision computing. By understanding that rounding errors can be managed through randomness rather than suppressed through precision, engineers and scientists can design algorithms that are both faster and more accurate. The study does not claim that stochastic rounding is a magic bullet for every situation; for simple, well-conditioned problems, the traditional method remains effective. However, for the complex, large-scale problems that define modern computing, the ability to turn rounding errors into a manageable residual offers a powerful new tool. The research confirms that with the right approach, the limitations of low-precision hardware can be overcome, allowing machines to solve difficult mathematical problems with a level of fidelity that was previously thought impossible without using much more expensive and slower high-precision formats.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.