All models

Any-Precision DNN

A quantized ResNet-20 for CIFAR10 whose one set of weights runs at 1, 2, 4, 8 or 32 bits.

Image classification · 1,818 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (13 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
6.8M
Operations
1,818
Framework
PyTorch
Recurrent
No
Published
AAAI 2021
Cited by
7 (as of 27 October 2026)
Authors
Haichao Yu, Haoxiang Li, Honghui Shi and others
License
CC-BY-NC-4.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m14696
Graph hash
6e7002f5f89e39f5f84bbab56cc19b626bf6fc9c2496e5f2c8bc16a2b95f4a31
Skeleton hash
500240a81393f4e3665c8f4619b2aaf52261c473bbd468b3278ab7b5dd0db42e
Architecture hash
5e4046d539a2b81ffbf1f232596c0d31225ae18ef087c68cab64084d4ea2d12f
Diagram SHA-256
d3c1115a57dfd572e6f90f2f96a17a411348da8e048b0815214eb773456a54bb
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

Any-Precision DNN is a network trained so that its numerical precision can be changed at inference time. The same model can be set directly to different bit-widths at run time by truncating the least significant bits, which gives a dynamic trade-off between speed and accuracy.

The paper frames this as a deployment problem: when the wanted trade-off changes over time or at run time, retraining for each setting is infeasible and the storage budget may forbid keeping multiple models. With all layers set to low bit-widths, the authors report accuracy comparable to dedicated models trained at the same precision. They also state that the result is agnostic to model architecture and applies to multiple vision tasks.

The released code lists Resnet-20 models on CIFAR10 with accuracy at 1, 2, 4 and 8 bits and FP32. One of its training options, called recursive, uses the higher-precision model as supervision for the lower-precision one. The README notes that its numbers may differ from those in the paper because of changed training hyperparameters.

Key idea. The paper trains a single network that can be set to different bit-widths at run time by truncating the least significant bits, trading speed against accuracy.

  • any-precision dnn
  • any-precision deep neural networks
  • quantization
  • bit-width
  • runtime precision
  • quantized resnet-20
  • cifar10
  • image classification
  • speed accuracy trade-off

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{yu2021anyprecisiondeepneuralnetworks,
      title={Any-Precision Deep Neural Networks}, 
      author={Haichao Yu and Haoxiang Li and Honghui Shi and Thomas S. Huang and Gang Hua},
      year={2021},
      eprint={1911.07346},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/1911.07346}, 
}