Glossary

Stochastic rounding

Beginner

Rounding up or down at random, more often toward the closer value, so tiny changes add up correctly on average.

Novice

A rounding mode where a value between two representable numbers rounds up with probability equal to how close it is to the upper one. On average the rounding error is zero, so many small updates are not all lost.

Expert

Round xx to ⌊x⌋\lfloor x \rfloor or ⌈x⌉\lceil x \rceil with P(up)=(x−⌊x⌋)/ulpP(\text{up}) = (x - \lfloor x \rfloor)/\mathrm{ulp}; unbiased (E[round(x)]=xE[\mathrm{round}(x)] = x). Needs a random source per conversion. Used for low-precision weight updates and gradient quantization (for example in FP4 training) where round-to-nearest would systematically drop small increments.