What is model quantization and how does it reduce LLM cost?
Quantization stores model weights and activations in fewer bits, which shrinks memory and speeds up inference at some accuracy cost. Here is how it works, the main schemes, and what interviewers probe for.

TL;DR
- Model quantization compresses model numbers by mapping high precision weights and activations to lower precision, for example from -bit floats to -bit integers.
- That reduces memory, cache pressure, and bandwidth, giving lower inference cost and faster latency on many CPUs and specialized hardware.
- You can use uniform, symmetric, per-channel and mixed precision schemes depending on accuracy needs and hardware support. Key tradeoffs: lower precision cuts cost and latency but can drop accuracy and require calibration or fine tuning.
In this question, we will learn what model quantization is and how it reduces LLM cost.
We will cover the following:
- The intuition
- How it actually works (with a worked example)
- Common quantization schemes and a comparison
- Practical tips for using quantization in LLMs
- Tradeoffs and failure modes
- Interviewer-style questions
Direct answer: Model quantization reduces LLM cost by replacing high precision numbers with lower precision representations so the model uses less memory, requires less bandwidth, and performs cheaper arithmetic. With careful choice of scheme and calibration you can often quantize to -bit or lower with small accuracy loss, cutting memory and often FLOPs-equivalent compute cost by multiple times.
The intuition (an analogy that makes it click)
Think of weights and activations as water stored in many glass bottles of different sizes and shapes. Floating point is like having custom bottles with fine graduations so you can measure precisely. Quantization is like standardizing to a set of small labeled jars. You lose some granularity, but you store more water in less space and pass jars faster through the door. For many tasks the lost granularity does not change the final mix much. We choose jar sizes and labels so the important differences remain visible.
How it actually works (the real mechanics, with one concrete worked example)
At the core quantization finds a mapping from full precision values to integers using a scale and zero point . A common uniform affine mapping is:
and we reconstruct (dequantize) as
Here is a positive real scale and is an integer zero point. Both are chosen to minimize quantization error over a calibration dataset or a tensor's range.
Worked example: quantize a small weight vector from -bit float to -bit integer.
Original weights (float32):
| Index | Weight |
|---|---|
Find range: , . For unsigned -bit we often use symmetric mapping with zero point and scale
with . Quantized integers:
| Index | Float | Quantized |
|---|---|---|
Memory savings: original weights at -bit each use bits. Quantized to -bit they use bits, a times reduction. In large LLMs this scales to gigabytes saved.
Practical notes: you store the integer array plus per-tensor or per-channel scales and zero points. For inference you operate in integer or mixed integer-float arithmetic.
Types of quantization and a comparison
| Scheme | Bits | Pros | Cons |
|---|---|---|---|
| Uniform symmetric | , | Simple, efficient on many HW, single scale | May lose precision for skewed distributions |
| Uniform asymmetric (affine) | Handles nonzero-centered data with zero point | Slightly more compute to add/subtract | |
| Per-channel weight | Each output channel has its own scale, better accuracy | More parameters to store, slightly complex kernels | |
| Mixed precision | Keeps sensitive tensors high precision, big savings elsewhere | Needs profiling to choose which tensors to lower |
When quantizing LLMs we often use per-channel weight quantization and either symmetric or affine activation quantization. For very low-bit (-bit or lower) we sometimes use mixed precision: keep layernorm and embedding layers at -bit while quantizing matrix multiplications to lower bits.
Practical tips for LLMs
- Calibrate activations with representative data to pick scales. A small holdout of tokens is often enough.
- Start with per-channel weight -bit and affine activation -bit as a safe baseline. Measure perplexity or task accuracy.
- If quality drops, try mixed precision: keep layernorm, softmax, and small matrices in -bit.
- Some hardware supports efficient integer GEMM for -bit and -bit. Test latency on your target hardware, not just theoretical FLOPs.
Tradeoffs and failure modes
Quantization reduces memory, memory bandwidth, and often energy. But it introduces rounding noise that can change model outputs, especially in deep networks with many matrix multiplies. Small models or sensitive layers can suffer noticeable accuracy loss when naively quantized.
Quantizing aggressively without calibration or selective preservation of sensitive tensors can break model stability. Watch for distribution shift in activations and validate on held out prompts before deploying.
Common failure modes:
- Activation outliers cause scale choice to blow up error.
- Layernorm and softmax are sensitive and may need higher precision.
- Per-channel scales reduce error but complicate kernel implementations.
Questions the interviewer might ask
Some follow-up questions you might get:
How does per-channel quantization help?
Per-channel uses a separate scale for each output channel so values with different dynamic ranges do not share one scale. That reduces quantization bias for heavy-tail or heterogeneous channels.
What is the difference between symmetric and affine quantization?
Symmetric sets zero point and maps around zero. Affine allows a nonzero so the integer mapping can represent tensors whose range is not symmetric about zero.
When would you use -bit quantization versus -bit?
Use -bit when memory or throughput constraints are severe and you can tolerate more accuracy loss or apply fine tuning or quantization-aware training. Start with -bit for a safer tradeoff.
How do you handle activations at inference time?
You collect activation ranges via calibration, choose per-tensor scales, and either quantize activations on the fly or use mixed-precision kernels that keep activations in higher precision where needed.
Does quantization always reduce FLOPs?
Not necessarily. It reduces memory and can enable cheaper integer ops. But if hardware does not provide efficient low-bit matmul kernels you may still compute in float and only save memory, not FLOPs.
Some things to note:
- Measure on target hardware for real latency and cost numbers.
- Calibration data should be representative of inference inputs.
What the interviewer is really testing
They want to see that you understand both the math and the systems impact: how quantization maps values to integers, how scales and zero points matter, and how memory, bandwidth, and hardware support affect cost. They also want to hear about practical mitigations like per-channel scales, calibration, and mixed precision so you can deploy LLMs safely.
Further reading in the curriculum
Go deeper on the fundamentals behind this question.
- Choosing the Right Model A practical framework for navigating the 2026 model landscape and picking the right model for your use case, budget, and latency requirements.
- Inference Optimization How LLM serving works under the hood, and the techniques that make it fast, cheap, and scalable in production.
Related questions
How would you rate the quality of this article?
Prepare for your AI engineering interview
This is one of many detailed questions and explainers on StudyAIDesign. Browse the full set, work through the curriculum, and walk into your interview ready.