Abstract
DoReFa-Net introduces a unified framework to train convolutional neural networks (CNNs) using low bitwidth weights, activations, and gradients. While previous research focused on low-precision inference, DoReFa-Net addresses the training bottleneck by quantizing gradients to as low as 6 bits. By utilizing deterministic quantization for weights and activations and stochastic quantization for gradients, the method enables the use of efficient bitwise operations for the entire training loop. Evaluations on SVHN and ImageNet show that this approach maintains high accuracy while significantly reducing computational and storage requirements.
Introduction
Deep Convolutional Neural Networks (DCNNs) are computationally intensive, often requiring significant memory and processing power. While techniques like binarization (e.g., XNOR-Nets) have successfully optimized the forward pass for inference, the training process typically relies on 32-bit floating-point gradients. DoReFa-Net bridges this gap, demonstrating that training can be performed with low bitwidth gradients, allowing for end-to-end bitwise acceleration on specialized hardware like FPGAs and ASICs.
Methodology
The core of DoReFa-Net is the quantization of three network components:
- Weights (W): Quantized deterministically. For bitwidths greater than 1, a
tanhfunction bounds values between [-1, 1] before mapping them to a $k$-bit grid. - Activations (A): Quantized deterministically. The framework assumes bounded activation functions (like clipped ReLU) to ensure inputs are within [0, 1] before being quantized to $k$ bits.
- Gradients (G): This is the most novel aspect. Unlike weights and activations, gradients are unbounded and highly sensitive. The authors found that stochastic quantization is necessary here; adding uniform noise before quantization acts as a compensator for rounding bias, which is critical for model convergence.
To handle non-differentiable quantization functions, the authors use the Straight-Through Estimator (STE), which allows gradients to flow by ignoring the quantization step during the backward pass.
Experimental Results
The authors evaluated DoReFa-Net on the SVHN and ImageNet datasets. A key finding is the "Bitwidth Hierarchy": gradients generally require more precision than activations, which in turn require more than weights ($G > A > W$).
As shown in the table above, on the SVHN dataset (represented by Model A), a configuration with 1-bit weights, 1-bit activations, and 4-bit gradients achieved 96.8% accuracy, nearly matching the 32-bit baseline of 97.5%. On the more complex ImageNet dataset, an AlexNet variant with 1-bit weights, 2-bit activations, and 6-bit gradients reached 46.1% top-1 accuracy. While an accuracy gap remains compared to full-precision models, the reduction in storage and computational complexity is substantial and scales linearly with bitwidth.
Conclusion
DoReFa-Net provides a theoretical and empirical foundation for training CNNs with low-precision gradients. By proving that gradients can be quantized without catastrophic loss in accuracy, the researchers have opened the door for significantly faster training on custom hardware. While an accuracy gap persists on large-scale datasets like ImageNet, the method offers a clear path toward high-efficiency deep learning training.
Summary updated