Skip to main content
QUICK REVIEW

[Paper Review] SQuant: On-the-Fly Data-Free Quantization via Diagonal Hessian Approximation

Cong Guo, Yuxian Qiu|arXiv (Cornell University)|Feb 14, 2022
Advanced Neural Network ApplicationsComputer Science19 citations
TL;DR

SQuant proposes a fast, data-free post-training quantization framework that achieves sub-second quantization time and >30% accuracy improvement over existing data-free methods by optimizing a novel constrained absolute sum of error (CASE) objective derived from diagonal Hessian approximation. It eliminates the need for synthetic data, back-propagation, or fine-tuning, enabling on-the-fly quantization on inference-only devices with minimal computational overhead.

ABSTRACT

Quantization of deep neural networks (DNN) has been proven effective for compressing and accelerating DNN models. Data-free quantization (DFQ) is a promising approach without the original datasets under privacy-sensitive and confidential scenarios. However, current DFQ solutions degrade accuracy, need synthetic data to calibrate networks, and are time-consuming and costly. This paper proposes an on-the-fly DFQ framework with sub-second quantization time, called SQuant, which can quantize networks on inference-only devices with low computation and memory requirements. With the theoretical analysis of the second-order information of DNN task loss, we decompose and approximate the Hessian-based optimization objective into three diagonal sub-items, which have different areas corresponding to three dimensions of weight tensor: element-wise, kernel-wise, and output channel-wise. Then, we progressively compose sub-items and propose a novel data-free optimization objective in the discrete domain, minimizing Constrained Absolute Sum of Error (or CASE in short), which surprisingly does not need any dataset and is even not aware of network architecture. We also design an efficient algorithm without back-propagation to further reduce the computation complexity of the objective solver. Finally, without fine-tuning and synthetic datasets, SQuant accelerates the data-free quantization process to a sub-second level with >30% accuracy improvement over the existing data-free post-training quantization works, with the evaluated models under 4-bit quantization. We have open-sourced the SQuant framework at https://github.com/clevercool/SQuant.

Motivation & Objective

  • To address the high computational cost and accuracy degradation in existing data-free quantization (DFQ) methods that rely on synthetic data generation and back-propagation.
  • To enable on-the-fly quantization on resource-constrained inference-only devices by eliminating the need for training data, fine-tuning, or back-propagation.
  • To develop a data-free optimization objective that leverages second-order Hessian information without requiring knowledge of network architecture or input data.
  • To accelerate DFQ to sub-second levels while maintaining high accuracy, especially under low-bit quantization (e.g., 4-bit).
  • To achieve state-of-the-art accuracy in data-free post-training quantization by directly minimizing weight perturbation error via a progressive, linear-complexity algorithm.

Proposed method

  • Proposes a novel data-free optimization objective, C onstrained A bsolute S um of E rror (CASE), derived from the Hessian of the network loss, which measures weight perturbation without requiring input data.
  • Decomposes the Hessian-based objective into three diagonal sub-items: element-wise, kernel-wise, and output channel-wise, each corresponding to a different dimension of the weight tensor.
  • Progressively composes and optimizes these sub-items in the discrete domain to minimize the CASE objective, avoiding back-propagation and reducing computational complexity.
  • Introduces a progressive algorithm with linear time complexity to solve the CASE objective efficiently, enabling sub-second quantization per layer and network.
  • Employs a diagonal Hessian approximation to estimate second-order information of the loss function, enabling accurate weight rounding without access to training data or model gradients.
  • Designs a framework that operates as a black-box post-processing step, requiring no architectural knowledge or synthetic data generation.

Experimental results

Research questions

  • RQ1Can a data-free quantization method achieve high accuracy without relying on synthetic data generation or fine-tuning?
  • RQ2Can the second-order Hessian information of the loss function be approximated and leveraged effectively in a data-free setting to guide weight quantization?
  • RQ3Is it possible to minimize weight perturbation error directly via a discrete, non-differentiable objective like CASE without back-propagation?
  • RQ4Can the optimization complexity of data-free quantization be reduced to sub-second levels while maintaining high accuracy?
  • RQ5How does the proposed Hessian-based, data-free CASE objective compare to existing data-driven methods like AdaRound in terms of accuracy and speed?

Key findings

  • SQuant achieves sub-second quantization time, requiring only 4 ms per layer and 84 ms for the full ResNet18 network, significantly faster than prior DFQ methods.
  • Under 4-bit quantization, SQuant improves accuracy by over 30% compared to existing data-free post-training quantization methods, demonstrating strong performance in low-bit regimes.
  • SQuant incurs only 0.1% average accuracy loss under 8-bit quantization and 1.8% under 6-bit quantization, outperforming state-of-the-art data-free methods.
  • The method does not require synthetic data, back-propagation, or fine-tuning, enabling deployment on inference-only devices with minimal memory and compute.
  • SQuant outperforms data-free AdaRound and other Hessian-based methods by directly optimizing the CASE objective, avoiding the long optimization paths of gradient-based approaches.
  • Ablation studies confirm that combining element-wise, kernel-wise, and channel-wise optimization (SQuant-E&K&C) yields the highest accuracy, leveraging the most Hessian information.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.