LLM Learning Hub

workspace/llm-course/home

Symmetric Quantization

Symmetric quantization maps float values to integers symmetrically around zero, so the zero point is always 0. It uses the maximum absolute value to set the scale, making it simpler and faster but potentially wasting range if the data is asymmetric.

What is Symmetric Quantization?

Symmetric quantization maps float values to integers symmetrically around zero, so the zero point is always 0. It uses the maximum absolute value to set the scale, making it simpler and faster but potentially wasting range if the data is asymmetric.

Symmetric quantization maps float values to integers symmetrically around zero, so the zero point is always 0. It uses the maximum absolute value to set the scale, making it simpler and faster but potentially wasting range if the data is asymmetric.

Where is it used?

Symmetric INT8 is the default for LLM weight quantization in llama.cpp (GGUF), GPTQ, and BitsAndBytes. Weights are roughly symmetric around zero (initialized with zero-mean distributions), so symmetric quantization works well. Activations like ReLU outputs are asymmetric and may need asymmetric quantization.

How to build it

Compute: `scale = x.abs().max() / 127`. Quantize: `q = torch.round(x / scale).clamp(-128, 127).to(torch.int8)`. Dequantize: `deq = q.float() * scale`. Simpler than asymmetric: no zero point to store or apply. Used when `x` is approximately zero-centered.