Skip to main content
QUICK REVIEW

[Paper Review] Any-Precision Deep Neural Networks

Haichao Yu, Haoxiang Li|arXiv (Cornell University)|Nov 17, 2019
Advanced Neural Network ApplicationsComputer Science46 references9 citations
TL;DR

This paper introduces any-precision deep neural networks (DNNs), a framework that enables a single pre-trained model to dynamically infer at any bit-width without retraining or calibration. By jointly training with multiple bit-widths and using knowledge distillation, the model achieves accuracy comparable to dedicated low-precision models across vision tasks, enabling flexible runtime trade-offs between efficiency and accuracy.

ABSTRACT

We present any-precision deep neural networks (DNNs), which are trained with a new method that allows the learned DNNs to be flexible in numerical precision during inference. The same model in runtime can be flexibly and directly set to different bit-widths, by truncating the least significant bits, to support dynamic speed and accuracy trade-off. When all layers are set to low-bits, we show that the model achieved accuracy comparable to dedicated models trained at the same precision. This nice property facilitates flexible deployment of deep learning models in real-world applications, where in practice trade-offs between model accuracy and runtime efficiency are often sought. Previous literature presents solutions to train models at each individual fixed efficiency/accuracy trade-off point. But how to produce a model flexible in runtime precision is largely unexplored. When the demand of efficiency/accuracy trade-off varies from time to time or even dynamically changes in runtime, it is infeasible to re-train models accordingly, and the storage budget may forbid keeping multiple models. Our proposed framework achieves this flexibility without performance degradation. More importantly, we demonstrate that this achievement is agnostic to model architectures and applicable to multiple vision tasks. Our code is released at https://github.com/SHI-Labs/Any-Precision-DNNs.

Motivation & Objective

  • Address the practical challenge of balancing model accuracy and runtime efficiency in real-world deep learning deployment.
  • Overcome the limitation of existing methods that require retraining or maintaining multiple models for different precision levels.
  • Enable a single model to support dynamic precision adjustment at inference time without performance degradation.
  • Demonstrate that joint training across multiple bit-widths with knowledge distillation yields robust, generalizable low-precision models.
  • Achieve model flexibility that is agnostic to architecture and applicable across diverse vision tasks and benchmarks.

Proposed method

  • Train a single DNN model with multiple bit-widths (e.g., 1, 2, 4, 8, 32-bit) simultaneously during backpropagation, using a shared full-precision (FP32) parameter as the main trainable weight.
  • Apply straight-through estimation (STE) to backpropagate gradients through quantization operations during training, enabling end-to-end optimization.
  • Use recursive knowledge distillation: supervise lower-bit outputs using soft labels from the nearest higher-bit model, improving generalization in low-precision regimes.
  • Ensure gradient consistency across bit-widths via Update Compliance Average (UCA), which measures cosine similarity of gradients between different bit-widths.
  • Allow inference at any bit-width by truncating the least significant bits of weights and activations at runtime, without retraining or calibration.
  • Leverage joint optimization across bit-widths to improve robustness to adversarial attacks, as the model learns consistent representations across precision levels.

Experimental results

Research questions

  • RQ1Can a single DNN be trained to support dynamic precision adjustment at inference time without retraining or calibration?
  • RQ2How does joint training across multiple bit-widths affect model accuracy and generalization, especially in low-bit regimes?
  • RQ3To what extent does knowledge distillation improve performance of low-bit any-precision models compared to dedicated models?
  • RQ4Does the proposed framework maintain or improve robustness to adversarial attacks compared to single-precision models?
  • RQ5Can the any-precision approach generalize across different architectures and vision tasks without architectural modification?

Key findings

  • Any-precision DNNs achieve classification accuracy on CIFAR-10 and ImageNet that matches or exceeds dedicated models trained at the same bit-width, with ResNet-20 achieving 93.98% top-1 accuracy at FP32 and 92.15% at 1-bit with knowledge distillation.
  • On Pascal VOC 2012 semantic segmentation, the proposed method outperforms dedicated models: 61.3% mIoU at 1-bit vs. 59.5% for dedicated 1-bit model.
  • Knowledge distillation significantly improves low-bit performance: ResNet-50 on ImageNet achieves 74.75% top-1 accuracy at 4-bit with KD, compared to 74.43% without.
  • The Update Compliance Average (UCA) between bit-widths is consistently high (0.9–1.0), indicating strong gradient consistency across training steps.
  • Any-precision models show improved robustness to FGSM adversarial attacks, with FP32 model accuracy improved by over 10% compared to dedicated models.
  • The framework is model-architecture agnostic and generalizes across classification and segmentation tasks, including ResNet, DenseNet, and DeepLabV3 with ResNet-50.

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.