Skip to content
OpenTrain AIFor AI Companies

Sharpness-aware Quantization for Deep Neural Networks

Jing Liu, Jianfei Cai, Bohan ZhuangPublished Nov 24, 2021
arXiv PDF
Researcher verdict
Starting point
Use as implementation starting point
Benchmark evidence
Thin evidence
Verify before relying
Time to first repro
A few days
Plan setup time
Risk flags
1
Review before use

Abstract

Domain fit: AI-core · Core AI workload signals detected from paper context and implementation/artifact evidence.

Network quantization is a dominant paradigm of model compression. However, the abrupt changes in quantized weights during training often lead to severe loss fluctuations and result in a sharp loss landscape, making the gradients unstable and thus degrading the performance. Recently, Sharpness-Aware Minimization (SAM) has been proposed to smooth the loss landscape and improve the generalization performance of the models. Nevertheless, directly applying SAM to the quantized models can lead to perturbation mismatch or diminishment issues, resulting in suboptimal performance. In this paper, we propose a novel method, dubbed Sharpness-Aware Quantization (SAQ), to explore the effect of SAM in model compression, particularly quantization for the first time. Specifically, we first provide a unified view of quantization and SAM by treating them as introducing quantization noises and adversarial perturbations to the model weights, respectively. According to whether the noise and perturbation terms depend on each other, SAQ can be formulated into three cases, which are analyzed and compared comprehensively. Furthermore, by introducing an efficient training strategy, SAQ only incurs a little additional training overhead compared with the default optimizer (e.g., SGD or AdamW). Extensive experiments on both convolutional neural networks and Transformers across various datasets (i.e., ImageNet, CIFAR-10/100, Oxford Flowers-102, Oxford-IIIT Pets) show that SAQ improves the generalization performance of the quantized models, yielding the SOTA results in uniform quantization. For example, on ImageNet, SAQ outperforms AdamW by 1.2% on the Top-1 accuracy for 4-bit ViT-B/16. Our 4-bit ResNet-50 surpasses the previous SOTA method by 0.9% on the Top-1 accuracy.

Results and benchmarks

Freshness tier: cold
Network quantization is a dominant paradigm of model compression.

Implementation

Historical official implementation (not recommended for new builds)

Why this implementation
Confidence: low

zip-group/saq is the closest maintained adjacent implementation (Official implementation from Papers with Code). It is not paper-verified; validate algorithm and evaluation setup against the paper before trusting reported metrics. Community adoption signal: 45 GitHub stars.

Open zhuang-group/saq
Reproduction risks
  • Adjacent implementations are not paper-verified
  • Recommended repository is adjacent and not paper-verified.
  • Adjacent implementation match confidence is low.
  • No direct maintained implementation is currently verified.
  • Only historical official repository was found: zhuang-group/saq.
  • No maintained paper-verified implementation met reliability thresholds.

Compare implementation paths

Compare maintenance quality, reproducibility coverage, and evidence confidence before choosing a reproduction baseline.

zhuang-group/saq
historical official
Maintenance
Stale
Confidence
High
Reproducibility
Limited
Stars
45
Last push
Nov 25, 2021 (1735d)

Official implementation from Papers with Code · Repository link is mentioned in the paper metadata

  • No push in 12+ months
  • No CI pipeline detected
  • No Docker setup
zip-group/saq
alternative
Maintenance
Stale
Confidence
High
Reproducibility
Limited
Stars
45
Last push
Nov 25, 2021 (1735d)

Official implementation from Papers with Code · Repository link is mentioned in the paper metadata

  • No push in 12+ months
  • No CI pipeline detected
  • No Docker setup
ziplab/saq
alternative
Maintenance
Stale
Confidence
High
Reproducibility
Limited
Stars
45
Last push
Nov 25, 2021 (1735d)

Official implementation from Papers with Code · Repository link is mentioned in the paper metadata

  • No push in 12+ months
  • No CI pipeline detected
  • No Docker setup

Reproduction readiness

Time to first repro: days
Last checked: Aug 25, 2026

Major work

No dependency manifest, manual reconstruction required

  • zhuang-group/saq has no requirements.txt, environment.yml, pyproject.toml, or Dockerfile.
  • You will need to reverse-engineer dependencies from import statements in the source code.
  • Last push was 1735 days ago.
Open zhuang-group/saq

Hardware requirements

  • Expect multi-day setup/compute for meaningful reproduction based on current guidance.

Framework baselines

Repositories and ecosystem

Closest related implementations

These are not paper-verified. Use them as reference points when no direct implementation is available.

  • zip-group/saq Adjacent · Confidence: Low · 45 stars

    Official implementation from Papers with Code

  • ziplab/saq Adjacent · Confidence: Low · 45 stars

    Official implementation from Papers with Code

Official

  • zip-group/saq
    Confidence: High

    This is the official PyTorch implementation for "Sharpness-aware Quantization for Deep Neural Networks".

    45 stars · 4 forks · Last push Nov 25, 2021 · Apache-2.0 license

  • ziplab/saq
    Confidence: High

    This is the official PyTorch implementation for "Sharpness-aware Quantization for Deep Neural Networks".

    45 stars · 4 forks · Last push Nov 25, 2021 · Apache-2.0 license

Community

No additional community repositories detected yet.

Hugging Face artifacts

No trustworthy direct or curated related Hugging Face artifacts were found yet. Use targeted searches to quickly locate candidate models, datasets, and demos.

Tip: start with models, then check datasets and spaces if you need evaluation data or demos.

Research context

Tasks

Image classification

Methods

Transformer, Quantization

Domains

Computer vision, Large Language Models

Evaluation and human feedback data

Open this paper in HFEPX to review benchmark signals, evaluation modes, and human-feedback protocol context.

Open in HFEPX
Explore similar papers

Jump to Paper2Code search queries derived from this paper's research context.

Data includes links from Papers with Code ( CC-BY-SA-4.0 ).