Skip to content

Quantization

Compressing the weights of a model from high precision (16 bits) to low precision (8 or 4 bits) in order to reduce memory requirements.

Why is it needed

A model with 70 billion parameters takes up tens of gigabytes of video memory. Quantization reduces the model size by 2–4 times.

How it works

A weight is a number with 16 decimal places. Quantization rounds it to a number with 4 decimal places. Precision drops slightly, but it takes up much less space.

Accuracy and Size

Accuracy Quality
FP16 (16 bits) Maximum
INT8 (8 bits) Almost indistinguishable
INT4 (4 bits) Small losses

Where it is used

  • local model launches;
  • QLoRA — fine-tuning on top of a quantized model;
  • GGUF format for Ollama.

See also

← All terms