Glossary termTechnique

Quantization

Also known as: Model quantization

Technique that stores and computes a model's numbers at lower precision, such as 8 or 4 bits, to cut memory use and speed up inference.

Quantization reduces the number of bits used to represent a model's weights, and sometimes its activations. Neural networks are usually trained with 32-bit or 16-bit floating-point numbers, but many values can be stored as 8-bit or 4-bit integers or small floating-point formats with little loss in quality. A model quantized from 16 to 4 bits needs roughly a quarter of the memory, allowing larger models to fit on consumer graphics cards, laptops and phones and often making inference faster and more energy-efficient.

There are two broad approaches. Post-training quantization converts a finished model, using calibration data and careful rounding schemes to minimize error; methods such as GPTQ and AWQ became popular for large language models. Quantization-aware training simulates low precision during training so the model learns to tolerate it. The llama.cpp project and its GGUF file format made a range of quantization levels easy to use, and hardware vendors added native support for low-precision arithmetic in GPUs and neural processing units.

Quantization is a major reason capable AI can run locally rather than only in data centers, supporting privacy, offline use and lower costs. It involves trade-offs: aggressive quantization can degrade accuracy, especially on reasoning, long contexts or less common languages, and quality losses are not always visible in headline benchmarks. In signal processing, the same word refers to the closely related idea of mapping continuous values to a limited set of discrete levels, as happens when audio or images are digitized.

Key points

  • Quantization stores model values at lower precision to reduce memory and computation.
  • Going from 16-bit to 4-bit weights cuts memory requirements to roughly a quarter.
  • Post-training quantization and quantization-aware training are the two main approaches.
  • Aggressive quantization can reduce quality in ways that headline benchmarks may not reveal.

Related entries

Glossary term

The learned numerical values inside a machine learning model, set during training, that determine how it transforms inputs into outputs.

Glossary term

Inference

AIProgramming

The stage at which a trained machine learning model is run on fresh inputs to produce predictions or generated outputs, as distinct from training.

Technology

llama.cpp

AIFOSS

Open-source C and C++ engine for running large language models locally on consumer hardware, known for its quantized GGUF model format.

Technology

Ollama

AIProgramming

Tool for downloading and running open-weight language models on a personal computer or server through a simple command line and local API.

Glossary term

Graphics Processing Unit

HardwareAIVideo Games

Highly parallel processor originally designed to render images, now also widely used for scientific computing and for training and running AI models.

Glossary term

Specialized processor designed to run neural network computations efficiently, often built into phones and laptops for on-device AI.

Glossary term

AI model whose trained weights are publicly released for download, letting others run, study and adapt it, though often under restrictive licenses.

Glossary term

Method of representing and calculating with real numbers in binary using a significand and an exponent, trading exactness for a vast range.

Featured in guides

Referenced by

Other entries that discuss or point to Quantization.