What is numerical precision?

Numerical precision is the property setting how many bits and which format represent a number in memory, which in turn sets the range of representable values and the smallest gap between neighbouring values; FP32, BF16, FP16, FP8, INT8 and INT4 are common in AI.

In floating point formats the bits after the sign bit are split between exponent and mantissa: exponent bits set range, mantissa bits set precision. Integer formats use evenly spaced levels, working with a scale in quantisation.

Topic
Infrastructure and runtime
Also known as
Precision format

How numerical precision works

  1. Choose a format for weights, activations and gradients.
  2. Fewer bits reduce memory and bandwidth needs, raising speed on suitable hardware.
  3. Too little range or precision causes overflow, underflow or rounding error.
  4. Critical steps such as accumulation and weight updates stay at higher precision.

In more detail

Bit layouts and the FP8 variants (E4M3 and E5M2)

In IEEE 754 and AI floating-point formats, each number uses 1 sign bit, exponent bits and mantissa bits: FP32 (1+8+23), FP16 (1+5+10), BF16 (1+8+7) and FP8 variants E4M3 (1+4+3) and E5M2 (1+5+2). Understanding these bit layouts explains why BF16 rarely overflows where FP16 can and why FP8 splits into two variants for weights/activations versus gradients.

Block and group scaling and the outlier problem

Modern low-bit formats such as INT4 (AWQ, GPTQ) and OCP Microscaling (MXFP8, MXFP4) do not apply a single scale to an entire tensor; instead, they share a scaling factor across small blocks of 16 to 128 values. Block-wise scaling prevents large outlier values from crushing the precision of normal weights in the same layer.

Precision choices in training versus inference

The memory footprint of weights is only part of the equation. In mixed-precision training with AdamW, each parameter typically requires 16 to 18 bytes of total state (master FP32 weights, gradients and first/second optimiser moments) in addition to activations. In inference, the KV cache can also be stored in lower precision (such as FP8 KV cache) to serve longer contexts and more concurrent users.

Commonly confused terms

TermHow it differs
QuantisationNumerical precision is the bit representation of numbers (e.g., FP16, BF16, INT4), whereas quantisation is the algorithmic process of mapping higher-precision values (such as BF16 weights) into lower-precision discrete levels using scaling factors and zero-points.
FP16 versus BF16BF16 keeps an 8-bit exponent (same dynamic range as FP32) with 7 mantissa bits, preventing overflow in training without loss scaling; FP16 uses a 5-bit exponent (narrower range) and 10 mantissa bits, offering finer precision but risking gradient underflow/overflow.

Why numerical precision matters for on-premises AI

The paper proposing mixed precision training stores weights, activations and gradients in half precision, noting its narrower range and managing information loss by keeping a single-precision weight copy, among other techniques. A study of BF16 shows it covers the same range as FP32 with simple conversion, avoiding the hyperparameter tuning FP16 needs. The FP8 paper shows 8-bit floating point can match 16-bit training. Example calculation: 7 billion parameters take about 28 GB in FP32, 14 GB in BF16, 7 GB in INT8 and 3.5 GB in INT4.

ON-PREMISES EXAMPLE

A health tech firm trains its radiology report model in BF16, comparing accuracy on critical finding classes before switching inference to INT8 and approving the change only if the gap is within tolerance.

Common questions

Is lower precision always better?

No. It gains memory and speed but adds error; weigh the task, hardware support and acceptable accuracy loss together.

How do BF16 and FP16 differ?

Both are 16-bit. BF16 keeps FP32's range with fewer mantissa bits; FP16 is more precise but has a narrower range.

Sources

In the glossary: Glossary, M to Q

What does this term mean for your infrastructure?

We can work out together in a technical assessment how it maps onto your data, hardware and security requirements.

Request a technical assessment →

This site sets no cookies. Visitor numbers are counted in aggregate using a cookieless method that does not identify anyone. See the Privacy Policy for details.