Paper · 2021-12-08 · cs.LG
Neural Network Quantization for Efficient Inference: A Survey
Survey of neural network quantization for inference: number formats, quantization-aware training versus post-training quantization, and integer/fixed-point, binary, ternary and mixed-precision schemes, with comparison tables and open directions. Proposes no new method or experiments; the tables report numbers from the cited works (CIFAR-10, ImageNet).
Post-training quantizationQuantization-aware trainingLow-precision arithmeticBinary neural networkquantizationsurveyinferenceedge-deployment
AI-compiled by claude-haiku-5-5 on 2026-10-25, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.
In plain words
Neural networks are usually trained with 32-bit floating-point numbers, which makes them large and slow on small devices. Quantization stores and computes with fewer bits instead, for example 8-bit integers, so the model takes less memory and the arithmetic is cheaper. The catch is that fewer bits lose information, and accuracy can drop.
This paper is a survey of how people have handled that trade-off over the last decade. It explains how computers represent numbers, how a real value is mapped onto a small grid of integers, and the two usual ways to do it: retrain the network with the rounding in place, or quantize a finished network with little or no retraining. It then goes through integer and fixed-point schemes, binary and ternary schemes that use one or two bits per weight, and mixed precision, where each layer gets its own bit width. It ends with open problems.
The paper does not add a new method. Its value is the map of the field and the summary tables that let a reader compare the reported results.
TL;DR
- A survey, not a method: it explains number formats, the quantization function, QAT and PTQ, and four scheme families §1 §2 §3 §4.
- Integer/fixed-point schemes are the practical default; binary and ternary save the most arithmetic but lose the most accuracy §5 §6 tab. 2.
- Mixed precision gives each layer its own bit width, but the search space is exponential in the number of layers §7.
- All accuracy numbers are copied from the cited works and are author-reported, not re-measured here tab. 3 tab. 4.
Problem
Trained networks are over-parameterized and are often stored and run in 32-bit floating point. That makes them too large for edge hardware and expensive to compute §1. Floating-point arithmetic needs a dedicated unit, while integer arithmetic does not, so the survey asks how far precision can be cut before accuracy suffers §1 §2.1.
The survey assumes the reader knows basic neural networks and SGD training §1. It restricts its scope to inference: quantizing weights and activations. Gradient quantization for training is only touched on where it helps inference §1.
Method
The survey defines the basic quantization function and then reviews the schemes. The steps below are the core definitions an implementer needs, taken from the paper's own equations.
Number formats. A single-precision float stores a sign bit, an 8-bit exponent and a 23-bit mantissa fig. 1 §2.1. A fixed-point value stores a sign bit, integer bits and mantissa bits, with one global exponent that is shared by all values fig. 2 §2.2 eq. 4. Only the value of the global exponent differs per format.
Quantization function. A real value r maps to an integer through a scale
S and an integer zero point Z §3.1 eq. 5. Rounding makes the reverse
mapping inexact, so the dequantized value is only an approximation §3.2
eq. 7.
Scale. For a clipping range [alpha, beta] and bit width b, the step
size is (beta - alpha) / (2^b - 1) §3.1.1 eq. 6. The clipping range is
found by calibration. Symmetric quantization sets alpha = -beta and gives
Z = 0; asymmetric quantization chooses alpha != -beta to fit an unbalanced
range, for example after ReLU §3.1.1.
# Step size for clipping range [alpha, beta] and b bits [§3.1.1] [eq. 6]
# Inputs: alpha, beta (floats), bits (integer)
# Output: scale (float)
def step_size(alpha, beta, bits):
return (beta - alpha) / (2 ** bits - 1)# Uniform quantization of one value [§3.1] [eq. 5]
# Inputs: r (float), scale S > 0, zero_point Z (integer)
# Output: integer Q(r), not clipped to a bit range here
def quantize(r, scale, zero_point):
# Scale the value, then round it to the integer grid [§3.1]
level = round(r / scale)
# The paper subtracts the zero point [eq. 5]
return level - zero_point
# Reverse mapping; not equal to r because of rounding [§3.2] [eq. 7]
def dequantize(q, scale, zero_point):
return scale * (q + zero_point)Two procedures §4 tab. 1.
- Quantization-aware training (QAT): quantize, run a forward pass, backpropagate with floating-point gradients, update the float weights, and repeat until convergence §4.1. The rounding has no gradient, so a straight-through estimator is used, which treats the rounding as the identity §4.1. The learned clipping range can also be trained, as in PACT §4.1.
- Post-training quantization (PTQ): calibrate the quantization parameters on a small set of unlabelled data, then quantize the model without training §4.2.
Integer and fixed point §5.
- Batch norm can be folded into the preceding weights and bias. The folded weight is
gamma * w / sqrt(var + eps)and the folded bias is given in eq. 8 eq. 9 §5. - Scale from calibration, with the maximum magnitude
MAX:S = MAX / (2^b - 1)eq. 10 §5. - Adaptive rounding (AdaRound) chooses round-up or round-down per weight to reduce layer output error, using the unlabelled data §5 §7.
Binary §6.1.
- BinaryConnect draws each weight stochastically:
+1with probabilitysigma(w)and-1otherwise, wheresigmais the hard sigmoid eq. 11 eq. 12. - BinaryNet uses the sign function, with
Sign(w) = +1ifw >= 0and-1otherwise eq. 13. With binary weights and activations, a dot product becomes XNOR and popcount eq. 14. - Binary-weight networks and XNOR-Nets approximate each weight as
alpha * w_b, wherealphais the mean absolute weight of the matrix eq. 15 §6.1.
Ternary §6.2.
- Ternary Weight Networks use a threshold
Deltaof about0.7 * mean(|w|)§6.2. The weight becomes+1above the threshold,-1below its negative, and0in between eq. 16. - The scale
alphais the mean of|w|over the weights above the threshold §6.2. - Trained Ternary Quantization learns two separate scales, one for the positive and one for the negative values, and learns the threshold during training §6.2.
Mixed precision §7.
- HAWQ uses the Hessian spectrum as a sensitivity measure, and HAWQ-V2 uses the average Hessian trace §7.
- HAWQ-V2 scores a bit-width setting by the sum over layers of
avg_trace(H_i)times the squared L2 distance between quantized and float weights eq. 17. - HAWQ-V3 uses dyadic scale factors
b / 2^cand integer linear programming under size, operation and latency limits §7. - AdaQuant chooses step sizes per layer by minimizing the output error on a small calibration set, with an integer program for the bit widths and a further distillation step §7 eq. 18.
- Other works search bit widths with reinforcement learning, neural architecture search, or learned step sizes and bit-level sparsity §7.
Hyperparameters
The survey gives few training hyperparameters. The table lists the values it states. Nothing else is stated.
| Name | Value | Where | Notes |
|---|---|---|---|
| float32 layout | 1 sign, 8 exponent, 23 mantissa bits | fig. 1 §2.1 | Exponent bias stated as 255, see Pitfalls |
| fixed-point example | 1 sign, 7 integer, 24 mantissa bits; global exponent 2^-24 | fig. 2 §2.2 | Worked example only |
| minimum precision, QAT | 1 bit | tab. 1 | Survey's summary, cites XNOR-Net |
| minimum precision, PTQ | 4 bits | tab. 1 §4.2 | Survey's summary, cites AdaRound |
| bit widths, Gong et al. (PTQ, INT8) | activations 8, weights 7, biases 31 | §5 | Signed weights and biases, one bit for sign |
| bit widths, Jacob et al. (QAT) | weights 8, biases 32 | §5 | Scale and zero point learned per array |
| progressive bit widths (Zhuang et al.) | from 32 down by powers of 2 to 2 bits | §5 | Lower one stage at a time |
| mixed-precision search set, ResNet50 | {1, 2, 4, 8} bits | §7 | Search space 4^50 |
| mixed-precision search set, Gong et al. (NAS) | {2, 4, 6, 8} bits | §7 | Starts from MobileNetV2 |
| ternary threshold factor | 0.7 | §6.2 | Derived assuming normally distributed weights |
| first and last layers | not quantized (LAPQ), fixed at 8 bits (BSQ) | §5 §7 | Stated per method, not a general rule |
Results
Author-reported. The survey does not run experiments; it reports numbers from the works it cites, with the setup shown in the tables. Tables 3 and 4 are copied in full. The "Arithmetic" column follows the survey's check marks.
CIFAR-10 tab. 3
| Scheme | Method | Model | Acc. (%) | w/a | QAT/PTQ | Arithmetic |
|---|---|---|---|---|---|---|
| Int/Fixed Point | Courbariaux et al. | Maxout | 84.02 | 20/20 | QAT | Int |
| Binary & Ternary | BinaryConnect | CNN | 91.73 | 1/float32 | QAT | Float |
| Binary & Ternary | BNN | CNN | 88.6 | 1/1 | QAT | Bit-wise, Float |
| Binary & Ternary | TWN | VGG-7 | 92.56 | 2/float32 | QAT | Bit-wise, Float |
| Binary & Ternary | TTQ | ResNet56 | 93.56 | 2/float32 | QAT | Bit-wise, Float |
| Mixed Precision | Lin et al. | AlexNet | 93.18 | 8/16 | QAT | Int |
| Mixed Precision | HAWQ | ResNet20 | 92.22 | MP/4 | QAT | Int |
ImageNet tab. 4
| Scheme | Method | Model | Acc. (%) | w/a | QAT/PTQ | Arithmetic |
|---|---|---|---|---|---|---|
| Int/Fixed Point | Jacob et al. | ResNet50 | 74.9 | 8/8 | QAT | Int |
| Int/Fixed Point | Quant-Noise | EffNet-B3 | 79.8 | 8/8 | QAT | Int |
| Int/Fixed Point | Zhuang et al. | AlexNet | 58 | 4/4 | QAT | Int |
| Int/Fixed Point | Zhuang et al. | ResNet50 | 75.7 | 4/4 | QAT | Int |
| Int/Fixed Point | Gong et al. | ResNet50 | 71.84 | 8/8 | PTQ | Int |
| Int/Fixed Point | Gong et al. | Inception-V3 | 75.31 | 8/8 | PTQ | Int |
| Int/Fixed Point | LAPQ | ResNet18 | 68.8 | 8/4 | PTQ | Int |
| Int/Fixed Point | LAPQ | ResNet50 | 74.8 | 8/4 | PTQ | Int |
| Int/Fixed Point | LAPQ | ResNet101 | 73.6 | 8/4 | PTQ | Int |
| Int/Fixed Point | LAPQ | Inception-V3 | 75.1 | 8/4 | PTQ | Int |
| Int/Fixed Point | AdaRound | ResNet18 | 68.55 | 4/8 | PTQ | Int |
| Int/Fixed Point | AdaRound | ResNet50 | 75.01 | 4/8 | PTQ | Int |
| Int/Fixed Point | AdaRound | Inception-V3 | 75.76 | 4/8 | PTQ | Int |
| Int/Fixed Point | AdaRound | MobilenetV2 | 69.89 | 4/8 | PTQ | Int |
| Binary & Ternary | BWN | ResNet18 | 60.8 | 1/float32 | QAT | Float |
| Binary & Ternary | XNOR-Net | ResNet18 | 51.2 | 1/1 | QAT | Bit-wise |
| Binary & Ternary | TWN (printed "TTN") | ResNet18 | 61.8 | 2/float32 | QAT | Bit-wise, Float |
| Binary & Ternary | TTQ | AlexNet | 57.5 | 2/float32 | QAT | Bit-wise, Float |
| Binary & Ternary | TTQ | ResNet18 | 66.6 | 2/float32 | QAT | Bit-wise, Float |
| Mixed Precision | AdaQuant | ResNet18 | 67.4 | MP | PTQ | Int |
| Mixed Precision | AdaQuant | ResNet50 | 73.7 | MP | PTQ | Int |
| Mixed Precision | AdaQuant | Inception-V3 | 72.6 | MP | PTQ | Int |
| Mixed Precision | Lin et al. | AlexNet | 80 | MP | QAT | Int |
| Mixed Precision | HAWQ | Inception-V3 | 75.52 | MP | QAT | Int, Float |
| Mixed Precision | HAWQ | ResNet50 | 75.48 | MP | QAT | Int, Float |
| Mixed Precision | HAWQ-V2 | Inception-V3 | 75.68 | MP | QAT | Int, Float |
| Mixed Precision | HAWQ-V2 | ResNet50 | 75.76 | MP | QAT | Int, Float |
| Mixed Precision | HAWQ-V3 | ResNet18 | 70.5 | MP | QAT | Int |
| Mixed Precision | HAWQ-V3 | ResNet50 | 75.95 | MP | QAT | Int |
| Mixed Precision | Gong et al. (NAS) | MobilenetV2* | 71.77 | MP | QAT | Int |
| Mixed Precision | HAQ | MobilenetV2 | 71.89 | MP | QAT | Int |
| Mixed Precision | Uhlich et al. | MobilenetV2 | 70.59 | MP | QAT | Int |
| Mixed Precision | Uhlich et al. | ResNet18 | 70.66 | MP | QAT | Int |
| Mixed Precision | BSQ | ResNet50 | 75.29 | MP | QAT | Int |
| Mixed Precision | BSQ | Inception-V3 | 76.6 | MP | QAT | Int |
| Mixed Scheme | Chang et al. | ResNet18 | 70.27 | 4/4 | QAT | Bit-wise, Int |
| Mixed Scheme | Chang et al. | MobilenetV2 | 71.31 | 4/4 | QAT | Bit-wise, Int |
Headline statements in the text (author-reported):
- A ternary-weight ResNet18 (TWN, 2-bit weights) incurs "only" 4% accuracy loss on ImageNet §6.2. The survey gives no float baseline for this row in its table.
- Gong et al. report less than 1% loss for 8-bit integer inference §5.
- AdaRound reports around 1% loss for 4-bit weights on ResNet18/50 §5; the table lists 68.55 (ResNet18) and 75.01 (ResNet50) without baselines.
- Zhuang et al.'s combined schemes: 4-bit AlexNet and ResNet50 marginally beat float; 2-bit AlexNet on CIFAR-100 loses under 1% §5.
- TTQ ResNets beat float ResNets on CIFAR-10 by under 0.5% §6.2.
Paper vs code
No official code. The survey has no implementation. The paper and its arXiv page link no repository or project page. I searched the LaTeX source for URLs (none apart from the ACM template), the arXiv abstract page (no code link), and GitHub for "neural network quantization survey". The three GitHub hits belong to other owners, and none is by the author. The other repositories are not official.
Pitfalls
- Exponent bias is wrong in the text. The paper gives the float32 bias as
2^8 - 1 = 255and uses2^(x - 255)in eq. 2, with a denormal exponent of -254 in eq. 3 §2.1. The commented-out text in the LaTeX source gives 127 and the range -126 to +127 [src: 02-background.tex, line 34], which is the value IEEE 754 single precision uses. Implement the standard 127, and treat the 255 as a typo. - Zero-point sign. eq. 5 subtracts
Zand eq. 7 adds it. Code that uses the other convention is off by2Zon every value. Check against the framework you target. - How to get Z and the scale is not fully given. The text defines the
scale from
alphaandbetaeq. 6 and the zero point as "the integer that represents 0", but does not give a formula forZfromalphaandbeta. Write it as not stated, or derive it from the grid you choose. - Scale rule with signed values. eq. 10 uses
MAX / (2^b - 1)withb = 7for signed weights, which is the paper's own reading of the source method §5. The text does not show how this formula relates to eq. 6 for symmetric signed ranges. Check which convention your kernel uses. - Threshold formula typo. The TWN sum is printed as
\sum_{i + 1}^n§6.2. The index should start ati = 1. The0.7factor is an approximation that assumes normally distributed weights, not an exact optimum §6.2. - Binarization details. BinaryConnect keeps float master weights that
receive the float gradients, and the binary copies are used only in the
forward and backward passes §6.1. Deterministic sign binarization
gives
+1at zero eq. 13. - Cross-reference error. §7 says batch-norm fusion before PTQ is problematic, citing "Equation (eq:norm)". That label is the float normalized-value equation eq. 2, not the folding equations eq. 8 eq. 9.
- AdaQuant notation. eq. 18 defines
W' = W + Vand then writesW_q = Q(W + V_hat). The two forms differ in the role ofV. The text callsVa continuous variable that gives the weights room to absorb rounding error §7. - AdaRound precision label. Table 4 gives AdaRound precision
4/8(weights 4, activations 8), but the text says AdaRound quantizes weights only and leaves the remaining parameters unquantized §5. Treat the activation bits as unclear. - Table typo. Table 4 prints "TTN" for the ternary weight network (TWN).
- Comparability. The tables mix QAT and PTQ, different networks, different first/last-layer treatment, and mixed-precision entries with no average bit width. Do not rank rows across columns without checking the source.
- Hidden costs. Ternary asymmetric scales need two floating-point multiplications per activation tab. 2. Dyadic scales remove floating point but still need an integer program over the bit widths §7. Mixed-precision search is exponential in the number of layers §7.
- Uniform precision limit. The survey says that for minimal loss, integer networks are limited by the most sensitive layer, usually 8 bits, so the compression is at most about 4x tab. 2. This is the author's claim, not a measurement.
- Tables are secondhand. Every number in tab. 3 and tab. 4 is copied from a cited paper. Check the original before using a figure.
Lineage
- Builds on: the survey cites Gholami et al., "A Survey of Quantization Methods for Efficient Neural Network Inference" (arXiv:2103.13630), for its definitions and calibration material §3.1 §4. The paper has no card in this wiki.
- Compared against: none; the survey compares the schemes it reviews, from its own tables tab. 2 tab. 3 tab. 4.
- Superseded by: not stated in this wiki's content.
Source and license
Adapted from “Neural Network Quantization for Efficient Inference: A Survey” by Olivia Weng (arXiv:2112.06126), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors.