Inferensys

Glossary

Post-Training Quantization

A compression technique that reduces the numerical precision of a model's weights and activations from 32-bit floating-point to 8-bit integers after training, dramatically shrinking model size and accelerating inference.
ML engineer working on model compression and quantization, laptop showing performance benchmarks, technical workspace.
MODEL COMPRESSION

What is Post-Training Quantization?

A technique to reduce model size and accelerate inference by lowering numerical precision after training.

Post-training quantization (PTQ) is a compression technique that converts a model's 32-bit floating-point weights and activations to lower-precision integer formats, typically INT8, after training completes. This process dramatically reduces the model's memory footprint and accelerates inference by leveraging faster integer arithmetic available on modern CPUs and edge Neural Processing Units (NPUs).

Unlike quantization-aware training, PTQ requires no retraining or access to the original training pipeline, making it ideal for deploying existing models to resource-constrained edge nodes. The technique applies calibration data to minimize accuracy loss by analyzing activation ranges, enabling near-lossless compression for deployment in containerized micro-inference environments on the factory floor.

CORE MECHANISMS

Key Characteristics of Post-Training Quantization

Post-training quantization is a compression technique that reduces the numerical precision of a model's weights and activations from 32-bit floating-point to 8-bit integers after training, dramatically shrinking model size and accelerating inference.

01

Precision Reduction

Converts FP32 (32-bit floating-point) weights and activations to INT8 (8-bit integer) representations. This reduces the memory footprint by up to 4x and enables the use of faster integer arithmetic instructions on modern CPUs and edge accelerators. The core trade-off is between computational efficiency and a small, acceptable drop in model accuracy.

02

Calibration and Range Mapping

A critical step that determines the optimal scale and zero-point parameters to map floating-point values to integer ranges. A small, representative calibration dataset is passed through the model to observe the dynamic range of activations at each layer. Common calibration methods include:

  • MinMax: Uses the absolute min and max values.
  • MovingAverageMinMax: Tracks a moving average of min/max across batches.
  • Histogram: Uses KL divergence or MSE to find the best range that minimizes information loss.
03

Quantization Granularity

Defines the scope at which quantization parameters are computed, directly impacting the accuracy-efficiency trade-off:

  • Per-Tensor: A single scale and zero-point for an entire weight tensor. Fastest but least accurate.
  • Per-Channel: Separate parameters for each output channel of a convolutional filter. The standard for quantizing weights in CNNs, offering high accuracy.
  • Per-Group: Parameters for sub-groups within a channel, used in extreme low-bit quantization (e.g., INT4).
04

Quantization-Aware Training (QAT) vs. Post-Training Quantization (PTQ)

PTQ applies quantization after training is complete, requiring no retraining and minimal data. It is ideal for rapid deployment. QAT simulates quantization noise during training, allowing the model to learn to compensate for precision loss. QAT yields higher accuracy but requires full access to the training pipeline and dataset. PTQ is the default choice for edge deployment when training resources are unavailable.

05

Hardware Acceleration

Quantized INT8 models leverage specialized instruction sets for massive throughput gains:

  • ARM Neon / x86 VNNI: Vectorized integer dot-product instructions on CPUs.
  • NVIDIA TensorRT: Optimizes INT8 inference on GPUs with tensor cores.
  • NPU and Edge TPU: Dedicated neural processing units often require or are heavily optimized for INT8 execution, making quantization a prerequisite for deployment on these accelerators.
06

Weight-Only vs. Full Integer Quantization

Weight-only quantization compresses only the model weights to INT8, while activations remain in floating-point. This reduces memory and bandwidth but still requires floating-point compute. Full integer quantization converts both weights and activations to INT8, enabling the entire inference graph to execute with integer arithmetic. Full integer quantization is required for maximum acceleration on edge NPUs and microcontrollers.

POST-TRAINING QUANTIZATION

Frequently Asked Questions

Clear, technical answers to the most common questions about reducing model precision for edge deployment.

Post-training quantization (PTQ) is a compression technique that converts a pre-trained neural network's 32-bit floating-point weights and activations into lower-precision integer formats, typically 8-bit integers, without any further training or fine-tuning. The process works by first collecting calibration data—a small, representative sample of the training distribution—and passing it through the trained model to record the dynamic ranges of activations at each layer. A quantization scheme then maps these floating-point ranges to integer buckets using a scale factor and zero-point, enabling integer arithmetic during inference. This dramatically reduces model size by up to 4x and accelerates inference by leveraging fast integer math units on CPUs and NPUs, with minimal accuracy loss when properly calibrated.

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.