bfloat16, short for brain floating point and abbreviated BF16, is a 16-bit floating-point format with 1 sign bit, 8 exponent bits and 7 fraction bits. It keeps the same dynamic range as 32-bit single precision (FP32) while halving storage and memory traffic, which made it a standard numeric format in AI hardware for training and running neural networks in artificial intelligence.
The format was introduced by Google Brain for its tensor processing units and was later adopted by data-center GPUs, CPUs and custom AI chips. Its design reflects a practical observation about deep learning: neural networks tolerate low precision well, but they break quickly when values overflow or underflow. bfloat16 therefore sacrifices fraction bits rather than exponent bits.
How the bfloat16 bit layout works
A bfloat16 value is essentially the upper 16 bits of an FP32 number. The sign bit and the 8-bit exponent are identical to FP32, with the same exponent bias of 127, and only the fraction is shortened from 23 bits to 7 bits. Counting the implicit leading one, the format carries 8 bits of significand precision, roughly two to three significant decimal digits.
Because the layouts align, conversion between FP32 and BF16 is cheap. Converting down means rounding away the lower 16 bits, normally with round-to-nearest-even; converting up means appending 16 zero bits. Hardware can implement both operations with very little logic, and software can do it with simple integer shifts.
| Property | Value | What it affects |
|---|---|---|
| Total width | 16 bits | Memory footprint and bandwidth |
| Exponent bits | 8 | Dynamic range, same as FP32 |
| Fraction bits | 7 stored, 8 with implicit bit | Precision of each value |
| Machine epsilon | 2^-7, about 0.0078 | Smallest relative step near 1.0 |
| Largest finite value | About 3.39 × 10^38 | Overflow threshold |
| Smallest normal value | About 1.18 × 10^-38 | Underflow threshold |
bfloat16 compared with other AI number formats
The main alternative 16-bit format, IEEE 754 half precision (FP16), makes the opposite trade-off: it keeps more fraction bits but only 5 exponent bits. The comparison below shows why BF16 is usually preferred for training, while narrower formats now dominate high-throughput inference.
| Format | Exponent / fraction bits | Approximate max value | Main role |
|---|---|---|---|
| FP32 | 8 / 23 | 3.4 × 10^38 | Master weights, accumulation |
| TF32 | 8 / 10 | 3.4 × 10^38 | Tensor core math for FP32 code |
| bfloat16 | 8 / 7 | 3.4 × 10^38 | Training and inference |
| FP16 | 5 / 10 | 65,504 | Inference, graphics, older training |
| FP8 E4M3 | 4 / 3 | 448 | Low-precision training and inference |
The decisive difference is range rather than precision. FP16 overflows above 65,504 and loses small gradients to underflow, so FP16 training needs loss scaling to keep gradients representable. BF16 shares the FP32 range, so most models train in BF16 without loss scaling and with fewer numerical surprises.
Why bfloat16 suits accelerator design
bfloat16 reduces silicon area and energy in the units that dominate AI workloads. A floating-point multiplier grows roughly with the square of the significand width, so an 8-bit significand multiplier is several times smaller than the 24-bit multiplier needed for FP32. This lets a chip pack far more multiply-accumulate units into systolic arrays and matrix multiply units.
Halving the operand size also doubles effective memory bandwidth and on-chip capacity. Many large models are memory-bound rather than compute-bound, so moving half as many bytes per parameter often improves throughput as much as the faster arithmetic does. In roofline terms, BF16 raises arithmetic intensity measured per byte.
| Hardware family | BF16 support | Accumulation |
|---|---|---|
| Cloud TPU | Native since early generations | FP32 |
| Data-center GPUs | Tensor cores since the Ampere generation | FP32 |
| Server CPUs | Vector and matrix extensions | FP32 |
| Custom AI chips | Common default training format | FP32 |
Mixed-precision training with bfloat16
In practice, bfloat16 is almost always used inside a mixed-precision scheme. Matrix multiplications read BF16 inputs but accumulate in FP32, because summing thousands of products with only 8 bits of precision would lose small contributions. The optimizer typically keeps an FP32 master copy of the weights.
The reason for the master copy is update swamping. With an epsilon of about 0.0078, adding an update smaller than roughly 0.4 percent of a weight to a BF16 value can leave it unchanged. Keeping weights and optimizer states in FP32, or using stochastic rounding on hardware that supports it, preserves these small updates over millions of steps.
- Store activations and weight copies for compute in BF16 to save memory.
- Accumulate dot products and reductions in FP32.
- Keep softmax, normalization statistics and loss computation in FP32 where frameworks allow.
- Keep optimizer states and master weights in FP32.
Limitations and common misconceptions
bfloat16 is not a drop-in replacement for FP32 in every computation. Its low precision makes it unsuitable for long sequential sums, scientific simulations that require many correct digits, and operations that subtract nearly equal numbers. The table summarizes frequent issues.
| Issue | Cause | Mitigation |
|---|---|---|
| Training loss stalls late | Small updates lost to rounding | FP32 master weights |
| Inaccurate large reductions | BF16 accumulation | Accumulate in FP32 |
| Quality drop in inference | Sensitive layers in low precision | Keep those layers in FP32 |
| Assumed FP16 equivalence | Same width, different layout | Check format-specific behavior |
A frequent misconception is that all 16-bit formats are interchangeable. A checkpoint trained in BF16 can overflow when cast to FP16 because its activations may exceed 65,504. Another is that BF16 is always the cheapest option: for inference, 8-bit and 4-bit formats such as FP8, INT8 and microscaling formats now deliver higher throughput when accuracy allows.
Put simply
Computers store numbers with a fixed number of bits. More bits mean more detail but more memory. bfloat16 uses only 16 bits instead of the usual 32. It keeps the part that says how big a number is and drops part of the fine detail.
Think of a map that still covers the whole country but shows fewer small streets. For AI models, that is usually enough. The result is half the memory and much faster chips with very little loss in quality.
In practice
A research team trains a 7-billion-parameter language model on a cluster of data-center GPUs. Stored in FP32, the weights alone would take about 28 GB per copy; in bfloat16 they take about 14 GB, and activations shrink by the same factor. This frees memory for longer sequences and larger batches on each accelerator.
The team uses a standard mixed-precision setup: BF16 matrix multiplications on tensor cores, FP32 accumulation and FP32 optimizer states. Compared with an earlier FP16 run, they no longer need loss scaling, and the loss curve matches an FP32 reference run within normal run-to-run noise. Training throughput is roughly two to three times higher than pure FP32, depending on the model and interconnect.