Automated Model Compression by Jointly Applied Pruning and Quantization

Wenting Tang, Xingxing Wei, Bo LiOpenReview 2020

Abstract: In the traditional deep compression framework, iteratively performing network pruning and quantization can reduce the model size and computation cost to meet the deployment requirements. However, such a step-wise application of pruning and quantization may lead to suboptimal solutions and unnecessary time consumption. In this paper, we tackle this issue by integrating network pruning and quantization as a unified joint compression problem and then use AutoML to automatically solve it. We find the pruning process can be regarded as the channel-wise quantization with 0 bit. Thus, the separate two-step pruning and quantization can be simplified as the one-step quantization with mixed precision. This unification not only simplifies the compression pipeline but also avoids the compression divergence. To implement this idea, we propose the automated model compression by jointly applied pruning and quantization (AJPQ). AJPQ is designed with a hierarchical architecture: the layer controller controls the layer sparsity, and the channel controller decides the bit-width for each kernel. Following the same importance criterion, the layer controller and the channel controller collaboratively decide the compression strategy. With the help of reinforcement learning, our one-step compression is automatically achieved. Compared with the state-of-the-art automated compression methods, our method obtains a better accuracy while reducing the storage considerably. For fixed precision quantization, AJPQ can reduce more than five times model size and two times computation with a slight performance increase for Skynet in remote sensing object detection. When mixed-precision is allowed, AJPQ can reduce five times model size with only 1.06% top-5 accuracy decline for MobileNet in the classification task.

Introduction

Deep Neural Networks (DNNs) have achieved remarkable success across various domains, yet their deployment on resource-constrained edge devices—such as smartphones, drones, and IoT sensors—remains a significant challenge. To bridge this gap, researchers typically employ two primary techniques: pruning (removing redundant connections or channels) and quantization (reducing the numerical precision of weights).

Traditionally, these techniques are applied sequentially in a "Deep Compression" pipeline: first pruning the network, then quantizing the remaining weights. However, this sequential approach often leads to "compression divergence," where pruning decisions are made without considering the subsequent impact of quantization, resulting in suboptimal global solutions. Furthermore, searching for optimal strategies for two separate stages is computationally expensive.

The Unified Joint Compression Framework

The core innovation of this work is the realization that pruning and quantization can be unified. Specifically, the authors observe that pruning is essentially channel-wise quantization with 0 bits. By viewing the problem through this lens, the traditional two-step process can be collapsed into a single, one-step mixed-precision quantization problem.

Comparison between the traditional Deep Compression framework and the proposed Joint Compression framework.

This unification simplifies the optimization landscape and allows the system to find a global balance between model performance and hardware constraints (e.g., model size and accuracy loss) in a single pass.

AJPQ Architecture

To solve this unified optimization problem, the authors propose AJPQ (Automated Joint Pruning and Quantization). AJPQ utilizes a hierarchical reinforcement learning architecture based on the Deep Deterministic Policy Gradient (DDPG) algorithm to navigate the massive search space of potential compression plans.

The AJPQ framework overview, showing the interaction between the RL agent, the environment constraints, and the resulting quantization plan.

The framework consists of two primary components:

  1. Layer Controller: This agent predicts the layer sparsity, determining the number of channels to be pruned (assigned 0 bits) for each layer.
  2. Channel Controller: For the preserved channels, this controller decides the specific bit-width (e.g., 1-8 bits) for each kernel. It employs a greedy search based on the L1-norm importance criterion to assign higher precision to critical channels while adhering to a total size budget.

By splitting the decision-making process, AJPQ can efficiently manage a search space where every channel could potentially have a different bit-width, a task that would be computationally intractable for standard AutoML methods.

Experimental Results

The authors evaluated AJPQ against state-of-the-art automated compression tools like AMC and HAQ across two distinct tasks: image classification and object detection.

Image Classification (MobileNet on ImageNet)

AJPQ demonstrated superior performance on the MobileNet architecture using a subset of the ImageNet dataset. It achieved a 69.48% top-1 accuracy with a compression ratio of 0.189 bits, significantly outperforming the AMC+HAQ baseline (66.69%). Notably, AJPQ reached its optimal solution in just 100 searching episodes, whereas competing methods required between 500 and 900 episodes.

Object Detection (SkyNet on Remote Sensing Data)

In a remote sensing task involving coastal and ocean tracking, AJPQ was used to compress the hardware-efficient SkyNet model. The results were striking: AJPQ did not just maintain performance; it increased Average Precision (AP) by 4.5% while simultaneously reducing model size by over 5x and computation by 2x. This suggests that joint optimization can act as a regularizer, improving the model's ability to generalize.

Conclusion

AJPQ represents a significant step forward in automated model compression. By unifying pruning and quantization into a single mathematical framework and employing a hierarchical RL approach, the authors have created a system that is faster, more stable, and more effective than traditional sequential methods. Future work may involve integrating actual hardware latency measurements into the reward function and exploring unstructured pruning to achieve even higher compression ratios.

Summary updated

BibTeX
@misc{tang2020automated,
  author = {Wenting Tang and Xingxing Wei and Bo Li},
  title = {{Automated Model Compression by Jointly Applied Pruning and Quantization}},
  year = {2020},
  eprint = {2011.06231},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2011.06231},
  howpublished = {OpenReview},
}
Figure