Neural networks are both computationally intensive and memory intensive, making them difficult to deploy on embedded systems with limited hardware resources. To address this limitation, we introduce "deep compression", a three stage pipeline: pruning, trained quantization and Huffman coding, that work together to reduce the storage requirement of neural networks by 35x to 49x without affecting their accuracy. Our method first prunes the network by learning only the important connections. Next, we quantize the weights to enforce weight sharing, finally, we apply Huffman coding. After the first two steps we retrain the network to fine tune the remaining connections and the quantized centroids. Pruning, reduces the number of connections by 9x to 13x; Quantization then reduces the number of bits that represent each connection from 32 to 5. On the ImageNet dataset, our method reduced the storage required by AlexNet by 35x, from 240MB to 6.9MB, without loss of accuracy. Our method reduced the size of VGG-16 by 49x from 552MB to 11.3MB, again with no loss of accuracy. This allows fitting the model into on-chip SRAM cache rather than off-chip DRAM memory. Our compression method also facilitates the use of complex neural networks in mobile applications where application size and download bandwidth are constrained. Benchmarked on CPU, GPU and mobile GPU, compressed network has 3x to 4x layerwise speedup and 3x to 7x better energy efficiency.
核心贡献 · Key contributions
提出三阶段流程:剪枝、训练量化和霍夫曼编码,实现 35 倍到 49 倍压缩且不损失精度。 Proposes a three-stage pipeline: pruning, trained quantization, and Huffman coding, achieving 35x to 49x compression without accuracy loss.
在 ImageNet 上将 AlexNet 从 240MB 压缩至 6.9MB,VGG-16 从 552MB 压缩至 11.3MB,支持片上 SRAM 存储。 Reduces AlexNet from 240MB to 6.9MB and VGG-16 from 552MB to 11.3MB on ImageNet, enabling on-chip SRAM storage.
协同结合剪枝与量化,剪枝减少连接 9-13 倍,量化将每个权重的比特数降至 5。 Combines pruning and quantization synergistically, showing pruning reduces connections by 9x-13x and quantization reduces bits per weight to 5.
证明 k-means 聚类的线性初始化能保留大权重,提升量化精度。 Demonstrates linear initialization for k-means clustering preserves large weights, improving quantization accuracy.
在 CPU、GPU 和移动 GPU 上实现 3-4 倍逐层加速和 3-7 倍能效提升。 Achieves 3x-4x layerwise speedup and 3x-7x energy efficiency on CPU, GPU, and mobile GPU.
局限 · Limitations
由于缺乏支持间接查找的库,未对带权值共享的量化网络进行基准测试。 Quantized network with weight sharing not benchmarked due to lack of library support for indirect lookup.
在批处理矩阵乘法中,由于内存局部性改善,剪枝优势减弱。 Pruning advantage diminishes in batched matrix-matrix multiplication due to improved memory locality.
方法聚焦存储压缩;若无专用硬件或定制内核,推理加速有限。 Method focuses on storage compression; inference speedup limited without specialized hardware or custom kernels.
与剪枝和量化相比,霍夫曼编码增益有限(例如 32 倍到 40 倍)。 Huffman coding provides marginal gain (e.g., 32x to 40x) compared to pruning and quantization.
未探索跨层权值共享;每层独立量化。 Weight sharing across layers not explored; each layer quantized independently.
论文章节 · Sections(共 19)
摘要Abstract
1 引言1 Introduction
2 网络剪枝2 Network Pruning
3 训练量化与权重共享3 Trained Quantization and Weight Sharing
3.1 权重共享3.1 Weight Sharing
3.2 共享权重的初始化3.2 Initialization of Shared Weights
3.3 前馈与反向传播3.3 Feed-forward and Back-propagation
4 哈夫曼编码4 Huffman coding
5 实验5 Experiments
5.1 MNIST 上的 LeNet-300-100 和 LeNet-55.1 LeNet-300-100 and LeNet-5 on MNIST
5.2 ImageNet 上的 AlexNet5.2 AlexNet on ImageNet
5.3 ImageNet 上的 VGG-165.3 VGG-16 on ImageNet
6.1 剪枝与量化协同工作6.1 Pruning and Quantization Working Together
6.2 质心初始化6.2 Centroid Initialization
6.3 加速与能效6.3 Speedup and Energy Efficiency
6.4 权重、索引和码本的比率6.4 Ratio of Weights, Index and Codebook