FP16, or half-precision floating point, is a 16-bit number format defined in IEEE 754 that stores each value with 1 sign bit, 5 exponent bits and 10 fraction bits. In AI hardware, FP16 is one of the core reduced-precision formats for training and running neural networks, because it halves memory and bandwidth compared with 32-bit floats and runs much faster on dedicated matrix units.
The format is also called half precision or float16 in software frameworks. Its main limitation is a narrow dynamic range, which is why modern accelerators pair it with techniques such as loss scaling or offer alternatives like bfloat16 and FP8.
How the FP16 bit layout works
FP16 encodes a number as sign, exponent and fraction, exactly like FP32 but with fewer bits in each field. The 5-bit exponent uses a bias of 15, and the 10 stored fraction bits plus an implicit leading one give 11 bits of significand precision, which corresponds to roughly three to four decimal digits.
The largest finite FP16 value is 65,504, and the smallest normal positive value is about 6.1 × 10⁻⁵. Below that, subnormal numbers extend the range down to about 6 × 10⁻⁸ at the cost of precision. Values beyond the maximum overflow to infinity, and values below the subnormal limit underflow to zero.
| Property | Value | Practical effect |
|---|---|---|
| Total bits | 16 (1 sign, 5 exponent, 10 fraction) | Two bytes per value |
| Maximum finite value | 65,504 | Large activations can overflow |
| Smallest normal value | About 6.1 × 10⁻⁵ | Small gradients lose precision |
| Smallest subnormal value | About 6 × 10⁻⁸ | Tinier values become zero |
| Machine epsilon | About 9.8 × 10⁻⁴ | Roughly three decimal digits |
FP16 compared with other AI number formats
FP16 sits between full-precision FP32 and the newer 8-bit and 4-bit formats used on recent accelerators. Its closest competitor is bfloat16, which keeps the 8-bit exponent of FP32 and therefore the same dynamic range, but stores only 7 fraction bits. FP16 offers more precision, while bfloat16 offers more range.
The comparison below shows why accelerator designers support several formats side by side rather than choosing a single one.
| Format | Exponent bits | Fraction bits | Approximate maximum | Typical role |
|---|---|---|---|---|
| FP32 | 8 | 23 | 3.4 × 10³⁸ | Master weights, reference accuracy |
| TF32 | 8 | 10 | 3.4 × 10³⁸ | Tensor core math on FP32 inputs |
| FP16 | 5 | 10 | 65,504 | Mixed-precision training, inference |
| bfloat16 | 8 | 7 | 3.4 × 10³⁸ | Large model training without scaling |
| FP8 (E4M3) | 4 | 3 | 448 | Inference and scaled training |
Why accelerators run FP16 faster
FP16 speeds up AI workloads in two independent ways. First, each value occupies half the space of FP32, so the same memory bandwidth moves twice as many numbers, which matters for memory-bound layers. Second, a 16-bit multiplier needs far less silicon than a 32-bit one, so a chip can pack many more multiply-accumulate units into the same area and power budget.
Data-center GPUs execute FP16 matrix multiplications on tensor cores or other matrix multiply units, usually accumulating results in FP32 to avoid rounding drift across long dot products. Depending on the generation, dense FP16 tensor throughput is several times to more than ten times higher than plain FP32 vector throughput on the same chip.
- Halved model footprint: a 7-billion-parameter model needs about 14 GB of weights in FP16 instead of 28 GB in FP32.
- Higher arithmetic throughput from dense matrix units built for 16-bit inputs.
- Better cache and memory use, since more values fit in on-chip buffers.
- Lower energy per operation, which improves performance per watt.
Mixed-precision training with FP16
Pure FP16 training often fails because small gradients underflow to zero and weight updates become too small to change FP16 weights. Mixed-precision training solves this by computing forward and backward passes in FP16 while keeping a master copy of weights in FP32 for the optimizer update.
The second ingredient is loss scaling. The loss is multiplied by a large factor before backpropagation, which shifts gradients into the representable FP16 range, and the gradients are divided by the same factor before the update. Dynamic loss scaling raises the factor gradually and lowers it whenever an overflow produces infinities.
| Operation | Usual precision | Reason |
|---|---|---|
| Matrix multiplications and convolutions | FP16 inputs, FP32 accumulation | Speed with stable sums |
| Softmax and normalization | FP32 | Sensitive to range and rounding |
| Loss computation | FP32 | Avoids overflow on large values |
| Optimizer state and master weights | FP32 | Preserves tiny updates |
| Stored activations | FP16 | Halves activation memory |
When to choose FP16 on current hardware
The right choice of FP16 depends on the model scale, the accelerator generation and the workload phase. Older GPUs and many edge NPUs accelerate FP16 but not bfloat16, which makes FP16 the natural option there. Newer data-center chips support bfloat16 and FP8 as well, so FP16 competes with formats that offer either wider range or higher throughput.
The decision table below reflects common engineering practice rather than a fixed rule, and teams should always validate accuracy on their own data.
| Situation | Recommended format | Reason |
|---|---|---|
| Training a small or medium model on older GPUs | FP16 with loss scaling | Only fast reduced-precision path |
| Training a very large language model | bfloat16 | Wide range avoids overflow |
| Serving a model with strict quality targets | FP16 | Near-FP32 accuracy, half the memory |
| Serving at maximum throughput on new accelerators | FP8 or INT8 | Higher speed after calibration |
| Running on a mobile or edge NPU | FP16 or INT8 | Matches supported hardware paths |
Limitations and common pitfalls of FP16
The narrow range of FP16 is its main operational risk. Very large language models can produce activation outliers above 65,504, which appear as NaN or infinite losses during training. For this reason, many large-scale training runs moved to bfloat16, which tolerates such values without loss scaling.
- Overflow in attention scores when logits are not scaled before the softmax.
- Silent accuracy loss when accumulation also happens in FP16 instead of FP32.
- Underflow in small gradients if loss scaling is disabled or misconfigured.
- Limited hardware support on some older or CPU-only systems, where FP16 may be emulated and slower.
For inference, FP16 is usually safe and loses little or no accuracy compared with FP32. It remains a common default serving precision before teams consider further quantization to INT8, FP8 or FP4.
Put simply
Computers store numbers using a fixed number of bits. More bits mean more exact numbers, but they also take more space and more time to process.
FP16 uses only 16 bits per number. It is like writing prices rounded to a few digits instead of to many decimals. The numbers are slightly less exact, but AI chips can handle twice as many of them at once. Neural networks usually do not need extreme exactness, so this trade works well for most tasks.
In practice
A research group fine-tunes an image classification model with 300 million parameters on a single data-center GPU. In FP32, training reaches only a small batch size and takes about nine hours per epoch. The team switches on automatic mixed precision, which runs convolutions in FP16, keeps master weights in FP32 and applies dynamic loss scaling.
Memory use for activations drops by almost half, so the batch size doubles. Each epoch now finishes in about three and a half hours, and final validation accuracy stays within 0.1 percentage points of the FP32 baseline. The outcome is a faster, cheaper run with no measurable loss in model quality.