Scaling Laws for Precision
Tanishq Kumar, Zachary Ankner, Benjamin F. Spector, Blake Bordelon, Niklas Muennighoff, Mansheej Paul, Cengiz Pehlevan, Christopher Ré, Aditi Raghunathan
TL;DR
The paper introduces precision-aware scaling laws for language model pretraining and inference, integrating low-precision training and post-training quantization into a unified loss framework. By modeling an effective parameter count $N_{eff}$ and a PTQ degradation term $\delta_{PTQ}$, the authors show how precision interacts with data and parameter counts to shape final performance, revealing that compute-optimal training often occurs around 7–8 bits and that overtraining can make PTQ harmful. They demonstrate multiplicative, partly independent effects for weight, activation, and KV-cache quantization, derive allocation strategies under various compute constraints, and unify training and inference degradations into a single functional form validated across 465 pretraining runs up to 1.7B parameters and 26B tokens. The findings have practical implications for hardware-aware training, suggesting when to train larger models in lower precision and how post-training quantization costs scale with data—informing future design of compute budgets and quantization strategies.
Abstract
Low precision training and inference affect both the quality and cost of language models, but current scaling laws do not account for this. In this work, we devise "precision-aware" scaling laws for both training and inference. We propose that training in lower precision reduces the model's "effective parameter count," allowing us to predict the additional loss incurred from training in low precision and post-train quantization. For inference, we find that the degradation introduced by post-training quantization increases as models are trained on more data, eventually making additional pretraining data actively harmful. For training, our scaling laws allow us to predict the loss of a model with different parts in different precisions, and suggest that training larger models in lower precision may be compute optimal. We unify the scaling laws for post and pretraining quantization to arrive at a single functional form that predicts degradation from training and inference in varied precisions. We fit on over 465 pretraining runs and validate our predictions on model sizes up to 1.7B parameters trained on up to 26B tokens.
