Explainer

What is model quantization? A plain-English guide

Model quantization shrinks an AI model by storing its numbers with less precision. Learn how it works, what it saves, and where it goes wrong.

By the Cloudverg engineering team · · 5 min read

What it is

Model quantization is a way of making an AI model smaller and cheaper to run by storing its numbers with less precision. A trained model is a huge collection of numbers, called weights. Each weight is usually saved in a format that takes 16 bits of memory. Quantization rewrites those weights using 8 bits, 4 bits, or sometimes fewer.

Think of it like rounding. If you measure a table as 71.3846 inches, you can write 71.4 and still cut the board correctly. The model loses a little detail, and in return it takes up far less space. The structure of the model stays the same. Only the numeric format changes.

It's easy to mix this up with model distillation, which trains a smaller model to imitate a bigger one. Quantization doesn't train anything new. It takes the model you already have and compresses how its numbers are stored.

How it works

The basic move is mapping. Say a set of weights ranges from about negative 2 to positive 2. A 16-bit format can represent a very fine grid of values in that range. A 4-bit format only has 16 possible values. So the software picks a scale and divides the range into 16 steps, then snaps every weight to the nearest step. To use the model, it multiplies back by the scale.

There are two common ways to do this. Post-training quantization takes a finished model and compresses it, usually in minutes to hours. It needs little or no extra data, though some methods use a small calibration set, a few hundred sample inputs, to choose better scales. Quantization-aware training builds the rounding into training so the model learns to cope with it. It usually holds quality better but costs far more effort, so most teams start with the first option.

You'll see a few format names in practice. GGUF is a file format popular for running models on ordinary machines. GPTQ and AWQ are methods aimed at GPU serving. Bitsandbytes is a library that can load models in 8-bit or 4-bit inside common Python tooling. Some methods quantize only the weights. Others also quantize activations, the values flowing through the model while it runs, which saves more but is harder to do without hurting quality.

Why it matters for a business

The main payoff is memory. A model has to fit in GPU memory to run quickly, and big models often don't fit on one card. Cutting the weights from 16 bits to 4 bits shrinks the model to roughly a quarter of its size. That can mean one GPU instead of several, or a model that runs on a workstation or edge device instead of needing a data center.

Speed often improves too, because generating text is frequently limited by how fast weights can be read from memory. Smaller weights mean less to read. You may see lower latency, higher throughput per GPU, or both. The gain depends on your hardware and serving software, so treat it as something to measure, not assume.

There's a data control angle as well. If you're weighing hosted models against open-weight models, quantization is what makes running an open model in your own environment affordable. Your prompts and documents stay on infrastructure you control, and your monthly GPU bill gets smaller. The trade is a small loss in quality, which you need to test against your own tasks.

Common mistakes

The biggest one is trusting a general benchmark instead of testing your own work. A 4-bit model might score nearly the same as the original on public tests and still stumble on your contract summaries, your SQL generation, or your support tickets in another language. Build a small test set from real tasks and compare the original and quantized versions side by side before you commit.

Second, going too low too fast. 8-bit is usually a safe first step. 4-bit works well for many models but needs checking. Below that, quality can drop sharply, especially on smaller models, which have less spare capacity to absorb the rounding. Tasks that need exact output, like math, code, and strict JSON, tend to show damage first.

Third, assuming smaller always means cheaper. If your serving stack doesn't have fast kernels for a given format, the quantized model can run slower than the original. Hardware support matters. Check that your GPU and inference software handle the format well. Also confirm the model's license allows you to modify and redistribute a compressed version.

How to get started

Start with a task you already care about and a model you already use or are considering. Write 50 to 200 real examples with the answers you'd accept. Run the full-precision model on them to set a baseline. Then run an 8-bit version, then a 4-bit one, and compare accuracy, output format errors, response time, and memory use. Pick the smallest version that still clears your quality bar.

Use existing tooling instead of writing your own. Many open-weight models are already published in quantized form, and serving tools like vLLM and llama.cpp can load them directly. Pre-made versions are fine for trials, but for production, know who made them and how, or run the quantization yourself so you can reproduce it.

If you're deciding between hosted and self-run models and want the numbers laid out, our AI readiness assessment covers this. It's $5,500/month, renews monthly until cancelled, runs two weeks at a fixed scope, and includes a reference architecture with model and hosting options plus a token, GPU and run-cost model. It's one option among several, and the same test-first approach above works fine on your own.

Frequently asked questions

Does model quantization hurt accuracy?

Usually a little, and sometimes not enough to notice. 8-bit models are often close to the original, and 4-bit models can be close too, though results vary by model and task. Tasks needing exact output, like code or structured data, show losses first, so test on your own examples.

What's the difference between quantization and distillation?

Quantization keeps the same model and stores its numbers at lower precision. Distillation trains a new, smaller model to copy a larger one. Quantization is faster and cheaper to do. Distillation can produce a model with fewer parameters, and the two can be combined.

Can I quantize a model I access through a hosted API?

No. Quantization needs the model's weights, which hosted providers don't share. It applies to open-weight models you download and run yourself. With a hosted API, any compression the provider applies is their decision, not yours.

Monthly plan

Want help with this? AI readiness assessment

$5,500/month

2 weeks · Starts within 10 business days

Two weeks to rank your AI and agent ideas by value and risk, check your data, and plan a first project with a cost model.

Renews monthly. Cancel any time.
Prefer to pay once?

Pay $5,500 once for one month of the AI readiness assessment. It ends on its own, nothing renews.

What is included

Related guides

More ai and agents guides   AI and machine learning

Smallest way to start

Get a senior architect on your problem this week

Ninety minutes a month on the cloud, AI or security question that is blocking you, a pre-read of your material and a written summary within two business days.

$450/month

Renews monthly. Cancel any time.
Prefer to pay once?

Pay $450 once for one month of the Expert architecture session. It ends on its own, nothing renews.