# Quantization

> Canonical: https://skillalmanac.com/glossary/quantization | Last verified: 2026-11-25 | Index status: index-eligible

Quantization stores a model's weights, the numbers learned in training, in fewer bits so the model needs less memory and can run on smaller hardware, usually at some cost in accuracy.

Also called: model quantization, LLM quantization, quantized model, quantized models, quantization meaning.

## In plain language

Quantization is like saving a photo at a lower resolution. An AI model is a very large set of numbers, called weights, and each one is normally stored with fairly high precision. Quantization stores them with fewer bits, which can reduce weight storage and may help a model fit on available hardware. Total memory also depends on runtime overhead and the task. The trade-off is accuracy: Hugging Face's documentation says fewer bits cost some accuracy, and each method balances memory, speed and accuracy differently. A quantized model can therefore behave slightly worse than the original, sometimes in ways that only show on your own tasks. If you run models yourself, treat the smaller file as a trade, test it on real work, and do not assume the quantized version matches the original model's published quality.

## Technical definition

Quantization maps weights, and sometimes activations, from a high-precision format such as 16-bit floating point to a lower-precision one such as 8-bit or 4-bit integers. Hugging Face documentation gives bf16 as typically 2 bytes per parameter, so an 8-billion-parameter model needs about 16 GB for weights in bf16, about 8 GB at 8 bits and about 4 to 5 GB at 4 bits, before anything else. IBM distinguishes post-training quantization, applied to an already trained model without retraining, from quantization-aware training, applied during pre-training or fine-tuning, which usually performs better but costs more. Methods such as AWQ, GPTQ and bitsandbytes differ in accuracy, speed and hardware support, and GGUF is a single-file format that stores the weights, config and tokenizer.

## How it shows up when you use agents

If you run a model locally for a coding agent, you will often be choosing among quantized versions of it. IBM says quantization is what lets models run on laptops, phones and older hardware. The choice is a memory budget decision: the model's weights have to fit in your graphics card or computer memory, and the Hugging Face documentation gives sample weight sizes at 16, 8 and 4 bits.

What breaks when this is misunderstood: you pick the smallest version to fit, then blame the agent for weaker answers when the cause may be lost precision. Hugging Face's documentation says fewer bits cost some accuracy and that methods differ. The safer habit is to start with the highest precision that fits your memory, run the same small task you care about on each candidate, and keep the one that passes. [local-model-sizing](/skills/skill-almanac/local-model-sizing) gives memory figures per level. See [Self-hosted LLM](/glossary/self-hosted-llm) and [Inference](/glossary/inference).

Next action: before downloading, write down your memory budget and compare it with each version's size, leaving room beyond the weights.

## Common confusions

- **Quantization versus compression of files.** Zipping a file loses nothing. Quantization changes the stored numbers to lower precision, so the model's behaviour can change.
- **Quantization versus distillation.** Quantization keeps the same model and stores it more compactly. See [Distillation](/glossary/distillation).
- **Post-training versus quantization-aware training.** IBM distinguishes post-training quantization from quantization-aware training, which it says usually performs better but costs more.
- **Myth.** "A quantized file always uses less memory when loaded." The cited Transformers GGUF guide distinguishes packed-quantized loading for supported architectures and kernels from legacy paths that dequantize weights. The file extension alone does not determine loaded memory; check the exact model, runtime version and kernel requirements.

## Worked examples in this catalogue

### [local-model-sizing](https://skillalmanac.com/skills/skill-almanac/local-model-sizing)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A calculation of whether an open-weight language model will run on a given GPU, Mac or PC, using a script that computes the memory the weights need.

Why it exercises the concept: Reducing the memory needed by model weights is one practical use of quantization. The self-hosting guide on this site says this skill gives memory figures for each quantization level, so you can compare options before downloading.

### [Self-Hosting an AI Agent: What You Take On](https://skillalmanac.com/learn/self-hosted-ai-agent-considerations)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A guide to what you take on when an agent runs on your machine, including matching the model to your hardware and checking that it fits.

Why it exercises the concept: It names the failure quantization is meant to prevent, a model that does not fit in memory, and suggests a smaller model or a more compact quantization as the response.

## Related terms

- [Inference](https://skillalmanac.com/glossary/inference.md)
- [Self-hosted LLM](https://skillalmanac.com/glossary/self-hosted-llm.md)
- [Large language model (LLM)](https://skillalmanac.com/glossary/large-language-model.md)
- [Open-weights model](https://skillalmanac.com/glossary/open-weights-model.md)
- [Edge AI](https://skillalmanac.com/glossary/edge-ai.md)
- [AI model](https://skillalmanac.com/glossary/ai-model.md)
- [Mixture of experts (MoE)](https://skillalmanac.com/glossary/mixture-of-experts.md)
- [GPTQ](https://skillalmanac.com/glossary/gptq.md)
- [Mixed-precision training](https://skillalmanac.com/glossary/mixed-precision-training.md)

## Sources

- [GGUF (Transformers 5.24.1)](https://huggingface.co/docs/transformers/v5.24.1/quantization/gguf), Hugging Face (Transformers documentation) (accessed 2026-11-24)
- [Quantization overview](https://huggingface.co/docs/transformers/en/quantization/overview), Hugging Face (Transformers documentation) (accessed 2026-11-23)
- [What is quantization?](https://www.ibm.com/think/topics/quantization), IBM (accessed 2026-11-23)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
