News

日本語 · English · 中文

[Teach Us, Sensei!] What Is Quantization? Understanding How It Lightens AI Models—and Its Limits

The term “quantization” has appeared in news reports as the key to running large models more efficiently. By comparing it to photo compression, we can see how this technique works by coarsening numbers, as well as the practical limitations that such an approach alone cannot resolve.

Hinata: Saeki-san, do you know about GPUs? They are components that speed up calculations in computers. I read an article about running large models with a 96GB GPU, and the term "quantization" appeared. What does that mean? I don't understand that part.

Saeki: Quantization is similar to tightly compressing a photo to reduce its file size. Instead of preserving subtle color differences, the file becomes lighter.

It’s the same for AI models. A model refers to the calculation mechanisms an AI learns and acquires. Here, "memory" refers to the temporary storage space used when running a model. By coarsening the precision of numbers, we can reduce memory usage. There is an article titled Verification of running a 320B model entirely on a 96GB GPU. They also used models with reduced capacity using this method. But what happens if we coarsen it too much? Isn’t it intriguing to know?

Hinata: I see, so it’s like compressing photos—coarsening numbers to make them lighter. It feels like the quality of answers might deteriorate if coarsened too much. What actually happens? I read Actual Measurement of LLM on RTX 3090. It said that Japanese wasn’t distorted even after reducing to 1.75 bits. That was surprising.

Saeki: That’s correct. The assumption that quality would drop if coarsened too much is accurate. However, in Actual Measurement of LLM on RTX 3090, short responses weren’t distorted even at 1.75 bits.

However, it’s still unclear how it behaves with long texts or complex instructions. It has only been verified for short ranges.

Hinata: So, it means we’ve only tested short conversations and can’t say with certainty that it’s safe yet. It seems quantization granularity is determined by numbers. But what does 1.75 bits refer to? I don’t understand the term "bits."

Saeki: Your understanding is correct; it’s only been verified for short conversations. A bit is a unit that measures the precision of information. A single switch that can only represent two states, on or off, is 1 bit.

The more switches used to represent numbers, the more precisely they can be expressed. 1.75 bits means that, on average, numbers are represented with that level of sparsity.

Hinata: So, the more switches, the more precise it gets, and fewer switches mean it becomes coarser. What’s intriguing is that 1.75 seems like a half-way number. Switches are counted as 1, 2, etc., so why do you get something like 0.75?

Saeki: That’s a sharp question. Actually, 1.75 bits doesn’t mean every switch in the entire model has exactly 1.75 bits. There are many numbers in a model. Important parts are represented with more switches, while less important parts use fewer switches. When averaged across the entire model, it comes out to 1.75.

So, there isn’t actually such a thing as "1.75 switches"; it’s purely an average value.

Hinata: I’m starting to get it. Quantization is a method to reduce memory by coarsening numbers. I understand that 1.75 bits is an average accounting for differences across parts. Still, it’s surprising that short responses weren’t distorted. If this becomes more common, will more people be able to run large models on their home PCs?

Saeki: The number of people who can run them at home should increase compared to now. However, quantization alone doesn’t solve everything. In Verification of running a 320B model entirely on a 96GB GPU, performance dropped to less than half with just a slight insufficiency. GPUs are components that speed up calculations. The memory associated with them is called VRAM. Components that handle regular calculations are called CPUs. When everything doesn’t fit into VRAM, the workload is shared between the GPU and CPU. Looking at Verification of distributing work between GPU and CPU when it doesn’t fit into VRAM, it becomes clear that efficient allocation of placement matters.

So, now is the stage where we need to consider everything, including allocation strategies. It’s still unclear whether long texts or difficult instructions will remain undistorted. Until that’s clarified, I think we can’t move to the next stage.

This article was translated from the Japanese original. 日本語で読む

← Latest articles