Sharpness-aware Quantization for Deep Neural Networks
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
Network quantization is a dominant paradigm of model compression.
Benchmark evidence is limited
Evidence graph: 3 refs, 3 links.
Utility signals: depth 65/100, grounding 75/100, status medium.
Implementation
Historical official implementation (not recommended for new builds)
Only a historical official implementation is available
Use with caution for new projects; verify against current tooling and maintained community alternatives.
zhuang-group/saq · 45 stars · Last push Nov 25, 2021
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- 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.
- 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
- 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
- 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
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.
Hardware requirements
- Expect multi-day setup/compute for meaningful reproduction based on current guidance.
Framework baselines
- PyTorch Adam optimizer docs
Reference implementation of Adam in PyTorch.
- Optax Adam optimizer docs
JAX/Flax baseline for Adam variants.
- Keras Adam optimizer docs
TensorFlow/Keras baseline for Adam.
- Hugging Face Transformers training guide
Modern transformer training baseline.
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/saqConfidence: 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/saqConfidence: 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
Open this paper in HFEPX to review benchmark signals, evaluation modes, and human-feedback protocol context.
Open in HFEPXJump to Paper2Code search queries derived from this paper's research context.
Data includes links from Papers with Code ( CC-BY-SA-4.0 ).