Abstract
Generalization abilities of well-trained large language models (LLMs) are known to scale predictably as a function of model size. In contrast to the existence of practical scaling laws governing pre-training, the quality of LLMs after post-training compression remains highly unpredictable, often requiring case-by-case validation in practice. In this work, we attempted to close this gap for post-training weight quantization of LLMs by conducting a systematic empirical study on multiple LLM families quantized to numerous low-precision tensor data types using popular weight quantization techniques. We identified key scaling factors pertaining to characteristics of the local loss landscape, based on which the performance of quantized LLMs can be reasonably well predicted by a statistical model.
Introduction
In the world of Large Language Models (LLMs), bigger is usually better, but bigger is also harder to run. To fit these models on consumer hardware or run them efficiently in production, we use Post-Training Quantization (PTQ)—the process of converting high-precision weights (like 16-bit floats) into low-precision formats (like 4-bit integers).
While pre-training follows famous "scaling laws" where more data and parameters lead to predictable gains, quantization has remained notoriously fickle. A 7B model might handle 4-bit quantization gracefully, while a 13B model might "break" unexpectedly. Currently, engineers have to benchmark every model-format combination manually. This research seeks to close that gap by finding the underlying rules that govern how quantized models scale.
Methodology
The authors conducted a massive systematic study across several LLM families, including GPT-2, OPT, BLOOM, Llama 2, and Llama 3.
Key components of the approach include:
- Microscaling (MX) Formats: Focus on emerging standards like MXFP and MXINT, which use block-based scaling to maintain higher accuracy than traditional integer formats.
- Loss Landscape Analysis: Mapping the "local loss landscape" around the model's trained weights using Taylor series expansions to understand how "steep" or "flat" the loss is when weights are perturbed by quantization.
- Predictive Modeling: A Random Forest regressor was built using features like model size, pre-trained loss, and local landscape slope to predict the final Negative Log-Likelihood (NLL) of a quantized model.
- Quantization Algorithms: Comparison between simple Round-to-Nearest (RTN) quantization and the more advanced GPTQ algorithm.
Evaluations were performed on datasets like WikiText-2 (for core generalization), C4, and LAMBADA.
Key Insights
- Larger Models are "Flatter": As LLMs increase in size, their local loss landscapes become flatter. This inherent property makes larger models more robust to the "noise" introduced by quantization.
- Predictable Impact of Noise: While the Signal-to-Quantization-Noise Ratio (SQNR) remains relatively constant across model sizes for a given data type, the impact of that noise on model performance changes predictably based on the model's scale.
- Algorithm Efficiency: The advanced GPTQ algorithm is most effective within a specific "window" of precision. Outside this window—where precision is either very high or very low—the benefits over RTN diminish.
- MX vs. INT: Traditional integer quantization (
int) is more chaotic and harder to predict than Microscaling (MX) formats due to the extra calibration steps required forint.
Key Results
The research establishes a clear tradeoff: the same performance can be achieved by using a larger model with aggressive quantization (e.g., 3-bit) or a smaller model with higher precision (e.g., 6-bit).
The Random Forest model demonstrated high predictive accuracy, successfully forecasting the performance of unseen model families like Pythia and MPT. Furthermore, measuring the "local loss landscape" requires only a few forward passes, making it significantly cheaper than full quantization and evaluation.
Conclusion and Future Work
While the study provides a robust framework for predicting quantization performance, it was limited to models up to 13 billion parameters. Future work should validate these laws on "frontier" models exceeding 70B parameters. Additionally, while NLL loss is a strong proxy for general performance, further investigation is needed to correlate these findings with specific downstream tasks like complex reasoning or coding.
Summary updated