Differentiable Joint Pruning and Quantization for Hardware Efficiency

Ying Wang, Yadong Lu, Tijmen Blankevoort

Abstract

Deploying deep neural networks (DNNs) on resource-constrained edge devices requires aggressive model compression. Traditionally, pruning and quantization are applied sequentially, a process that often leads to suboptimal hardware efficiency and accuracy trade-offs. This paper introduces Differentiable Joint Pruning and Quantization (DJPQ), a framework that optimizes both techniques simultaneously in a single training pass. By utilizing a differentiable loss function centered on Bit-Operations (BOPs), DJPQ achieves up to a 53x reduction in computational complexity on ImageNet with minimal accuracy loss.

Introduction

To facilitate the deployment of deep neural networks on mobile or embedded hardware, researchers typically rely on two primary compression strategies: pruning, which removes redundant neurons or channels, and quantization, which reduces the numerical precision of weights and activations.

Conventionally, these techniques are treated as a decoupled, two-stage process where a model is pruned first and quantized second. However, this approach is inherently suboptimal. A heavily pruned model possesses less redundancy, making it hypersensitive to the quantization noise introduced in the second stage. Conversely, maintaining high-precision weights might allow for more aggressive pruning. Because layer sensitivity varies across an architecture, manually balancing these two dimensions is intractable. DJPQ addresses this by treating pruning and quantization as a joint, gradient-based optimization problem, automatically discovering the optimal trade-off for hardware efficiency.

Methodology

The core of the DJPQ framework is a single, differentiable loss function that balances task accuracy against a hardware-efficiency metric known as Bit-Operations (BOPs). The methodology consists of four primary components:

1. Structured Pruning via VIBNet

DJPQ utilizes a Variational Information Bottleneck (VIB) approach for structured pruning. The authors incorporate "Gaussian gates" into each channel. During the training process, the model learns which gates to deactivate to minimize mutual information between layers—thereby increasing sparsity—while simultaneously maximizing the information retained for the final prediction.

2. Learnable Mixed-Precision Quantization

Rather than applying a uniform bit-width across the entire network, DJPQ enables each layer to select its own optimal precision. The framework employs a continuous relaxation of the bit-width and utilizes a Straight-Through Estimator (STE) to allow gradients to flow through the non-differentiable quantization operations.

3. Hardware-Friendly Constraints

To ensure the resulting models are compatible with actual digital hardware, the authors introduced bit-restricted quantization. This forces the optimization process to select from discrete power-of-two values (e.g., 2, 4, 8, 16, or 32 bits), avoiding the impracticality of arbitrary fractional bit-widths.

4. Joint Optimization Objective

The final objective function combines the standard task loss (such as Cross-Entropy) with a VIB regularization term and a BOPs penalty. This allows the model to navigate the trade-off between accuracy and computational cost end-to-end.

Experimental Results

The researchers evaluated DJPQ on standard computer vision benchmarks, including CIFAR-10 (using VGG7) and ImageNet (using ResNet18 and MobileNetV2). The results demonstrate that DJPQ consistently outperforms both independent two-stage optimization and state-of-the-art quantization-only methods.

  • ResNet18 (ImageNet): The framework achieved a 53x reduction in BOPs with only a 0.47% drop in top-1 accuracy.
  • MobileNetV2 (ImageNet): DJPQ achieved a 43x reduction in BOPs within a 2.4% accuracy drop. This is particularly significant as MobileNetV2 is already a highly optimized, compact architecture.
  • VGG7 (CIFAR-10): The method reduced BOPs by 210x with less than 1.5% accuracy loss.

Even when restricted to power-of-two bit-widths (DJPQ-restrict), the method maintained higher compression ratios and superior accuracy compared to conventional approaches.

Discussion and Insights

The Sparsity-Precision Seesaw

The optimization process dynamically balances channel count and bit-depth. A key observation was that if a layer is pruned significantly, the optimizer often compensates by assigning a higher bit-width to the remaining channels to preserve essential information.

Layer Sensitivity Mapping

The authors found that earlier layers in a network are typically pruned more aggressively. Furthermore, in architectures like ResNet, residual connections often require higher bit-precision than regular branches to maintain overall network accuracy. In MobileNetV2, the model learned that point-wise convolutions are more sensitive to quantization than depth-wise convolutions, automatically allocating more bits to the former.

Operational Efficiency

Unlike iterative "prune-then-fine-tune" cycles that can require weeks of computation, DJPQ compresses the model within a single training procedure, significantly reducing the engineering overhead required for model deployment.

Conclusion

DJPQ represents a significant step forward in automated model compression by unifying pruning and quantization into a single differentiable framework. While the current study uses BOPs as a proxy for hardware efficiency, future work may involve incorporating more specific hardware metrics such as direct power consumption or latency for specific ASIC and FPGA architectures. Additionally, extending this joint optimization to tasks like object detection and speech recognition remains a promising avenue for future research.

Summary updated

BibTeX
@inproceedings{wang2020differentiable,
  author = {Ying Wang and Yadong Lu and Tijmen Blankevoort},
  title = {{Differentiable Joint Pruning and Quantization for Hardware Efficiency}},
  booktitle = {European Conference on Computer Vision},
  year = {2020},
  doi = {10.1007/978-3-030-58526-6\_16},
}
Figure