Papers
Topics
Authors
Recent
Search
2000 character limit reached

Prediction Difference Metrics (PD-Quant)

Updated 26 June 2026
  • Prediction Difference Metrics (PD-Quant) are post-training quantization techniques that optimize parameters by minimizing the KL divergence between full-precision and quantized outputs over a calibration set.
  • The method jointly optimizes activation scales and rounding offsets using a hybrid loss that combines global prediction difference and local MSE regularization.
  • PD-Quant mitigates overfitting with distribution correction techniques and demonstrates notable accuracy improvements in aggressive quantization scenarios.

Prediction Difference Metrics (PD-Quant) are a class of post-training quantization (PTQ) techniques that employ global measures of prediction shift to optimize quantization parameters in deep neural networks. Unlike conventional PTQ approaches based on local feature or activation distance, PD-Quant determines quantization parameters by explicitly minimizing the difference between the predicted distributions of a full-precision network and its quantized counterpart over a calibration set. This method aims to reduce accuracy degradation in aggressive (e.g., 2-bit) quantization regimes by leveraging a global prediction difference metric, typically instantiated via the Kullback–Leibler (KL) divergence between output softmax distributions (Liu et al., 2022). PD-Quant further incorporates techniques to counteract overfitting with limited calibration data, notably via distribution correction of activations.

1. Formal Definition of the Prediction Difference Metric

Let f()f(\cdot) denote a full-precision neural network and fq()f^q(\cdot) its quantized version. Given a calibration dataset {xi}i=1N\{x_i\}_{i=1}^N, define:

  • pi=f(xi)RCp_i = f(x_i) \in \mathbb{R}^C: Softmax output of ff on input xix_i
  • qi=fq(xi)RCq_i = f^q(x_i) \in \mathbb{R}^C: Softmax output of fqf^q on xix_i

The Prediction Difference Metric (PDM) is the average KL divergence between the predictions: PDM(f,fq)=1Ni=1NDKL(piqi)=1Ni=1Nc=1Cpi(c)logpi(c)qi(c)\mathrm{PDM}(f, f^q) = \frac{1}{N}\sum_{i=1}^N D_{\mathrm{KL}}(p_i \Vert q_i) = \frac{1}{N}\sum_{i=1}^N \sum_{c=1}^C p_i(c) \log \frac{p_i(c)}{q_i(c)}

PDM quantifies the shift in predicted distributions resulting from quantization noise, serving as a global criterion for PTQ parameter search.

2. Optimization of Quantization Parameters via PDM

PD-Quant simultaneously optimizes per-layer/block activation scales (fq()f^q(\cdot)0) and per-weight rounding offsets (fq()f^q(\cdot)1). For block fq()f^q(\cdot)2, given quantized output fq()f^q(\cdot)3 and original prediction fq()f^q(\cdot)4, the optimization problem is:

fq()f^q(\cdot)5

  • fq()f^q(\cdot)6: Global loss (prediction difference)
  • fq()f^q(\cdot)7: Blockwise output MSE regularizer
  • fq()f^q(\cdot)8: Regularization coefficient (typ. fq()f^q(\cdot)9–{xi}i=1N\{x_i\}_{i=1}^N0)

The quantizer for each value {xi}i=1N\{x_i\}_{i=1}^N1 is: {xi}i=1N\{x_i\}_{i=1}^N2 with scale {xi}i=1N\{x_i\}_{i=1}^N3, zero-point {xi}i=1N\{x_i\}_{i=1}^N4, and round offset {xi}i=1N\{x_i\}_{i=1}^N5.

3. Algorithmic Description and Workflow

PD-Quant is implemented as a blockwise, calibration-driven algorithm. The standard workflow is:

  1. Initialize {xi}i=1N\{x_i\}_{i=1}^N6; set all {xi}i=1N\{x_i\}_{i=1}^N7; set all {xi}i=1N\{x_i\}_{i=1}^N8 via min–max.
  2. For {xi}i=1N\{x_i\}_{i=1}^N9 (blocks): a. Propagate calibration samples through blocks pi=f(xi)RCp_i = f(x_i) \in \mathbb{R}^C0 to obtain inputs pi=f(xi)RCp_i = f(x_i) \in \mathbb{R}^C1. b. (Optional) Apply Distribution Correction (DC) to match batch statistics. c. Jointly optimize pi=f(xi)RCp_i = f(x_i) \in \mathbb{R}^C2 by minimizing the sum of PDM loss and local regularizer for pi=f(xi)RCp_i = f(x_i) \in \mathbb{R}^C3 iterations. d. Freeze parameters and proceed to the next block.
  3. Output the fully quantized network pi=f(xi)RCp_i = f(x_i) \in \mathbb{R}^C4.

The pseudocode structure is as follows:

qi=fq(xi)RCq_i = f^q(x_i) \in \mathbb{R}^C6

4. Overfitting Mitigation: Distribution Correction

With limited calibration data, PTQ can overfit to idiosyncratic activation statistics. PD-Quant addresses this by remapping block inputs to match the mean/variance recorded in BatchNorm layers:

Let block pi=f(xi)RCp_i = f(x_i) \in \mathbb{R}^C5 have pi=f(xi)RCp_i = f(x_i) \in \mathbb{R}^C6 BatchNorm layers with statistics pi=f(xi)RCp_i = f(x_i) \in \mathbb{R}^C7. For sample batch statistics pi=f(xi)RCp_i = f(x_i) \in \mathbb{R}^C8, solve

pi=f(xi)RCp_i = f(x_i) \in \mathbb{R}^C9

Here, ff0 tunes the correction's strength (ff1 corresponds to no correction). Correction is performed using a few steps of gradient descent and is activated when the calibration set is small (ff2K).

5. Empirical Performance and Benchmarking

PD-Quant demonstrates consistent improvements in accuracy over established PTQ baselines, particularly in low-bit regimes. Selected results include:

Model Bit Baseline QDrop PD-Quant
ResNet-18 2/2 51.42% 53.14%
RegNetX-600MF 2/2 39.01% 40.67%

Wider 4-bit/2-bit (W4A2) or 2-bit/4-bit (W2A4) configurations see ff3–ff4 improvements. At 256 calibration images, gains over QDrop remain ff5–ff6; the benefit of DC diminishes with calibration set size.

Relative quantization time (ResNet-18, RTX A6000):

  • QDrop: ff7 h
  • PD-Quant (no DC): ff8 h
  • PD-Quant (ff9DC): xix_i0 h

This is substantially faster than quantization-aware training (QAT; e.g., LSQ, xix_i1 h).

6. Hyperparameters, Calibration, and Implementation Details

Hyperparameters are found robust across model architectures:

  • xix_i2 (regularization): xix_i3
  • xix_i4 (DC strength): xix_i5

Calibration sets of xix_i6K–xix_i7K in-domain images yield optimal results; even at xix_i8 samples, performance exceeds QDrop. Notably, scale optimization for weights via PDM does not provide further benefit, as weight scale search per channel is discrete; MSE or per-channel min–max is preferred for this aspect.

7. Limitations, Methodological Extensions, and Best Practices

PD-Quant incurs additional fine-tuning cost (typically xix_i9 h per model), contrasting with search-only approaches. Application to Vision Transformers (ViT/DeiT) shows qi=fq(xi)RCq_i = f^q(x_i) \in \mathbb{R}^C0–qi=fq(xi)RCq_i = f^q(x_i) \in \mathbb{R}^C1 improvements at W4A6 and W2A6. Other potential metrics (e.g., Earth Mover’s Distance) may be substituted for KL, and mixed-precision bitwidth selection can be informed by PDM sensitivity.

Best practices include quantizing blocks in order, utilizing qi=fq(xi)RCq_i = f^q(x_i) \in \mathbb{R}^C2–qi=fq(xi)RCq_i = f^q(x_i) \in \mathbb{R}^C3 in-domain calibration samples, tuning qi=fq(xi)RCq_i = f^q(x_i) \in \mathbb{R}^C4 on a single block, always incorporating the local qi=fq(xi)RCq_i = f^q(x_i) \in \mathbb{R}^C5, and applying DC for small calibration sizes.

A plausible implication is that layer-local MSE alone insufficiently captures prediction robustness under quantization, and global output-centric metrics such as PDM provide a superior quantization protocol for aggressive precision reduction (Liu et al., 2022).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Prediction Difference Metrics (PD-Quant).