Quantization
Definition
Storing model weights at lower numerical precision, such as 8 or 4 bits, to reduce memory use and speed up inference at a small quality cost.
In more detail
Quantisation is what lets large models run on laptops. Quality drops gradually as precision falls; 4-bit versions are a common compromise for local use.
Quantisation stores weights, and sometimes activations, in fewer bits: 8-bit and 4-bit are common, with formats such as GGUF for llama.cpp-based tools and AWQ or GPTQ for GPU servers. A rough rule is that memory scales with bits per weight, so a 4-bit model needs about a quarter of the memory of its 16-bit version, plus room for the KV cache. Test the quantised model on your own tasks, because some, such as maths and code, degrade sooner than chat.
Related terms
GGUF
A single-file format from the llama.cpp project that stores model weights, often quantised, with the metadata needed to run them locally.
Inference
Running a trained model to produce outputs, as opposed to training it. Inference cost and speed decide what an AI feature costs to run.
QLoRA
LoRA fine-tuning applied to a base model loaded in 4-bit quantised form, cutting memory needs further so large models fit on one GPU.
Distillation
Training a smaller model to imitate the outputs of a larger one, keeping much of the quality at a lower cost and latency per request.
Model parameters
The numbers learned in training that determine what a model outputs; a model's size is usually quoted as how many of them it has.
Open-weight model
A model whose trained weights are published for download, whatever the licence terms on their use. Training data and code may stay private.
Read more about Quantization
- Local models
Running open-weight models on your own hardware for privacy, cost or offline use.
- Run local models with Ollama
Install Ollama, run an open-weight model on your own machine, call it from scripts over the local API and choose a model size your hardware can handle, offline.
- GGUF
A single-file format from the llama.cpp project that stores model weights, often quantised, with the metadata needed to run them locally.
- Small language model
A language model small enough, usually up to a few billion parameters, to run cheaply on a laptop, phone or modest GPU.