Inferensys

Glossary

Post-Training Quantization

A compression method that converts a pre-trained floating-point model to a lower-precision integer format without retraining, using a small calibration dataset to minimize accuracy degradation.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
MODEL COMPRESSION

What is Post-Training Quantization?

A compression method that converts a pre-trained floating-point model to a lower-precision integer format without retraining, using a small calibration dataset to minimize accuracy degradation.

Post-Training Quantization (PTQ) is a one-shot model compression technique that maps the high-precision 32-bit floating-point (FP32) weights and activations of a trained neural network to a lower-precision integer format, typically 8-bit integer (INT8). Unlike Quantization-Aware Training (QAT), PTQ requires no access to the original training pipeline or labeled dataset, using only a small, unlabeled calibration dataset of a few hundred samples to determine optimal scaling factors and zero-points for each tensor.

This conversion drastically reduces the model's memory footprint and accelerates inference by leveraging fast integer arithmetic on hardware like CPUs and NPUs, making it essential for deploying diagnostic AI on Jetson Orin or scanner-side devices. The primary trade-off is a potential drop in accuracy, as the reduced precision introduces quantization error; however, modern calibration methods like percentile-based range setting and per-channel quantization minimize this degradation to near lossless levels for most convolutional architectures.

MECHANISMS & TRADE-OFFS

Key Characteristics of Post-Training Quantization

Post-training quantization (PTQ) converts a pre-trained floating-point model to a lower-precision integer format using a small calibration dataset, eliminating the need for costly retraining while enabling significant inference speedups on edge hardware.

01

Calibration-Driven Precision Mapping

PTQ relies on a representative calibration dataset—typically 100-1000 unlabeled samples—to determine the optimal clipping range for each tensor. The process records the dynamic range of activations during a forward pass and selects quantization parameters (scale and zero-point) that minimize information loss:

  • Min-max calibration: Uses the absolute min/max values observed, sensitive to outliers
  • Percentile calibration: Discards extreme outliers (e.g., 99.99th percentile) for tighter ranges
  • KL divergence calibration: Minimizes the information loss between the original FP32 distribution and the quantized INT8 representation
  • Mean Squared Error calibration: Directly minimizes the MSE between original and quantized outputs The choice of calibration algorithm directly impacts the accuracy-quantization trade-off and must be validated against the target domain's data distribution.
100-1000
Calibration Samples Needed
4x
Typical Model Size Reduction
02

Symmetric vs. Asymmetric Quantization Schemes

PTQ supports two fundamental mapping strategies that determine how floating-point values are projected onto integer grids:

  • Symmetric quantization: Maps the floating-point range symmetrically around zero, using a single scale factor. This simplifies hardware implementation because zero-point is always zero, making it the default for weight quantization in frameworks like TensorRT
  • Asymmetric quantization: Uses both a scale factor and a non-zero zero-point to map a min/max range that is not centered on zero. This better captures activation distributions (e.g., ReLU outputs are always positive) but adds computational overhead during matrix multiplication
  • Per-tensor quantization: Applies a single scale/zero-point to an entire tensor, maximizing throughput
  • Per-channel quantization: Assigns unique quantization parameters to each channel dimension, preserving finer granularity at the cost of slightly more complex dequantization logic Most production deployments use symmetric per-tensor for weights and asymmetric per-tensor for activations.
INT8
Most Common Target Precision
03

Accuracy Recovery with Bias Correction

Quantization introduces systematic bias in layer outputs because the rounding operation shifts the mean of the distribution. Bias correction is a lightweight post-hoc fix that absorbs this shift into the layer's bias term without retraining:

  • After calibration, compute the expected quantization error for each channel: E[Wx] - E[Q(W)Q(x)]
  • Absorb this error into the existing bias parameter: bias_corrected = bias + error
  • This technique is particularly effective for depthwise-separable convolutions and transformer attention layers where small per-channel shifts compound across the network
  • Advanced implementations also apply AdaRound (Adaptive Rounding), which learns whether to round each weight up or down during quantization rather than using nearest-neighbor rounding, recovering up to 1-2% absolute accuracy on challenging models like MobileNetV2 and EfficientNet.
< 0.5%
Typical Accuracy Drop (INT8)
04

Hardware-Aware Quantization Profiles

Not all INT8 implementations are equal. PTQ must target the specific quantized operator set supported by the inference accelerator:

  • NVIDIA TensorRT: Supports INT8 with per-channel weight quantization and per-tensor activation quantization, leveraging Tensor Cores for 2x throughput over FP16
  • Intel OpenVINO: Uses symmetric INT8 for convolutions and fully-connected layers, optimized for DL Boost (VNNI) instructions on Xeon processors
  • ARM CMSIS-NN: Targets Cortex-M microcontrollers with INT8 symmetric per-tensor quantization, requiring explicit requantization steps between layers
  • Qualcomm Hexagon DSP: Supports asymmetric INT8 with per-channel weights, optimized for the HVX vector extensions
  • Cross-platform ONNX Runtime: Provides a unified quantization API that maps to backend-specific implementations, enabling write-once-deploy-anywhere workflows Selecting the wrong quantization profile can result in a model that is mathematically correct but fails to accelerate on the target silicon.
2-4x
Inference Speedup on Edge NPUs
05

Quantization-Aware Training vs. PTQ Decision Boundary

The choice between PTQ and quantization-aware training (QAT) depends on the model's sensitivity to precision loss:

  • PTQ is sufficient when: The model is over-parameterized (e.g., ResNet-50 on ImageNet), the target precision is INT8, and the calibration dataset is representative. PTQ achieves near-lossless compression for most convolutional architectures
  • QAT is required when: The model is highly optimized and compact (e.g., MobileNetV3, EfficientNet-EdgeTPU), the target precision is INT4 or lower, or the task requires fine-grained predictions (e.g., small object detection, medical image segmentation)
  • Hybrid approach: Apply PTQ to the backbone and QAT to the sensitive head layers, balancing development cost with accuracy
  • Sensitivity analysis: Tools like NVIDIA's polygraphy or Qualcomm's AIMET can identify which layers are most vulnerable to quantization error, guiding where to apply QAT selectively For diagnostic imaging models deployed at the edge, PTQ with per-channel quantization and bias correction is the default starting point before escalating to QAT.
INT4
Precision Requiring QAT
INT8
Precision Safe for PTQ
06

Calibration Data Distribution Mismatch Risks

The calibration dataset must faithfully represent the inference-time data distribution, or the quantized model will suffer from silent accuracy degradation:

  • Domain shift failure mode: A model calibrated on natural images and deployed on medical CT scans will have mismatched activation ranges, causing clipping artifacts that manifest as reduced sensitivity to subtle lesions
  • Batch normalization fusion: During PTQ, batch norm parameters are folded into the preceding convolution weights. If calibration data statistics differ from training data, the fused weights will encode incorrect normalization, compounding quantization error
  • Mitigation strategies: Use a calibration set drawn from the target deployment population, apply Hounsfield Unit normalization for CT data before calibration, and validate quantized model outputs against the FP32 baseline on a held-out test set
  • Monitoring in production: Deploy runtime range observers that track activation statistics post-deployment, triggering recalibration if the distribution drifts beyond acceptable thresholds For regulated medical device software, the calibration dataset and its provenance must be documented as part of the FDA submission package.
5-15%
Accuracy Loss from Mismatched Calibration
Quantization Strategy Comparison

Post-Training Quantization vs. Quantization-Aware Training

A technical comparison of the two primary methods for converting floating-point neural networks to integer precision for edge deployment.

FeaturePost-Training QuantizationQuantization-Aware Training

Training Requirement

No retraining required; uses a small calibration dataset

Requires full or fine-tuning training cycle

Accuracy Preservation

0.5-3% accuracy drop typical for 8-bit

< 0.5% accuracy drop typical for 8-bit

Data Dependency

100-1000 representative calibration samples

Full training dataset required

Compute Cost

Minutes on a single CPU

Hours to days on GPU cluster

Quantization Simulation

No quantization simulation during training

Simulates quantization effects during forward/backward pass

Weight and Activation Precision

INT8 weights and activations

INT8 weights and activations

Suitability for Complex Models

May fail on lightweight or highly optimized architectures

Robust across all model architectures

Integration Complexity

Drop-in post-processing step

Requires modification of training pipeline

POST-TRAINING QUANTIZATION

Frequently Asked Questions

Clear, technical answers to the most common questions about converting floating-point diagnostic models to efficient integer formats for edge deployment.

Post-training quantization (PTQ) is a model compression technique that converts the 32-bit floating-point (FP32) weights and activations of a pre-trained neural network into lower-precision 8-bit integer (INT8) representations without any retraining. The process works by first collecting representative calibration data—typically a few hundred unlabeled samples from the target domain—and passing them through the original FP32 model. A calibration algorithm then analyzes the dynamic range of activations at each layer, computing optimal scale factors and zero-points that map floating-point values to integers. During inference, all matrix multiplications and convolutions execute in INT8 precision, dramatically reducing memory bandwidth and compute requirements while introducing only a marginal drop in diagnostic accuracy 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.