Inferensys

Glossary

Quantization

A model compression technique that reduces the numerical precision of weights, activations, or gradients to decrease model size, communication overhead, and inference latency.
ML engineer working on model compression and quantization, laptop showing performance benchmarks, technical workspace.
MODEL COMPRESSION

What is Quantization?

Quantization is a model compression technique that reduces the numerical precision of weights, activations, and gradients to decrease computational overhead and latency in distributed systems.

Quantization maps continuous high-precision values (e.g., 32-bit floating-point) to a discrete set of lower-precision representations (e.g., 8-bit integers). This reduces the memory footprint and accelerates inference by leveraging efficient integer arithmetic on modern hardware. In federated learning, quantizing model updates before transmission drastically cuts communication overhead, a primary bottleneck in bandwidth-constrained edge deployments.

The process introduces a trade-off between compression ratio and model fidelity. Post-training quantization applies the transformation after training, while quantization-aware training simulates low-precision effects during optimization to recover accuracy. Common schemes include uniform affine mapping and non-uniform logarithmic quantization, with the latter better preserving small-magnitude gradient information critical for convergence in federated averaging.

NUMERICAL PRECISION REDUCTION

Key Characteristics of Quantization

Quantization compresses neural networks by mapping high-precision weights and activations to lower-bit representations, dramatically reducing model size and inference latency with minimal accuracy loss.

01

Bit-Width Reduction

The core mechanism of quantization is reducing the numerical precision of model parameters. Standard training uses 32-bit floating point (FP32). Quantization maps these values to 8-bit integers (INT8) or even lower, such as 4-bit (INT4). This directly shrinks the model's memory footprint by up to 4x, enabling deployment on resource-constrained edge devices and reducing bandwidth for federated gradient transmission.

4x
Memory Reduction (FP32→INT8)
2-4x
Inference Speedup
02

Quantization-Aware Training (QAT)

Unlike post-training quantization, QAT simulates the effects of low-precision arithmetic during the forward and backward passes of training. The model learns to adapt its weight distribution to minimize accuracy degradation caused by the quantization error. This method consistently yields higher accuracy than post-training approaches, especially for aggressive bit-widths like 4-bit quantization, making it essential for production-grade compressed models.

03

Scale Factor and Zero-Point

Quantization maps floating-point values to integers using an affine transformation defined by two parameters:

  • Scale Factor (Δ): A floating-point step size that determines the resolution of the mapping.
  • Zero-Point (z): An integer value that corresponds to the real value zero, ensuring that zero is exactly representable. The mapping formula is: r = S(q - Z), where r is the real value and q is the quantized integer. Proper calibration of these parameters is critical to preserving dynamic range.
04

Symmetric vs. Asymmetric Quantization

Two primary mapping schemes exist:

  • Symmetric Quantization: Maps the floating-point range symmetrically around zero, using a single scale factor and a zero-point fixed at 0. This simplifies hardware implementation but can waste precision if the data distribution is skewed.
  • Asymmetric Quantization: Uses a non-zero zero-point to map the exact minimum and maximum of the data range. This provides better utilization of the quantized range for skewed distributions, such as those produced by ReLU activations, but adds computational overhead.
05

Per-Tensor vs. Per-Channel Granularity

The granularity of quantization parameters significantly impacts accuracy:

  • Per-Tensor Quantization: A single scale factor and zero-point are calculated for an entire weight tensor. This is fast but can cause significant error if the magnitude of weights varies drastically across channels.
  • Per-Channel Quantization: Separate scale factors and zero-points are assigned to each output channel of a convolutional filter. This finer granularity preserves the distinct dynamic ranges of different filters, resulting in much higher post-quantization accuracy for vision models.
QUANTIZATION CLARIFIED

Frequently Asked Questions

Precise answers to the most common technical questions about reducing numerical precision in machine learning models, with a focus on federated systems.

Quantization is a model compression technique that reduces the numerical precision of a neural network's weights, biases, and activations—typically mapping 32-bit floating-point (FP32) values to lower-bit representations like 8-bit integers (INT8) or 16-bit floats (FP16). This process significantly decreases the model's memory footprint and accelerates inference by leveraging faster integer arithmetic on modern hardware. The core mechanism involves defining a scaling factor S and a zero-point Z to linearly map a floating-point range [r_min, r_max] to an integer range [q_min, q_max] using the formula r = S(q - Z). In federated learning, quantization is applied to model updates (gradients or weights) before transmission from client to server, directly reducing communication overhead—a critical bottleneck in bandwidth-constrained edge deployments.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.