Glossary
Model quantization
Storing and running a model’s weights, and sometimes its activations, in lower numerical precision such as 8-bit or 4-bit integers, so it needs less memory and runs faster.
Model quantization is the practice of storing and running a neural network’s weights in lower numerical precision than they were trained in, for example 8-bit or 4-bit integers instead of 16-bit floating point numbers. A large language model is mostly a very large collection of numbers, and each one takes memory to store and bandwidth to move. Halve the bits per number and you roughly halve the memory the model needs, which lets it fit on smaller or fewer GPUs and often makes generation faster. The cost is a small loss of accuracy that grows as precision drops: 8-bit quantization is close to lossless for most models, 4-bit is usually a good trade, and below that quality falls off more sharply. Quantization is the main reason large open weight models can run on a single GPU or a laptop. It should not be confused with vector quantization, which compresses embeddings in a search index rather than the weights of a model.
How quantization works
Models are usually trained in 32-bit or 16-bit floating point formats such as FP32, FP16 or BF16. Quantization maps those values onto a smaller set of numbers. In the simplest scheme you take a group of weights, find their range, and divide it into evenly spaced levels: 256 levels for 8-bit, 16 levels for 4-bit. Each weight is stored as the index of its nearest level, together with a scale factor, and sometimes a zero point, for the group. At run time the values are scaled back up, either before the matrix multiplication or inside a kernel that works on the low-precision numbers directly.
Groups matter. One scale for an entire matrix wastes precision, because a few large values stretch the range for everyone else. Most methods therefore quantise in blocks of 32 to 128 weights, each with its own scale, which keeps error low for a small storage overhead. Language models also contain outlier features: a handful of dimensions with values far larger than the rest. Early research on 8-bit inference, published as LLM.int8() in 2022, found that handling those outliers separately in higher precision was what made 8-bit quantization of large models work without quality loss.
The memory arithmetic is simple. A 70-billion-parameter model in 16-bit precision needs about 140 GB for its weights alone. In 8-bit that drops to about 70 GB, and in 4-bit to about 35 GB plus a few gigabytes for scales. That is the difference between needing two 80 GB GPUs and fitting on one, before counting the KV cache that grows with the length of the context window in use.
Why quantization speeds up inference
Generating text one token at a time is usually limited by memory bandwidth rather than arithmetic. For every new token the GPU has to read most of the model’s weights from memory, and that read takes longer than the multiplications it feeds. Fewer bytes per weight means less to read per token, so a 4-bit model can generate noticeably faster than the same model in 16-bit on the same hardware, even though the maths is no simpler. This is why quantization helps the decode phase most, and why it reduces LLM latency between tokens more than time to first token, which is dominated by processing the prompt.
Newer data centre GPUs also support 8-bit floating point (FP8) arithmetic natively, which speeds up the compute-heavy parts too. Several hosted providers serve models in FP8, and some models are now trained partly in FP8 so that serving in that format loses almost nothing.
Common methods and formats
Post-training quantization converts a finished model without further training, and it is what most people use. Round-to-nearest is the simplest form and works well at 8 bits. At 4 bits, smarter methods help. GPTQ, published in 2022, quantises one layer at a time and adjusts the remaining weights to compensate for the error introduced, using a small calibration dataset. AWQ, from 2023, protects the small share of weights that matter most for the activations it sees during calibration. Both are widely used for GPU serving.
For running models on CPUs and laptops, the GGUF file format used by llama.cpp is the common choice. It offers a ladder of quantization types, often written as Q8_0, Q5_K_M or Q4_K_M, that mix precisions across layers. Q4_K_M is a popular default because it keeps quality close to the original while cutting size by about three quarters.
Quantization-aware training goes further by simulating low precision during training or fine-tuning, so the model learns weights that survive rounding. It produces better results at very low bit widths, but it needs a training run, so it is mostly done by model developers rather than by teams deploying someone else’s model.
Quantization also pairs with training methods. QLoRA stores a frozen base model in 4-bit precision and trains small LoRA adapters on top, which made it possible to fine-tune very large models on a single GPU.
What gets quantised
Weights are the main target, because they make up most of the memory. Activations, the intermediate values computed during a forward pass, can be quantised too, which speeds up the arithmetic but is harder to do without accuracy loss because activations have wider and less predictable ranges. Schemes are often written as W4A16, meaning 4-bit weights with 16-bit activations, or W8A8 for 8-bit throughout.
The KV cache is a third target. For long prompts and many concurrent users the cache can take more memory than the weights, and storing it in 8-bit or lower lets a server handle longer contexts or more parallel requests. Quality effects here show up mostly on tasks that depend on precise recall from far back in a long input, which are already weak spots for long-context models.
Quantization with hosted models
If you call a model through an API, quantization is mostly out of your hands, but it still affects you. Providers choose the precision they serve, and some offer the same open model at different prices partly because of how it is quantised. When a model behaves differently on two providers, precision is one of the first things to check. An LLM gateway that sends the same request to several providers makes these differences easier to spot, and model routing can send demanding requests to a full-precision endpoint while routine ones go to a cheaper quantised one.
Running a quantised model yourself makes most sense when data cannot leave your environment, when you need a fixed cost for high volume, or when you want a local model for development. Coding assistants are a common example: developers run a 4-bit model on a laptop for autocomplete and send harder requests to a hosted model. Large offline jobs are another, since batch inference on your own quantised model can be cheaper than paying per token.
Trade-offs in practice
Precision | Memory for a 70B model | Typical quality | Common use |
|---|---|---|---|
16-bit (FP16, BF16) | About 140 GB | Reference | Training, high-end serving |
8-bit (INT8, FP8) | About 70 GB | Near identical | Production serving |
4-bit (GPTQ, AWQ, Q4) | About 35 to 40 GB | Small measurable loss | Single-GPU and local serving |
3-bit and below | Under 30 GB | Clear loss, task-dependent | Constrained hardware |
Averages hide where the loss lands. Quantization tends to hurt long multi-step reasoning, maths, code and rare languages before it hurts everyday chat, and smaller models lose more than larger ones at the same bit width. A model that looks fine on a general benchmark can slip on the specific task you care about, so evaluate the quantised model on your own golden dataset, not only on public leaderboards. Normal LLM evaluation practice applies, with the unquantised model as the baseline.
There is also a question of which way to save memory. A 4-bit 70B model and a 16-bit 13B model need similar amounts of memory, and the larger quantised model is often the better choice. When even that is too large, distillation into a smaller model is the next step, and the two are often combined.
Where Exabase fits
Exabase does not host or quantise models. Quantization is a decision for whoever serves your model, whether that is your own infrastructure or an API provider. Exabase works on what goes into the model: the context.
That matters more as models get smaller and cheaper. A quantised or distilled model has less slack for noisy input, and long prompts full of old conversation turns and loosely related chunks also inflate the KV cache, which eats into the memory quantization saved. Exabase Memory replaces full conversation history with a few hundred tokens of relevant facts, and Deep Search returns the passage that answers a question with page numbers or timestamps rather than several pre-cut chunks. Shorter, more precise prompts reduce cost per request regardless of how the model is served, which is the point of the token cost solution. Our post on cheap models with good context covers why this combination works, and the rate limiting docs cover request limits if you are planning throughput.
For teams running their own quantised models in a multi-tenant product, each customer’s context can live in its own Base, so one shared model serves every tenant while their data stays isolated. Our best AI agent infrastructure roundup covers how these layers fit together.
Frequently asked questions
Does quantization reduce model quality?
A little. 8-bit quantization is close to lossless for most large models, 4-bit costs a small, measurable amount, and quality drops faster below 4 bits. The effect varies by task, so test on your own data.
What is the difference between 4-bit and 8-bit quantization?
8-bit stores each weight in one byte and keeps quality almost unchanged. 4-bit halves the memory again, which often lets a model fit on one GPU, at a modest cost in accuracy.
Is model quantization the same as vector quantization?
No. Model quantization compresses the weights of a neural network. Vector quantization compresses stored embeddings in a search index. Both trade precision for memory.
What are GPTQ, AWQ and GGUF?
GPTQ and AWQ are post-training methods for quantising models to around 4 bits, mostly for GPU serving. GGUF is the file format used by llama.cpp for running quantised models on CPUs and laptops.
Does quantization make models faster?
Usually, for generation. Producing each token is limited by how fast weights can be read from memory, so fewer bytes per weight means faster tokens. Prompt processing speeds up less.
Should I use a quantised large model or an unquantised small one?
At the same memory budget, a 4-bit large model often beats a 16-bit small one. Evaluate both on your own tasks before deciding.
Can Exabase run quantised models?
No. Exabase does not host models. It provides memory, search and storage that supply precise context to whichever model you run, quantised or not.
Related pages: LoRA, distillation, open weight models, inference, KV cache, vector quantization, binary quantization, LLM latency, token cost solution