TL;DR
This paper investigates the optimal bitwidth for deep convolutional neural networks (ConvNets) by considering model size and accuracy trade-offs. Surprisingly, they find that a single, uniform bitwidth across the entire network can outperform mixed-precision quantization when model size is kept constant, especially when network width (number of channels) is a tunable hyperparameter.
What Problem Does This Paper Address?
Deep ConvNets are computationally intensive and memory-hungry, limiting their deployment on resource-constrained devices. Weight quantization, which reduces the precision of network weights, is a key technique for model compression. However, achieving optimal compression often leads to mixed-precision quantization, where different layers use different bitwidths. This introduces significant complexity for hardware and software support, as specialized implementations are needed for each bitwidth. The authors aim to simplify this by investigating if a single, uniform bitwidth can achieve comparable or even better performance than mixed-precision approaches, especially when considering the interplay between bitwidth and network width.
Methods
The core of the paper's methodology involves using a width-multiplier to equalize model sizes across different bitwidth configurations. This allows for a fair comparison of accuracy for a given model size. They explore various ConvNet architectures (ResNets, VGG, MobileNetV2) and analyze how the optimal bitwidth changes with network width. For quantization itself, they employ quantization-aware training with a straight-through estimator for the backward pass. They define specific quantization functions for different bitwidths (e.g., ternary for 2-bit, DoReFaNets for 1-bit) and use a clipping strategy for higher bitwidths.
Datasets
The experiments were conducted on two popular image classification datasets:
- CIFAR-100
- ImageNet
Key Insights and Ideas
- Uniform Bitwidth Advantage: Counter-intuitively, a single, uniform bitwidth for the entire network can achieve better accuracy than mixed-precision quantization when the model size is fixed. This suggests that the complexity of mixed-precision might not always be necessary.
- Optimal Bitwidth is Architecture-Dependent: The ideal bitwidth is not universal but depends on the network architecture.
- Fan-in Correlation: The optimal bitwidth for a convolutional layer negatively correlates with its fan-in channel count. This means layers with fewer input channels (like depth-wise convolutions) might benefit from higher bitwidths, while layers with many input channels (like standard convolutions) can tolerate lower bitwidths.
- Depth-wise Convolutions are Less Resilient: Depth-wise separable convolutions are found to be less resilient to quantization, incurring larger accuracy degradation compared to standard convolutions when bitwidths are reduced. This is a key factor driving the need for higher bitwidths in architectures that heavily rely on them.
- Width-Multiplier is Key: The ability to adjust network width (number of channels) is crucial for achieving a fair comparison and uncovering the true trade-offs between bitwidth and accuracy.
Key Results
- On CIFAR-100, for ResNets and VGG, 1-bit quantization was found to be optimal when model size was matched.
- For MobileNetV2, 4-bit quantization was found to be optimal on CIFAR-100, highlighting the architecture-dependent nature of the optimal bitwidth.
- On ImageNet, for ResNet50, 1-bit quantization outperformed 8-bit and mixed-precision quantization when model size was aligned.
- For MobileNetV2 on ImageNet, 4-bit quantization also outperformed 8-bit and mixed-precision quantization under similar conditions.
- The paper demonstrates that a single bitwidth strategy can achieve superior accuracy compared to mixed-precision quantization when the model size is constrained and network width is allowed to vary. For instance, on ImageNet, their single-bitwidth approach achieved higher top-1 accuracy than mixed-precision methods for both ResNet50 and MobileNetV2.
Limitations and Future Work
- Focus on Weight Quantization: The study primarily focuses on weight quantization, with activations quantized to a fixed 4 or 8 bits. Future work could explore joint optimization of weight and activation bitwidths.
- Specific Architectures: While several popular architectures are studied, the findings might not generalize to all possible ConvNet designs.
- Hardware Implementation: The paper focuses on theoretical and empirical performance on datasets. The actual hardware implementation benefits and complexities of uniform vs. mixed-precision quantization are not directly addressed.
The authors suggest that their findings have significant implications for hardware and software co-design, potentially simplifying optimization efforts by focusing on a few well-performing bitwidths. They also highlight the importance of considering network width as a hyperparameter when optimizing for parameter-efficiency.
Summary updated