[Paper Review] FP8 Quantization: The Power of the Exponent
This paper proposes FP8 quantization as a superior alternative to INT8 for neural network inference, leveraging the exponent's flexibility to better handle outliers. It introduces a differentiable FP8 simulation framework that jointly learns optimal exponent bias and mantissa/exponent bit allocation, showing FP8 outperforms INT8 in post-training quantization—especially with high-outlier networks—while QAT reduces the gap between formats.
When quantizing neural networks for efficient inference, low-bit integers are the go-to format for efficiency. However, low-bit floating point numbers have an extra degree of freedom, assigning some bits to work on an exponential scale instead. This paper in-depth investigates this benefit of the floating point format for neural network inference. We detail the choices that can be made for the FP8 format, including the important choice of the number of bits for the mantissa and exponent, and show analytically in which settings these choices give better performance. Then we show how these findings translate to real networks, provide an efficient implementation for FP8 simulation, and a new algorithm that enables the learning of both the scale parameters and the number of exponent bits in the FP8 format. Our chief conclusion is that when doing post-training quantization for a wide range of networks, the FP8 format is better than INT8 in terms of accuracy, and the choice of the number of exponent bits is driven by the severity of outliers in the network. We also conduct experiments with quantization-aware training where the difference in formats disappears as the network is trained to reduce the effect of outliers.
Motivation & Objective
- To investigate whether low-bit floating-point formats like FP8 offer advantages over INT8 for neural network quantization.
- To analyze how the choice of exponent and mantissa bits in FP8 affects model accuracy under different data distributions.
- To develop an efficient, differentiable FP8 simulation framework enabling end-to-end learning of scaling factors and bit allocation.
- To evaluate FP8 performance across diverse networks in post-training quantization (PTQ) and quantization-aware training (QAT) settings.
- To guide hardware design by identifying optimal FP8 formats and bias configurations for real-world models.
Proposed method
- Proposes a differentiable FP8 quantization simulation in FP32 hardware, enabling gradient-based optimization of scale factors and bit allocation.
- Introduces a learnable exponent bias per layer, allowing dynamic adjustment to distribution characteristics.
- Employs a straight-through estimator (STE) for backpropagation through rounding operations, enabling joint optimization of mantissa and exponent bit counts.
- Designs a flexible FP8 format with configurable sign, exponent, and mantissa bits, supporting 3M4E, 4M3E, 5M2E, and 2M5E configurations.
- Validates the method via PTQ and QAT on multiple networks and data modalities, comparing accuracy across formats.
- Uses log-spaced histogram analysis to visualize dynamic range vs. precision trade-offs across FP8 and INT8 formats.
Experimental results
Research questions
- RQ1Does FP8 quantization outperform INT8 in terms of inference accuracy for post-training quantization?
- RQ2How do different configurations of mantissa and exponent bits in FP8 affect model performance across various network types?
- RQ3Can the exponent bias and bit allocation between mantissa and exponent be jointly learned via backpropagation to improve accuracy?
- RQ4To what extent do the benefits of FP8 diminish when using quantization-aware training (QAT)?
- RQ5How do outlier distributions in activations and weights influence the optimal FP8 format choice?
Key findings
- FP8 quantization outperforms INT8 in post-training quantization across a wide range of networks, particularly when outliers are present.
- The 5M2E and 4M3E FP8 formats achieve the best accuracy, with higher exponent bits (e.g., 4 or 5) being optimal for networks with severe outliers, such as transformers.
- The choice of exponent bit count is driven by outlier severity: more exponent bits increase dynamic range and reduce quantization error for extreme values.
- In quantization-aware training (QAT), the performance gap between FP8 and INT8 disappears, as networks adapt to the INT8 quantization grid.
- The proposed differentiable FP8 simulation enables efficient, end-to-end learning of both scale factors and optimal bit allocation between mantissa and exponent.
- The study demonstrates that FP8’s extra degree of freedom—via the exponent—provides a meaningful advantage over INT8 by better preserving the dynamic range of activations and weights.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.