REx: Data-Free Residual Quantization Error Expansion

Kevin Bailly, Arnaud Dapogny, Edouard Yvinec

Introduction

Deep Neural Networks (DNNs) have become indispensable across various domains, yet their deployment on edge devices is often hindered by significant computational and memory requirements. Quantization—the process of mapping high-precision floating-point weights and activations to lower bit-width integers—is a primary strategy for model compression. However, standard quantization techniques typically require access to representative calibration data to recover accuracy lost during the process. In many sensitive applications, such as medical imaging or large-scale private datasets, this data is unavailable.

Furthermore, Large Language Models (LLMs) present a unique challenge: "outliers." A small number of extreme weight values can dominate the quantization scale, forcing the majority of weights into a narrow range where they are effectively rounded to zero, devastating model performance.

The REx Framework: Residual and Sparse Expansion

To address these challenges, we introduce REx (Residual Error Expansion), a data-free quantization framework that treats quantization error as a signal to be recursively refined. Rather than accepting the error from a single quantization step, REx calculates the residual—the difference between the original value and its quantized representation—and quantizes that error in a subsequent step.

Conceptual overview of (a) residual expansion and (b) group-sparse expansion.

As shown in Figure 1, the framework consists of two primary components:

  1. Residual Expansion: The original weight $W$ is approximated by a sum of $K$ quantized residuals: $W \approx R^{(1)} + R^{(2)} + \dots + R^{(K)}$. This approach allows for exponential convergence toward the full-precision model as the expansion order $K$ increases.
  2. Group-Sparse Expansion: To maintain computational efficiency, REx employs group sparsity. Instead of refining every weight, residuals are only applied to the most critical neurons or weight groups, identified by their norm. This allows for "fractional" bit-widths, where a model might use 4-bit base weights supplemented by a small percentage of 1-bit residuals.

Experimental Results

REx was evaluated across a wide range of architectures and tasks, including ImageNet classification, object detection, and semantic segmentation.

Comparison of REx against state-of-the-art data-free quantization methods across different architectures.

As detailed in Figure 4, REx consistently outperforms existing state-of-the-art (SOTA) data-free methods. On ResNet-50, REx using a 4-bit base with 50% sparse residuals (denoted as $150\% \times W4/A6$) achieved a top-1 accuracy of 76.01%, nearly matching the full-precision baseline of 76.15%. This surpasses previous methods like SPIQ (75.98%) while maintaining a comparable computational budget.

The benefits are even more pronounced on compact architectures like MobileNetV2 and EfficientNet-B0, where standard data-free quantization often fails. For MobileNetV2, REx achieved 64.20% accuracy, a significant jump over SPIQ's 63.24% and DFQ's 45.84%.

Solving the Outlier Problem in LLMs

The flexibility of REx is particularly effective for LLMs like OPT-13B. By using a single binary (1-bit) residual to capture outliers, REx prevents these extreme values from distorting the scaling factors for the rest of the network. This "fix-up" mechanism allows 4-bit quantized LLMs to maintain high accuracy on common-sense reasoning tasks (e.g., HellaSwag, PIQA) with negligible computational overhead.

Conclusion and Future Work

REx provides a robust, data-free path to high-accuracy low-bit quantization. By moving away from fixed bit-widths and embracing a residual-based expansion, it offers hardware designers a fine-grained trade-off between bit operations (BOPs) and model fidelity.

Future research will focus on automated layer-wise sensitivity analysis to optimally allocate expansion orders across the network. Additionally, optimizing hardware kernels for the sparse additions inherent in REx will further reduce the latency overhead on specialized accelerators.

Summary updated

BibTeX
@inproceedings{bailly2023rex,
  author = {Kevin Bailly and Kévin Bailly and Arnaud Dapogny and Edouard Yvinec},
  title = {{REx: Data-Free Residual Quantization Error Expansion}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=TDS3kqRteY},
}
Figure