A nonzero gradient can still produce no stored update
Compare update size with the parameter's local ulp, inspect optimizer moments, and separate master-state preservation from visible low-precision copies.
On this page
The question for today
What you’ll understand
- Identify a parameter update that disappears under a specified nearest-rounded storage cast.
- Explain how wider master parameters preserve small updates across steps.
- Check optimizer moment and denominator precision rather than assuming finite gradients guarantee a valid step.
Training can calculate a finite nonzero gradient and a finite nonzero update while the stored parameter remains unchanged. If the update is too small relative to the local representable spacing, rounding returns the same value. Adaptive optimizers introduce additional state whose tiny squares, moving averages, or stabilizers can also lose information. Inspect the complete update path, from gradients through state arithmetic to parameter storage, rather than diagnosing progress only from a printed learning rate.
Compare the update with spacing at the parameter
For an ordinary non-boundary value on a local uniform grid, a nearest-rounded update smaller than half the step can return the original parameter. Halfway cases depend on tie rules, and binade boundaries have asymmetric neighboring spacing, so use actual neighbors when precision matters. The mathematical update can be nonzero even when its stored result is identical. Conversely, a zero gradient or zero learning rate is a different reason for no movement. Log an appropriate changed-parameter fraction or ulp-scale diagnostic alongside gradient norms when investigating apparent stagnation.
A wider master parameter can accumulate small updates that would be lost if each step wrote only a coarse value. A low-precision model copy may remain unchanged for several steps and then move when the master crosses a rounding boundary. That is not the same as applying each discarded update to a permanently coarse accumulator. Keep the master and copied-weight roles clear when comparing checkpoints or resume behavior. Saving only the visible low-precision copy can discard optimizer progress and state needed to continue the same numerical trajectory.
Moment arithmetic has its own range and precision
An adaptive optimizer can square gradients, average moments, apply bias corrections, take square roots, and add a denominator stabilizer. Each step can require more range or precision than the gradient tensor alone suggests. A representable gradient's square can underflow, and a small stabilizer can cast to zero in a coarse format. That can change the effective update or produce a nonfinite division. Retaining moments and updates in a wider representation is one design choice, but verify the actual implementation, fused kernels, and checkpoint storage instead of assuming a universal optimizer policy.
Changing the stabilizer merely to avoid a visible NaN changes the optimization algorithm and deserves a quality check. Likewise, a larger learning rate might cross the local grid while also making the mathematical method unstable. Separate representation loss from the desired optimization dynamics. Compare one-step updates on known tensors, moment evolution, nonfinite checks, and downstream loss behavior. A finite final parameter does not prove the internal state remained accurate, and an apparently identical model copy does not prove that a wider master state failed to advance.
Measure movement and resume semantics together
Construct a small reference update with exactly represented parameters and gradients, then inspect the parameter's previous/next representable values and the computed destination. Compare a coarse-only update, a wider master, and a wider-state variant while holding the mathematical hyperparameters fixed. Include save-and-resume tests that restore the state representation required by the chosen method. Report storage and bandwidth cost alongside quality. A compact checkpoint that cannot resume the promised update path is a different artifact, even if it produces similar inference outputs initially.
The optimization lab illustrates ideal quadratic updates rather than ulp loss. Reset, set both step size η=0.1 and initial x0=2, predict x1=1.8, then Step once. Playback advances two iterations per second, so each half-second Step advances one. Its model is x_n=(1−η)^n x0 on x²/2 and has no low-precision parameter cast, moments, or master copy. A stationary coarse parameter with nonzero η can therefore have a representation cause absent from this diagram. Reset and re-enter both values before a separate comparison.
Work it through
Three master updates cross a coarse storage boundary
A binary16 model parameter starts at 1.5. Each intended descent update is Δ=2⁻¹², exactly computed and subtracted in binary32. Compare rounding back to binary16 every step with retaining a binary32 master and copying it afterward. Use nearest, ties to even.
Binary16 spacing around 1.5 is 2⁻¹⁰. One update 2⁻¹² is a quarter of that step, so the coarse-only result rounds back to 1.5 every time this identical update is attempted.
The binary32 master retains successive values 1.499755859375 and 1.49951171875. The latter is a halfway case whose binary16 copy still rounds to 1.5 under ties to even.
After a third update the master is 1.499267578125, whose binary16 copy rounds to 1.4990234375. The master preserved the accumulating change even while its first two visible model copies were unchanged.
The nonzero update is genuinely lost in coarse-only storage, while a wider master accumulates it. This controlled mechanism does not guarantee a particular full-model training outcome.
The living notebook
Explore the model
Interactive lab · optimization
Ideal updates do not emulate coarse parameter storage
Reset, set both η=0.1 and x0=2, predict x1=1.8, then Step once. Step advances one iteration and Play two per second in the fixed x_n=(1−η)^n x0 model. Reset and re-enter both controls before another run. No optimizer moments, binary16 cast, master weights, or ulp-loss mechanism is modeled.
- Position x0
- 2
- Objective x²/2
- 2
- Iteration behavior
- Stable step
Gradient descent on f(x) = x²/2: xₙ = (1 − η)ⁿx₀. Playback advances two discrete iterations per second. Values outside |x| ≤ 4 are explicitly reported. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forMathematical descent and representable stored movement need separate checks in the real optimizer path.
Pause & reason
Check your understanding
Your turn
Try it yourself
A gradient component is g=2⁻¹³. Its square is evaluated and stored in binary16 with gradual underflow and nearest rounding. Compare g² with the minimum positive subnormal 2⁻²⁴ and explain the state risk.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Square the exponent, then compare against the halfway threshold to zero.
Compare with the solution
The square is 2⁻²⁶, which is below half of 2⁻²⁴ and rounds to zero. The original gradient was representable, yet its squared contribution can disappear from coarse second-moment state. The effect on a complete optimizer depends on averaging, other terms, stabilizer precision, and update types, which must be inspected rather than inferred from this one component.
Keep the idea
Take it with you
- Finite nonzero gradients can yield no stored parameter movement when updates fall below local spacing.
- Wider master parameters and optimizer state preserve information at different stages.
- Inspect moment range, stabilizers, actual casts, and checkpoint resume semantics together.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.