Deep Compression: Compressing Deep Neural Networks with Pruning, Trained Quantization and Huffman Coding
1. Research problem
Large trained networks exceed on-chip memory and bandwidth budgets of embedded and mobile hardware.
2. Motivation
The authors wanted a compression pipeline that preserves accuracy while fitting models into much smaller storage.
3. Previous approaches
Pruning and quantization were known separately, but a combined multi-stage pipeline with retraining and entropy coding had not been systematically demonstrated.
4. Core contribution
Combined magnitude pruning, trained quantization with shared codebooks, and Huffman coding into a three-stage compression pipeline with large size reductions.
5. Mathematical formulation
Prune small-magnitude weights, retrain the sparse network, quantize weights to a small shared codebook and retrain the codebook, then Huffman-encode the quantized indices.
6. Methodology
Iterative prune-retrain cycles followed by codebook-based vector quantization and entropy coding, with accuracy measured after each stage.
7. Architecture
Applied to convolutional and fully connected layers of AlexNet, VGG-16, and LeNet.
8. Experimental setup
ImageNet and MNIST compression with measurement of storage, accuracy, and estimated speed/energy.
9. Datasets
ImageNet, MNIST.
10. Results
Achieved 35x to 49x compression on AlexNet and VGG-16 with no accuracy loss and notable speed and energy improvements.
11. Limitations
Structured hardware acceleration of irregular sparse weights is hard; Huffman coding complicates random access; retraining stages are costly.
12. Critical analysis
A foundational quantization/pruning pipeline; modern methods still grapple with turning unstructured sparsity into actual wall-clock speedups.
13. Implementation tasks
- 1.Implement magnitude pruning plus retraining on a small CNN and measure accuracy versus sparsity.
- 2.Quantize weights to a fixed codebook and compare top-1 accuracy with the uncompressed model.
- 3.Estimate storage savings from entropy coding of quantized indices.
14. Follow-up work
- 1.Mixed Precision Training (Micikevicius et al., 2017)
- 2.LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale (Dettmers et al., 2022)
15. Open research questions
- 1.How can unstructured sparsity be mapped efficiently to real hardware?
- 2.What is the optimal bit width per layer for a given accuracy budget?