Home / Glossary / Quantization

On this pageIn more detailWhy it mattersRelated termsRead more

Quantization

Quantization is the process of representing a neural network’s numbers with fewer bits, for example converting 32-bit floating-point values to 8-bit integers.

In more detail

A trained model contains millions or billions of weights, normally stored as floating-point numbers. Quantization maps those values, and often the intermediate values computed during execution, onto a smaller set of levels.

There are two main approaches. Post-training quantization converts a finished model, using sample data to choose suitable ranges. Quantization-aware training simulates the reduced precision during training so the model learns to tolerate it, which usually preserves accuracy better at very low bit widths.

Different parts of a model can use different precisions, keeping more bits where the model is sensitive.

Why it matters

Fewer bits bring several gains at once:

  • Smaller models. Going from 32 bits to 8 cuts memory by about four times.
  • Faster execution. Integer arithmetic needs simpler circuits.
  • Lower energy. Less data is moved and less logic switches.

These gains are what make it practical to run models on phones and embedded devices, and they reduce cost in the data center. Many NPUs and AI accelerators are designed around low-precision arithmetic for this reason.

The cost is some loss of accuracy. For many models it is negligible at 8 bits and becomes harder to manage below that. Quantization is used mainly for AI inference; training usually needs higher precision.

Related terms

Read more