about
Train your Large Language Models in BF16 over FP16 (arxiv.org)
3 points by bigmodelenergy on Jul 2, 2023 | hide | past | pdf | 2 comments on HN

In plain words: Quantization stores a model's numbers with fewer bits, which usually wrecks performance in big models. A training recipe that keeps activation values from spiking avoided that drop, letting models up to 52B parameters shrink with minimal accuracy loss.

Abstract · Intriguing Properties of Quantization at Scale

Emergent properties have been widely adopted as a term to describe behavior not present in smaller models but observed in larger models. Recent work suggests that the trade-off incurred by quantization is also an emergent property, with sharp drops in performance in models over 6B parameters. In this work, we ask "are quantization cliffs in performance solely a factor of scale?" Against a backdrop of increased research focus on why certain emergent properties surface at scale, this work provides a useful counter-example. We posit that it is possible to optimize for a quantization friendly training recipe that suppresses large activation magnitude outliers. Here, we find that outlier dimensions are not an inherent product of scale, but rather sensitive to the optimization conditions present during pre-training. This both opens up directions for more efficient quantization, and poses the question of whether other emergent properties are inherent or can be altered and conditioned by optimization and architecture design choices. We successfully quantize models ranging in size from 410M to 52B with minimal degradation in performance.

Arash Ahmadian, Saurabh Dash, Hongyu Chen, Bharat Venkitesh, Stephen Gou, Phil Blunsom, Ahmet Üstün, Sara Hooker
arXiv:2305.19268 · cs.LG, cs.AI · submitted May 30, 2023
abstract · pdf · html · 32 pages, 14 figures

add comment on HN
Also discussed: May 2023 (2 points, 0 comments)

Turns out models trained in BF16 are much more quantizable to INT8 and INT4 over their FP16 counterparts but the paper doesn't delve much into the reason for this. Anyone has insights as to why this might be happening?
> We relate the degradation results to the numerical stability in training. fp16 format uses a smaller range for the exponent than bf16. While bf16 uses 8 bits for the exponent, fp16 only uses 5. Most floating point formats also have denormalized numbers which allow for a soft underflow. This can get exponentially closer to 0.0f for each additional bit in the mantissa. This makes underflow more of a concern for floating point formats.