Deploying AI Models on Edge Devices: Quantization Explained

Quantization shrinks AI models up to 4x so they run on edge devices. How dynamic, full INT8 and quantization-aware training differ, and how to deploy safely.

By Galactic News Editorial · Published 2026-11-22T10:42:33+00:00 · Updated 2026-11-22T10:42:33+00:00

Deploy AI models on edge devices with quantization explained

Deploying AI Models on Edge Devices: Quantization Explained

Quantization is the main technique that makes it possible to deploy AI models on edge devices. It shrinks a model by converting its numbers from 32-bit floating point to 8-bit integers. The result is a model up to four times smaller that runs faster on phones, single-board computers, and embedded hardware. This guide explains how quantization works, which method to pick, and how to deploy without losing accuracy.

Edge devices have tight limits. A phone or a Raspberry Pi has little memory and no data-center GPU. A full-precision model may not fit at all. Even if it fits, it may run too slowly to be useful. Quantization trades a small amount of precision for a large gain in size and speed. That trade is what makes on-device inference practical.

What quantization is

Quantization maps continuous floating-point values to a smaller set of discrete values. A weight stored as a 32-bit float takes four bytes. The same weight stored as an 8-bit integer takes one byte. That is why INT8 quantization cuts model size by about four times.

The mapping is linear. Each float value is divided by a scale factor, rounded, and shifted by a zero point. The formula is simple: quantized value equals round of float divided by scale, plus zero point. The scale and zero point are chosen from the range of values in the tensor. This keeps the quantized numbers close to the originals.

Quantization applies to weights and activations. Weights are the learned parameters. Activations are the intermediate values computed during inference. Quantizing weights alone shrinks the model. Quantizing activations as well speeds up the math, because integer arithmetic is faster than floating-point arithmetic on most edge hardware.

The main quantization methods

There are three methods that matter in practice. They differ in effort, speed gain, and accuracy risk. The table below summarizes them.

MethodWeightsActivationsCalibration dataSize reductionBest for
Dynamic range (PTQ)INT8Float, quantized on the flyNoneAbout 4xQuick first deploy, no dataset handy
Full integer (PTQ)INT8INT8Representative dataset requiredAbout 4xLow latency on CPU or edge accelerators
Quantization-aware training (QAT)INT8INT8Training dataAbout 4xBest accuracy retention for INT8
FP16FP16FP16NoneAbout 2xGPUs with FP16 support

Dynamic range quantization

Dynamic range quantization is the easiest method. Weights convert from FP32 to INT8. Activations stay in float during inference and are quantized on the fly, just before each computation. It needs no calibration data. It is a one-line change in most frameworks.

The size win is immediate: about four times smaller. The speed win is modest, because activations still move through memory in float. Accuracy loss is usually minimal. Use this method first. If it meets your latency target, stop here. PyTorch offers it through torch.quantization.quantize_dynamic, which takes a model and a set of layers and returns a quantized model.

Full integer quantization

Full integer quantization converts both weights and activations to INT8. All inference math runs in integers. This gives the real speed gain on ARM CPUs and integer-only accelerators such as the Google Coral Edge TPU. It needs a representative dataset to calibrate the activation ranges. A typical calibration set is 100 to 500 samples from the validation data.

The calibration data must match real inputs. Mismatched calibration data causes silent accuracy drops. The model still runs, but its answers drift. That is the main risk of this method. In TensorFlow Lite, you supply the dataset through a representative dataset generator and set the target ops to TFLITE_BUILTINS_INT8. Input and output layers can stay in float, or convert to INT8 for integer-only hardware.

Quantization-aware training

Quantization-aware training, or QAT, models the effects of quantization during training. Fake quantization modules simulate the rounding and clamping of INT8 values in both the forward and backward passes. The model adapts to the precision loss while it trains. After conversion, the weights are truly quantized.

QAT gives the best accuracy retention for INT8 models. It typically stays within 1 percent of the FP32 baseline accuracy. The cost is training time and complexity. Use QAT when post-training quantization loses too much accuracy and the model must stay in INT8.

Deploy AI models on edge devices: the workflow

  1. Measure the baseline. Record the FP32 model's size, latency, and accuracy on your target device. You need these numbers to judge every later step.
  2. Export to a portable format. Convert the model to ONNX or a framework format such as TFLite. Declare dynamic dimensions for batch size and sequence length, or the model will fail on real inputs.
  3. Try dynamic quantization first. It needs no data and cuts size by about four times. Test latency and accuracy on the device. If it is fast enough, ship it.
  4. Move to full INT8 if needed. Collect a representative calibration dataset. Run static quantization. Compare accuracy against the FP32 baseline on the same test set.
  5. Check operator support. Some ops have no quantized version. In TFLite, unsupported ops need SELECT_TF_OPS, which adds size and slows inference. In ONNX Runtime, unsupported ops fall back to the CPU execution provider.
  6. Verify parity on the device. Run the same inputs through the FP32 model and the quantized model. Compare outputs within a tight tolerance. A conversion can silently change answers.
  7. Pick the runtime for the hardware. ONNX Runtime runs almost anywhere through execution providers. TensorRT is fastest on NVIDIA hardware, including Jetson. Core ML targets Apple devices and the Neural Engine. TFLite targets Android and microcontrollers.

Accuracy trade-offs and how to check them

Quantization always loses some precision. The question is how much accuracy that costs. Post-training INT8 quantization typically loses 1 to 3 percent accuracy on vision tasks, when the calibration data is good. Dynamic range quantization often loses under 1 percent on top-1 accuracy. QAT usually stays within 1 percent of the FP32 baseline.

Check accuracy the same way every time. Use the same test set for the FP32 model and the quantized model. Measure the metric that matters for your product, not just a proxy. If the metric drops more than your budget allows, try QAT, or keep sensitive layers in FP32.

Watch for silent failures. A bad calibration set, a missing dynamic dimension, or an unsupported op can produce a model that runs but answers wrong. Always compare outputs on real inputs after conversion. Never trust a conversion that you have not tested on the target device.

Which runtime fits your device

RuntimeBest hardwareQuantization support
TensorFlow Lite (LiteRT)Android, Raspberry Pi, microcontrollersDynamic range, full INT8, FP16
ONNX RuntimeAlmost anywhere: CPU, GPU, mobile, browserDynamic and static INT8, FP16
TensorRTNVIDIA GPUs, Jetson devicesFP16 and INT8, layer fusion
Core MLApple devices, Neural EngineFP16 and INT8 via coremltools
OpenVINOIntel CPUs and acceleratorsINT8 with calibration

Bottom line

Start with dynamic range quantization. It is one line of code, needs no data, and cuts model size by about four times. If latency still misses the target, move to full INT8 with a representative calibration dataset. If accuracy drops too far, use quantization-aware training. Pick the runtime for your hardware: ONNX Runtime for portability, TensorRT for NVIDIA, Core ML for Apple, TFLite for Android and microcontrollers. Test the quantized model on the real device, on the same inputs as the original, before you ship.