FP32 vs FP16 vs BF16 vs INT8: Key Differences Explained

FP32 is the 32-bit single-precision floating-point format and is used as the reference for calculations. FP16 and BF16 are both 16 bits but allocate their bits differently. FP16 spends more bits on the mantissa for precision, so its range is narrow, with a maximum of 65504. BF16 keeps the exponent at 8 bits, the same as FP32, preserving an FP32-like range at the cost of precision. INT8 is an 8-bit integer used for quantization, which approximates real numbers by applying a scale, and it greatly reduces memory and power in AI inference.

AspectFP32FP16BF16INT8
Bit width32 bits16 bits16 bits8 bits
Sign, exponent and mantissa bits1, 8, 231, 5, 101, 8, 7No exponent or mantissa. Two's complement integer from −128 to 127
Largest representable valueAbout 3.4 × 10³⁸65504About 3.4 × 10³⁸ (almost the same as FP32)127 (real values are represented with a scale)
Smallest normal numberAbout 1.2 × 10⁻³⁸About 6.1 × 10⁻⁵ (2⁻¹⁴)About 1.2 × 10⁻³⁸None (the step between representable values is set by the scale)
PrecisionAbout 7 decimal digits (the gap between 1 and the next number is 2⁻²³ ≈ 1.2 × 10⁻⁷)About 3 decimal digits (2⁻¹⁰ ≈ 9.8 × 10⁻⁴)2 to 3 decimal digits (2⁻⁷ ≈ 7.8 × 10⁻³)256 levels
Conversion from FP32None (the reference)The range is narrow, so large values can overflow and small values can become 0Just take the upper 16 bits and round; the range does not overflowQuantize by choosing a scale (and zero point). Calibration to examine the value range is needed
Memory per value4 bytes2 bytes2 bytes1 byte
Arithmetic unit efficiencyLarge multipliers; fewer multiply-accumulates fit in the same areaArithmetic units are smaller than for FP32, so many more multiply-accumulates can be placedAbout the same as FP16. The shorter mantissa makes the multiplier even smallerSmallest multipliers and lowest power. Products are often accumulated as 32-bit integers
Use in trainingMaster weights, optimizer states, accumulation of productsMixed-precision training. Loss scaling keeps small gradients from becoming 0Widely used in mixed-precision training. Loss scaling is often unnecessaryGenerally not used (quantization-aware training simulates the effects of quantization)
Use in inferenceAccuracy reference. When accuracy takes priority over performanceInference on GPUs and similar hardwareInference on GPUs and AI acceleratorsInference of quantized models, especially on edge NPUs

Figures are typical orders of magnitude and vary by process generation and product.

When to use which

FP32
Calculations that need precision, master weights and product accumulation in training, and as a reference for checking low-precision results.
FP16 and BF16
When you want to halve memory and compute in AI training and inference. BF16 for training where range matters; FP16 when values fit in its range and precision matters.
INT8
When you want to quantize a trained model for faster, lower-power inference. Inference on edge devices with limited memory and power.

FAQ

Why is BF16 often preferred over FP16 for AI training?

BF16 has an 8-bit exponent, the same as FP32, so its range is almost the same as FP32. FP16 needs loss scaling to keep small gradients from becoming 0 and large values from overflowing, but BF16 often does not, and conversion from FP32 is simple. Its precision is lower, but this is rarely a problem for neural network training.

Why is the maximum value of FP16 65504?

FP16 has a 5-bit exponent (bias 15), and the all-ones exponent is reserved for infinity and NaN, so the largest exponent is 2 to the 15th power. With all 10 mantissa bits set to 1, (2 − 2⁻¹⁰) × 2¹⁵ is the largest finite value, which equals 65504.

How does INT8 represent values with fractional parts?

It approximates them in the form real value ≈ scale × (integer − zero point). For quantization symmetric around 0, the zero point is 0 and the scale is set to something like “largest absolute value ÷ 127”. Scales are kept per tensor or per channel.

Can INT8 be used for training?

Training generally uses floating-point formats, because gradient values span a wide range and small updates to the weights must also be handled. INT8 is mainly used for inference with quantized trained models, and even quantization-aware training performs the weight updates in floating point.

Check your understanding

How are the bits of an IEEE 754 single-precision (32-bit) number allocated among sign, exponent and significand?

  1. A1, 11, 20
  2. B1, 8, 23
  3. C1, 5, 26
Show answer and explanation

Answer: B. 1, 8, 23

Single precision (FP32) uses 1 sign bit, 8 exponent bits and 23 significand bits, 32 in total. For normalized numbers the leading 1 of the significand is implied, so precision is 24 bits, about seven decimal digits. Double precision (FP64) uses 1, 11 and 52 bits, with a wider exponent and higher precision. 1, 11, 20 confuses it with double precision's exponent width, and 1, 5, 26 with half precision's.

What is the largest finite value representable in FP16 (1 sign, 5 exponent bits with bias 15, 10 significand bits)?

  1. A32768
  2. B65536
  3. C65504
Show answer and explanation

Answer: C. 65504

An all-ones exponent (31) is reserved for infinity and NaN, so the maximum exponent field is 30, giving a true exponent of 30 − 15 = 15. With an all-ones significand, the value is (1 + 1 − 2⁻¹⁰) × 2¹⁵ = (2 − 2⁻¹⁰) × 32768 = 65536 − 32 = 65504. Anything larger becomes infinity, so overflow must also be watched when training in FP16. 32768 is 2¹⁵ with a zero significand, and 65536 is 2¹⁶; neither is the maximum.

What is the main reason bfloat16 is used for AI training?

  1. AIts exponent is 8 bits like FP32, so its range is wide
  2. BIts significand is longer than FP32's, so it is more precise
  3. CIt can be computed with integer arithmetic
Show answer and explanation

Answer: A. Its exponent is 8 bits like FP32, so its range is wide

bfloat16 is a 16-bit format with 1 sign, 8 exponent and 7 significand bits. Sharing FP32's exponent width gives nearly the same range, so very small or large values such as gradients during training rarely overflow or underflow, and converting FP32 models is easy. Precision is low, but training tolerates some error, and data size and arithmetic area are halved. Its significand is shorter than FP32's, and it is computed with floating-point, not integer, arithmetic.

  1. When training neural networks in FP16 (half precision: 1 sign, 5 exponent, 10 significand bits), which problem tends to arise and is countered by scaling up the loss (loss scaling)?
  2. In AI inference, what is the main benefit of converting (quantizing) weights from FP32 to INT8?
  3. In mixed-precision AI training, why are master weights kept in FP32 while most computation is done in FP16 or bfloat16?

Practice Computer Arithmetic questions

Key terms explained

IEEE 754
The international standard defining floating-point formats and arithmetic, including single (32-bit) and double (64-bit) precision, rounding, and special values such as infinity and NaN, so results agree across computers.
bfloat16
A 16-bit floating-point format with 1 sign, 8 exponent and 7 significand bits. Sharing FP32's exponent width gives it a wide range, so despite low precision it is used for AI training. FP16, with 5 exponent and 10 significand bits, is more precise but has a narrow range.
INT8
An 8-bit signed integer (−128 to 127). In AI inference, quantizing weights and activations to INT8 with a scale factor greatly cuts computation and memory and allows fast processing on small integer circuits.
Mixed precision
Using different numeric precisions for different parts of a computation, such as multiplying in FP16 and accumulating in FP32, to balance speed and accuracy.
Post-training quantization
Converting a trained model's weights and activations to lower precision after examining value ranges with representative data.

Related comparisons