# Quantization

> Quantization is a technique that stores an AI model's numbers at lower precision, which makes the model smaller and faster to run on cheaper hardware at the cost of a usually small loss in quality.

Also called: quantisation, model quantization, 4-bit model, 8-bit model, compressed model, GGUF. Category: Models and training. Source: https://aibuildindex.com/glossary/quantization

## In the index

- Edge AI: median $1,900, middle half $510 to $6,650, 46 priced briefs (https://aibuildindex.com/skills/edge-ai)
- Llama: median $2,000, middle half $500 to $7,100, 79 priced briefs (https://aibuildindex.com/tools/llama)

An AI model is a huge collection of numbers, and by default each one is stored with a fair amount of precision. Quantization rounds them to a coarser format, using fewer bits per number. The model takes up much less memory and runs faster, so it can fit on a smaller graphics card, a laptop or a phone. It is one of the standard ways to make [open-weight models](https://aibuildindex.com/glossary/open-weight-model) affordable to self-host, and it is invisible to end users when done well.

## How it works

Model weights are typically trained in 16- or 32-bit formats. Quantization converts them to 8-bit, 4-bit or occasionally lower formats. The rounding introduces small errors, and clever methods reduce their effect, for example by treating the most sensitive weights more carefully or by calibrating on sample data.

The trade-off is roughly:

- **Moderate quantization** usually preserves quality well for many tasks while cutting memory substantially.
- **Aggressive quantization** saves more but can degrade accuracy, particularly on reasoning, maths, rare languages or long outputs.

Quantized models are distributed in specific file formats that suit particular serving tools, and many popular open-weight models are published in pre-quantized versions. Quantization can also be combined with [LoRA](https://aibuildindex.com/glossary/lora) to fine-tune large models on modest hardware.

A company running an internal assistant on its own servers might, for example, use a 4-bit version of a mid-sized open-weight model so it fits on a single graphics processor rather than several.

## What it means for cost

Quantization is mainly a running-cost tool for self-hosted models. Smaller memory needs mean cheaper or fewer machines and, often, faster [inference](https://aibuildindex.com/glossary/inference). For builds that call a provider's API, it is the provider's concern rather than the buyer's.

The cost risk is quality. A quantized model must be tested on the real task, not assumed equivalent to the full version, because losses can concentrate on exactly the hard cases that matter. Ask a builder which precision they plan to use, what quality checks compare it with the full model, and how much hardware the choice saves.

## Common questions

### Does quantization make a model less accurate?

Usually a little, and sometimes not noticeably for straightforward tasks. More aggressive compression increases the risk of errors. Comparing outputs on a set of real examples is the reliable way to judge.

### Can any model be quantized?

Any model whose weights you have can be quantized, which in practice means open-weight models. Closed models offered only through an API are managed entirely by their provider.

### Is quantization the same as distillation?

No. Quantization keeps the same model and stores its numbers more coarsely. [Distillation](https://aibuildindex.com/glossary/distillation) trains a different, smaller model to imitate a larger one. The two are often used together.

## Related terms

- [Open-weight model](https://aibuildindex.com/glossary/open-weight-model): An open-weight model is an AI model whose trained weights are published for download, so organisations can run, inspect and fine-tune it on their own infrastructure instead of only accessing it through a provider's API.
- [Small language model](https://aibuildindex.com/glossary/small-language-model): A small language model is a compact language model with far fewer parameters than leading large models, built to be cheaper and faster to run, often on modest hardware or devices, while handling focused tasks well.
- [Model distillation](https://aibuildindex.com/glossary/distillation): Model distillation is a technique for training a smaller, cheaper "student" model to imitate the outputs of a larger "teacher" model, so that it keeps much of the larger model's quality on a task while running faster.
- [Inference](https://aibuildindex.com/glossary/inference): Inference is the stage where a trained AI model is used to produce outputs, such as answers, classifications or images, from new inputs, as opposed to training, where the model learns from data.
- [LoRA (low-rank adaptation)](https://aibuildindex.com/glossary/lora): LoRA, or low-rank adaptation, is a fine-tuning method that trains a small set of extra weights alongside a frozen base model, making it far cheaper and quicker to adapt a large model to a specific task.
