Quantization: how a large AI model fits on a smaller computer.

Open AI models often carry abbreviations like FP8, INT8 or INT4 in their names. They tell you how much the model has been shrunk. This is called quantization, and it is one of the main reasons a capable model can now run on a company’s own server. We explain how it works, how much memory it saves and what you pay for it.

Dots thinning out from left to right: numbers stored with less precision

Why AI models are so large

A language model is a huge collection of numbers called parameters. Think of them as tiny dials that were tuned during training so the model can write, translate and answer. The open Llama 3 model has 70 billion parameters in its large version. The largest commercial models are estimated to have trillions.

Every parameter takes up memory. It is usually stored in a 16-bit format, which is 2 bytes per parameter. A model with 70 billion parameters therefore needs about 140 GB of memory. That is more than many powerful data center graphics cards have.

What AI model quantization is

Quantization means storing the same numbers at lower precision. Instead of 16 bits, you use 8 or 4. The model then takes up less memory and computes faster. It isn’t an AI invention: sound, images and telecom signals are compressed the same way.

But you can’t simply cut off half the bits. A number is stored in parts that encode its sign, size and detail. Cut the wrong part and you get a completely different number. So the values in each layer of the model are converted to a smaller range by one consistent rule.

Simplified example

A model layer has values from 0 to 100 and you want to store them in a range of 0 to 10. The value 53 becomes 5.3 and rounds to 5. Converted back, you get 50 instead of 53. A small loss on one number, but the model has billions of them.

How much memory quantization saves

FORMATBITS PER PARAMETER70B PARAMETER MODEL
FP16 or BF1616about 140 GB
FP8 or INT88about 70 GB
INT44about 35 GB

You will often find the format right in the model’s name. When you choose an open model for your own server, this is the figure that tells you whether it fits your hardware.

A large block, a smaller block and a small cube: a model in 16, 8 and 4 bits

What you pay for a smaller model

Quantization gives and takes. You save memory and gain speed, but you lose some detail. It is like shrinking a photo: at first you see no difference, but shrink it far enough and the image breaks into squares.

  • 8 bits. Most models keep their accuracy and get noticeably faster.
  • 4 bits. A bigger cut, and the loss of accuracy is real. With a good method, though, it is usually tenths of a percent up to one percent.

For a company this means one simple rule: always test a quantized model on your own tasks. You won’t notice the loss when summarizing an email. With calculations or legal texts, the missing detail may be exactly the one that matters.

Quantization after training or during it

After training, an already finished model is shrunk. It is fast and the most common approach. During training, the model learns at lower precision from the start, so it adapts to it. That costs more time and compute, but holds up better when you shrink aggressively to 4 bits.

When quantization matters to your company

If you use Claude or another model through a web app or API, you don’t need to think about quantization. That is the provider’s job. It matters when you want to run a model yourself, for example because data must not leave your network. Then the question is how large a model your hardware can handle and how much accuracy you are willing to give up.

We described how to pick the right model for a specific task in our article on why the most expensive model for everything is the most expensive mistake.

Sources: Hugging Face, Quantization documentation; Meta, Llama 3 (2024); Jacob et al., Quantization and Training of Neural Networks for Efficient Integer-⁠Arithmetic-⁠Only Inference (2018).

Ask yourself

Does your data have to stay on your own server? Then you need to know which model fits on it and how well it performs.

Jaro Rais

Founder of itashu. Builds agents and connects AI to company systems.

The itashu assistant, a robot with a red head, waving

Have a question? Just ask.

Want to know more about our services? Interested in concrete use cases and references, whether we’ve already solved a problem like yours, or what it might all cost? Talk it through with our AI agent. It knows a lot more than you’d think.

Cookie settings

Choose which cookies we may use. You can change your choice at any time in the website footer.

Speaking

itashu assistant

Hello, I’m the itashu digital assistant. How can I help you?