Language models

What is quantization in AI?

In short

Quantization is shrinking an AI model by storing its internal numbers with fewer digits of precision. The model then needs much less memory and runs faster and cheaper, usually with only a small loss in quality.

A model is billions of numbers. Stored at full precision, each takes 2 or 4 bytes. Rounded to 8 or 4 bits, the same model can be a quarter of the size. It is like saving a photo in a smaller format: a little detail is lost, but it looks almost the same.

Mini course

3 short lessons, about 2 minutes in total

  1. Models are mostly numbers
  2. Rounding without breaking
  3. When it matters to you

Lesson 1

Models are mostly numbers

Everything a model has learned is stored as parameters, billions of decimal numbers. The memory needed is roughly the number of parameters times the bytes per number. A 70 billion parameter model at 2 bytes each needs about 140 gigabytes, more than most single chips hold.

Quantize
Result
Smaller file
Runs locally
Quantization stores a model's numbers with less precision, so the same model needs less memory and runs on cheaper hardware

Tap a box to open that concept

Quantization cuts the bytes per number.

Lesson 2

Rounding without breaking

Most numbers in a model do not need many decimals. Quantization rounds them to a smaller range, for example 256 possible values instead of thousands. Clever methods keep the most important numbers more precise and round the rest harder.

The result is a model a half or a quarter of the size, with answers that are nearly the same.

Lesson 3

When it matters to you

If you plan to run an open model on your own hardware, quantization decides which model fits on which machine. Check the version you download, such as 8-bit or 4-bit, and test it on your real tasks. Choose the highest precision that fits your hardware and speed needs.

  1. Customers find youHow customers and AI tools find the companySEOGEOGoogle AI Overviews
  2. AI in daily workTools staff and customers useChatbotAI copilotVoice AI
  3. Building blocksHow AI connects to data and systemsRAG (retrieval-augmented generation)AI agentMCP (Model Context Protocol)
  4. AI modelsThe models that understand and createQuantizationLarge language model (LLM)Generative AIMachine learning
  5. DataCompany data, gathered and cleanedData warehouseETLData quality
  6. InfrastructureCloud, networks and systems underneathCloud computingDatabaseAPI key
Trust and rulesSecurity, law and control in every layerGDPR and AIEU AI ActAI guardrails
Where Quantization sits in a company's AI setup

If you only use AI through cloud APIs, the provider handles this for you.

An everyday example

An open model that needs an expensive data center card at full size can, after 4-bit quantization, run on a well-equipped laptop.

How companies use it

Companies use quantized models to run AI on their own servers or devices at lower cost, and AI providers use the technique to serve more users on the same chips.

Frequently asked questions

Does quantization make the model worse?

A little. At 8 bits the loss is usually hard to notice. At 4 bits or lower, test on your tasks.

Do I need to quantize models myself?

Rarely. Popular open models are published in ready-made quantized versions.

Is a quantized model the same as a small model?

A quantized model is not the same as a small model. Quantization compresses the same model, while a small model has fewer parameters to begin with. The two can be combined.

In depth: Quantization

The full picture, about 4 minutes of reading

Making AI models smaller

Quantization is a way of shrinking an AI model by storing its internal numbers with less precision. The model then needs much less memory, runs faster and costs less to use, usually with only a small loss in quality.

It is a bit like saving a photo in a smaller file format. Some fine detail is lost, but for most uses the picture looks almost the same, and it takes up a fraction of the space. For AI models, that difference in size can decide whether a model runs on an ordinary computer or needs expensive data center hardware.

Why model size is a problem

Everything an AI model has learned is stored as parameters, a very large set of decimal numbers adjusted during training. Large language models, the kind behind tools such as ChatGPT and Claude, have billions of them. To use the model, all those numbers must sit in fast memory, usually on a graphics card, a chip built for the kind of math AI needs.

The memory needed is roughly the number of parameters multiplied by the space each number takes. At the precision models are usually trained with, each parameter takes two bytes or more. A model with tens of billions of parameters therefore needs far more memory than a normal laptop or even a single typical graphics card has. Memory is also what limits speed and how many users one machine can serve. Smaller numbers solve several problems at once.

How it works

Most numbers in a model do not need many decimals to do their job. Quantization rounds them to a smaller set of possible values. At full precision a number can take a huge range of values. At 8 bits it can take 256 different values, and at 4 bits only 16. Each step down halves the memory per number, so an 8-bit model is about half the size of a 16-bit one, and a 4-bit model about a quarter.

Simple rounding would damage the model. Good methods are smarter. They group numbers and give each group its own scale, so the rounding fits the values in that group. They keep the most important numbers more precise and round the rest harder. Some test the model on sample text during the process to see where rounding hurts most. Some even continue training a little after quantization so the model can adjust.

What you lose

At 8 bits, the loss in quality is usually hard to notice in normal use. At 4 bits, most models still perform well, but differences start to show on harder tasks: long reasoning, math, rare facts, precise instructions and languages other than English. Below 4 bits, quality often drops clearly.

The effect also depends on the model. Larger models tend to handle quantization better than small ones, because they have more room to spare. That leads to a useful rule of thumb: a larger model quantized to 4 bits often beats a smaller model at full precision that needs the same memory. But rules of thumb are not guarantees, so test on your own tasks.

Quantization, small models and other tricks

Quantization is not the same as using a small model. A small language model has fewer parameters to begin with. Quantization keeps the same parameters but stores them more compactly. The two are often combined: a small model, quantized, can run on a phone.

There are other ways to make models cheaper, such as distillation, where a small model is trained to copy a large one, and pruning, where parts of the model that contribute little are removed. Quantization is the most widely used because it is relatively simple and works on almost any model. AI providers use it too, to serve more users on the same chips, so cloud models are often quantized behind the scenes.

What it means for a small business

If your company only uses AI through cloud services and their APIs, quantization is something the provider handles, and you do not need to think about it. It matters when you want to run an open model, one whose files can be downloaded, on your own computer or server, for example to keep sensitive data in-house.

In that case, quantization decides which model fits on which machine. Popular open models are published in ready-made quantized versions, so you rarely need to do it yourself. Choose the highest precision that fits your hardware and speed needs, and test the version you pick on a set of your real tasks before relying on it.

Curious what this could mean for your company? Book a call.

Book a call