Post-Training Quantization (PTQ) is a model compression technique that reduces the numerical precision of a trained neural network's weights and activations (e.g., from 32-bit floating-point to 8-bit integers) to decrease memory footprint and accelerate inference, without requiring retraining. It applies a calibration process using a small, representative dataset to determine optimal scaling factors that map the float range to the integer range, minimizing accuracy loss from the precision reduction. This makes PTQ a fast, low-cost method for model deployment, especially on resource-constrained edge devices and hardware accelerators like Neural Processing Units (NPUs).
Glossary
Post-Training Quantization (PTQ)

What is Post-Training Quantization (PTQ)?
A core technique for deploying efficient models by reducing their numerical precision after training.
The process typically quantizes weights statically and activations dynamically, though static quantization fixes both. Common schemes include symmetric quantization (zero-centered) and asymmetric quantization (with zero-point offset). PTQ is distinct from Quantization-Aware Training (QAT), which simulates quantization during training for higher accuracy at the cost of compute. For embedding models and small language models (SLMs), PTQ is critical for enabling efficient semantic search and on-device inference as part of agentic memory and retrieval-augmented generation (RAG) architectures.
Key PTQ Techniques and Methods
Post-training quantization reduces a model's memory footprint and accelerates inference by converting its parameters to lower-precision formats after training is complete. These are the primary algorithmic approaches used to perform this compression.
Static Quantization
Static quantization (or static range quantization) pre-computes the quantization parameters (scale and zero-point) for both weights and activations using a calibration dataset before deployment. The calibration process involves running inference on representative data to observe the range of activation values.
- Process: A calibration run captures the min/max ranges of activations. These ranges are then fixed and used to quantize all subsequent inputs.
- Advantage: Eliminates runtime overhead for computing quantization parameters, leading to the fastest inference.
- Limitation: Requires a representative calibration dataset and is less flexible if input data distribution shifts.
- Typical Use: Production deployments where latency is critical and input data is stable.
Dynamic Quantization
Dynamic quantization determines the quantization range (scale and zero-point) for activations on-the-fly at runtime, for each input. The model's weights are quantized statically ahead of time.
- Process: During inference, the algorithm observes the actual range of activation values for each layer and quantizes them dynamically.
- Advantage: No calibration dataset is required, making it more adaptable to varying input distributions.
- Trade-off: Introduces computational overhead for calculating ranges during inference, which can impact latency.
- Typical Use: Models like LSTMs or transformers where activation ranges vary significantly per input (e.g., in natural language processing tasks).
Quantization-Aware Training (QAT)
While not strictly a PTQ method, Quantization-Aware Training is a critical related technique. QAT simulates quantization effects during the training or fine-tuning process, allowing the model to adapt its weights to minimize the accuracy loss from the subsequent quantization step.
- Process: Fake quantization nodes are inserted into the model graph. These nodes round and clamp values during the forward pass to mimic 8-bit precision, but gradients are calculated using the full-precision values (Straight-Through Estimator).
- Advantage: Typically yields higher accuracy than standard PTQ, as the model learns to compensate for quantization error.
- Trade-off: Requires retraining or fine-tuning, which adds computational cost and time.
- Typical Use: When PTQ alone causes unacceptable accuracy degradation for a sensitive model.
Per-Tensor vs. Per-Channel Quantization
This distinction defines the granularity at which quantization parameters are applied.
- Per-Tensor Quantization: A single set of scale and zero-point values is used for an entire tensor (e.g., all weights in a 2D kernel). This is simpler but can be less accurate if the tensor's values have a wide range.
- Per-Channel Quantization: A separate set of scale and zero-point values is used for each channel (e.g., each output channel of a convolutional filter). This accounts for variation across channels, leading to higher accuracy but slightly more complex hardware support.
- Example: In a convolutional layer with 64 output channels, per-channel quantization would use 64 different scale factors, while per-tensor would use just one.
- Hardware Note: Modern AI accelerators (like NPUs and GPUs) now commonly support efficient per-channel quantization.
SmoothQuant
SmoothQuant is an advanced PTQ algorithm designed to address the challenge of quantizing large language models and vision transformers, where activation outliers can cause significant accuracy loss. It migrates the quantization difficulty from activations to weights.
- Core Idea: It applies a per-channel smoothing factor to mathematically scale the activations down and the corresponding weights up, thereby reducing the range of activations while keeping the layer's mathematical output approximately the same.
- Process: 1) Identify the channel with the largest activation magnitude. 2) Calculate a smoothing factor to scale that channel's activations down. 3) Apply the inverse scaling to the corresponding weights.
- Result: Activations become easier to quantize (fewer outliers), enabling effective 8-bit weight and activation (W8A8) quantization for models that previously required 16-bit for activations.
- Impact: Enables the deployment of models like OPT-175B and BLOOM-176B on consumer-grade GPUs.
GPTQ & AWQ
GPTQ and AWQ are state-of-the-art, layer-wise PTQ methods for compressing Large Language Model weights to ultra-low precisions like 4-bit, 3-bit, or even 2-bit.
- GPTQ (GPT Quantization): An approximate second-order method. It quantizes weights one column at a time, using the Hessian matrix (a measure of curvature) to update the remaining, not-yet-quantized weights to compensate for the error introduced. This is highly accurate but computationally intensive during the quantization process.
- AWQ (Activation-aware Weight Quantization): A more recent method based on the observation that not all weights are equally important. AWQ identifies and preserves a small fraction (e.g., 1%) of salient weights in higher precision (FP16) by analyzing activation scales, as these weights have an outsized impact on output quality. The rest are aggressively quantized.
- Comparison: GPTQ often provides marginally better accuracy but is slower to apply. AWQ is faster and hardware-friendly, offering a better trade-off for many deployment scenarios. Both are foundational for running 70B+ parameter models on a single consumer GPU.
PTQ vs. Quantization-Aware Training (QAT)
A technical comparison of the two primary approaches for reducing the numerical precision of neural network models to optimize for inference efficiency.
| Feature / Metric | Post-Training Quantization (PTQ) | Quantization-Aware Training (QAT) |
|---|---|---|
Primary Objective | Fast model compression post-training with minimal data. | Maximize post-quantization accuracy by simulating quantization during training. |
Required Data Volume | Small calibration set (100-1000 samples). | Full or substantial portion of the original training dataset. |
Compute & Time Cost | Low. Minutes to hours on CPU/GPU. | High. Requires retraining/fine-tuning, similar to original training cost. |
Typical Accuracy Drop (FP32 -> INT8) | 0.5% - 5% (model & calibration dependent). | < 1% (often negligible with proper training). |
Integration Complexity | Low. Applied directly to a trained model file. | High. Requires modifying the training loop and model forward pass. |
Support for Complex Operators | Limited. May require custom quantization for non-standard layers. | High. Can learn to adapt non-linear, attention, or custom ops. |
Best For | Rapid deployment, batch inference optimization, embedding models. | Mission-critical applications, edge deployment, models with sensitive non-linearities. |
Toolchain Examples | TensorRT, ONNX Runtime, TFLite Converter, PyTorch FX Graph Mode. | PyTorch's |
Frequently Asked Questions
Post-training quantization (PTQ) is a critical technique for deploying efficient machine learning models, particularly relevant for embedding models used in semantic indexing and retrieval. These FAQs address its core mechanisms, trade-offs, and practical applications for engineers.
Post-training quantization (PTQ) is a model compression technique that reduces the numerical precision of a trained neural network's weights and activations after training is complete, without requiring any retraining. It works by mapping the continuous range of 32-bit floating-point (FP32) values to a discrete set of lower-bit integer (e.g., INT8) values. This process typically involves:
- Calibration: Running a small, representative dataset (the calibration set) through the FP32 model to observe the statistical range (min/max) of activation values for each layer.
- Quantization: Applying a scaling factor and zero-point to linearly transform the observed FP32 ranges into the target integer range (e.g., -128 to 127 for INT8).
- Dequantization (at runtime): During inference, the integer weights and activations are scaled back to floating-point values in a lower-precision format for computation, or operations are performed directly using integer arithmetic kernels.
The primary goal is to shrink the model size and accelerate inference by leveraging hardware that is optimized for low-precision integer math.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Post-training quantization is one technique within a broader ecosystem of methods designed to reduce model size and accelerate inference. These related concepts define the landscape of efficient model deployment.
Quantization-Aware Training (QAT)
Quantization-Aware Training is a model compression technique where the quantization error is simulated during the training or fine-tuning process. Unlike PTQ, which is applied after training, QAT allows the model to learn and adapt its weights to the lower precision format, typically resulting in higher accuracy for aggressive quantization schemes (e.g., INT4).
- Process: Fake quantization nodes are inserted into the model graph during training. These nodes round activations and weights to simulate integer arithmetic while maintaining floating-point gradients for the backward pass.
- Use Case: Essential for deploying models on highly constrained edge devices where maximum compression with minimal accuracy loss is critical.
- Trade-off: Requires retraining/fine-tuning, which adds computational cost and complexity compared to PTQ.
Weight Pruning
Weight Pruning is a model compression technique that removes less important weights (parameters) from a neural network, creating a sparse architecture. The goal is to reduce the model's memory footprint and computational cost without significantly impacting accuracy.
- Methods: Includes magnitude pruning (removing weights with the smallest absolute values) and structured pruning (removing entire neurons, channels, or layers).
- Synergy with PTQ: Pruning and quantization are often applied sequentially (prune then quantize) for compounded compression benefits. A sparse, quantized model can be extremely efficient.
- Hardware Consideration: Unstructured sparsity requires specialized hardware or libraries for speedups, as standard GPUs are optimized for dense matrix operations.
Knowledge Distillation
Knowledge Distillation is a compression and transfer learning technique where a smaller, more efficient model (the student) is trained to mimic the behavior of a larger, more accurate model (the teacher). The student learns from both the teacher's output predictions (soft labels) and the true hard labels.
- Objective: The student model achieves similar performance to the teacher but with far fewer parameters, enabling faster inference.
- Relation to PTQ: Distillation produces a compact model architecture, which can then be further optimized via PTQ. They address different axes of efficiency: distillation reduces parameter count, while quantization reduces bit-width per parameter.
- Application: Commonly used to create small language models (SLMs) from large foundation models.
Neural Architecture Search (NAS)
Neural Architecture Search is the automated process of designing optimal neural network architectures for a given task and constraint (e.g., latency, model size). NAS algorithms search a vast space of possible operations and connections to find efficient models from the ground up.
- Goal: Discovers novel, hardware-efficient architectures that often outperform human-designed counterparts like ResNet or Transformer variants under specific constraints.
- Efficiency-First NAS: Modern NAS directly optimizes for metrics like FLOPS, parameter count, or on-device latency, often discovering models inherently amenable to post-training quantization.
- Outcome: Produces a compact model that serves as an excellent starting point for subsequent PTQ.
Dynamic Quantization
Dynamic Quantization is a variant of PTQ where the scaling factors for activations are calculated on-the-fly at runtime, based on the observed range of values in each input batch. Weights are quantized statically ahead of time.
- Advantage: No requirement for a calibration dataset, simplifying the deployment pipeline. It adapts to varying input distributions.
- Disadvantage: Introduces runtime overhead for computing activation ranges, which can reduce some of the latency benefits of quantization.
- Typical Use: Often applied to models like LSTM and Transformer layers where activation ranges can be more variable. Contrast with static quantization, where activation scales are fixed during a calibration step.
INT8 Precision
INT8 Precision refers to the use of 8-bit integer representations for model weights and activations. It is the most common target precision for post-training quantization, offering a near 4x reduction in model size and memory bandwidth compared to FP32, with typically minimal accuracy degradation.
- Mechanics: Represents values in the range [-128, 127]. A floating-point tensor is mapped to this range using a scale (and sometimes a zero-point) in a linear transformation:
int8_value = round(float_value / scale) + zero_point. - Hardware Support: Universally accelerated on modern AI hardware (e.g., NVIDIA Tensor Cores with INT8, Google TPUs, Intel DL Boost, ARM DOT). This hardware support is the primary driver for INT8's popularity.
- Lower Precision: More aggressive quantizations like INT4 or binary/ternary networks offer greater compression but usually require QAT and more specialized hardware for practical speedups.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us