Rank-Aware Spectral Bounds on Attention Logits for Stable Low-Precision Training
Abstract
Lay Summary
Modern language models are expensive to train: the computations involve trillions of numbers that have to be stored and updated as training progresses. One way to lower the cost is to use smaller numbers, for instance 8-bit floating point (FP8) instead of the standard 16-bit. The trouble is that 8-bit numbers can only represent a narrow range of values, and if any value grows too large during training, the result is "Not a Number" outputs that corrupt the entire model. The standard solution looks at how large the numbers have been over the most recent training steps and adjusts the scaling accordingly. This is essentially driving while watching only the rearview mirror: it works while training is steady, but fails predictably whenever something changes suddenly. When practitioners load a previously trained model into the 8-bit pipeline, resume after a job interruption, or ramp up the learning rate, the recent history does not reflect what is about to happen, and every model we tested overflows in 100% of its attention layers. We propose a different approach: predict what is about to happen, instead of reacting to what just did. The mathematical structure of transformer attention lets us compute, directly from the model's current weights, a safe upper bound on the largest value any attention computation will produce. We then use that bound to set the scaling factor before the computation runs, so the result is guaranteed to fit in the 8-bit range. Because we read the weights themselves rather than past activity, the prediction never goes stale. Across models ranging from 1.5 billion to 70 billion parameters, our method eliminates the overflow failures that break standard methods while matching downstream accuracy. The code is publicly released for the community to use.