Main Point: Quantization reduces the set of values used to represent selected model components. A smaller weight payload is useful only if the complete service still meets its quality, memory, speed and cost requirements.
Key Points
- Identify which components and numerical formats are being changed.
- Include scales, metadata, layout and runtime state in the deployment footprint.
- Compare cost per task that meets the required quality and service target.
1. The Four-Bit Proposal
- An umbrella retailer wants its customer assistant to use less memory. A supplier says the model can be made “four-bit.” That may sound like a complete answer: smaller numbers, fewer devices, lower cost.
- But which numbers are smaller? What extra information is needed to use them?
- And will the assistant still answer customers well and on time?
2. Values, Codes, and Components
- Quantization maps values into a smaller set of representable levels. If several original values must share one stored level, some detail is lost.
- The numerical values used later can therefore change.
- Consider a classroom example. Suppose the allowed levels are tenths and a weight is zero point one three seven.
- A rounding rule might store it as zero point one. The difference is zero point zero three seven.
- That might be harmless for one calculation or matter after many calculations. We cannot tell from the small difference alone.
- Real quantization schemes are more involved than rounding every number to the nearest tenth. They can use scales, zero points, groups of values and other structures.
- The simple example tells us what kind of change to look for: the stored representation stands in for an original value under a defined mapping. We then test how the changed values affect the actual task.
- In Lesson four, we compared bit counts and floating-point formats. Quantization is a particular representation intervention.
- Saying “four bits” names a size per stored code under some scheme. It does not specify the mapping, what part of the model uses it, or whether the hardware can run it efficiently.
- The retailer's assistant has several kinds of numerical state. Weights are the model parameters learned or selected before a request.
- Weight quantization changes how those parameters are stored and used; it does not remove parameters just because each one uses fewer bits.
- Activations are values produced during a model calculation. Activation quantization changes selected values as the model runs.
- A system may quantize weights while leaving some activations in a different format, or choose another mixture after testing.
- For language generation, a KV cache stores selected attention information from earlier tokens so it can be reused while the response continues. Quantizing that cache changes a use-time memory store, not the saved weights.
- Weights, activations and the KV cache occupy different parts of the workload and can use different representations.
- So a description such as “a four-bit model” is incomplete. Are the weights four-bit?
- Which ones? Are activations or cache values also compact?
- What stays at higher precision? The answers affect memory, speed and possible quality loss.
- A useful specification names the component and method.
3. Scales, Groups, and Supported Layouts
- A compact stored code is not always the full numerical value used in a computation. A scale can relate the code to an effective value.
- In a simple scheme, the code one with a scale of one tenth can stand for one tenth. A zero point may shift where zero falls in the code range.
- Other schemes make different choices.
- A model can also divide values into groups, giving different groups their own scales. That may preserve useful detail better than one scale for everything, but the scales and other metadata need storage.
- The code payload and the supporting information travel together.
- Packing matters too. Two four-bit codes can fit in one byte in an ideal count.
- Real storage and fast execution may require padding, alignment or a particular layout. A supported kernel, meaning the program that actually runs the operation on the device, may accept some arrangements and reject or slowly handle others.
- To estimate the complete deployment footprint, add scales, metadata, temporary values, activations, the KV cache, software buffers and other runtime state to the weight payload.
- Check that the selected hardware has an efficient kernel for the scheme.
4. Theoretical Weight Payload
- Use a hypothetical large model: seventy billion parameters. Suppose each saved weight occupies two bytes.
- Seventy billion times two gives one hundred forty billion bytes. In decimal units, where one gigabyte is one billion bytes, the weight payload is one hundred forty gigabytes before other state.
- Now suppose each weight could be represented with four bits. Eight bits make a byte, so four bits are half a byte in the ideal packed count.
- Seventy billion times half a byte gives thirty-five billion bytes, or thirty-five decimal gigabytes. The theoretical weight payload is one quarter of the two-byte version.
- That is a significant arithmetic difference. It is still not proof that a thirty-five-gigabyte device can run the complete model.
- Actual weights may require scales and metadata. Packing and layout can change the footprint.
- During a request, activations, cache values and other temporary state also occupy memory. Some values may stay in a different format.
- The service must measure its actual peak and steady memory use.
- The same caution applies to speed. Moving fewer weight bytes may help when weight traffic is the limiting stage.
- The bit-count calculation does not tell us how quickly the chosen device unpacks values, whether an efficient kernel is supported, or how long customers wait for the whole answer.
| Weight Representation | Ideal Bytes Per Parameter | Payload For 70 Billion Parameters |
|---|---|---|
| 16 bits | 2 | 140 GB |
| 4 bits, ideal packing | 0.5 | 35 GB |
Units: Decimal GB = 1 billion bytes. The 4-bit payload is one quarter of the 16-bit payload. Add scales, metadata and runtime state before selecting device capacity.
5. Preparation and Task Evaluation
- There are different procedures for creating a quantized model. Post-training quantization applies after a training phase.
- Some methods use representative examples to calibrate how compact levels should be chosen or scaled. The examples should reflect the intended use well enough to reveal important behavior.
- Quantization-aware training accounts for selected quantization effects while the model is being learned or adjusted. It can have a different preparation cost and may achieve different quality from a conversion done after training.
- Neither label guarantees success. The method, model, data, software support and task all matter.
- For the retailer, testing should include ordinary customer questions and difficult cases where an incorrect answer would be costly. We should compare the compact assistant with the original under the same task definition.
- A small change in an average score could hide a severe failure in a narrow but important group of requests. The service must meet its required quality and response-time targets.
- Compact weights may reduce memory traffic. They may allow the assistant to use fewer devices, serve more requests at once, or consume less energy.
- Supported hardware can sometimes compute efficiently on the compact format. These are possible benefits to measure.
- Unpacking, extra metadata or an incompatible kernel can offset the expected latency savings.
- If the retailer's customer reply waits mainly on an inventory tool, a network call or a queue, reducing weight bytes will not remove that wait. A smaller model can also lose answer quality, prompting more human review or failures to correct.
6. Cost per Qualifying Task
- The economic comparison is cost per qualifying task. Count the assistant responses that actually meet the required quality and service time, then include hardware, energy, engineering and evaluation costs.
- If compression changes the deployment design, compare the before and after systems as they really operate. A lower raw memory number is one input to that decision.