How to Read: Deep Compression: Compressing Deep Neural Network with Pruning, Trained Quantization and Huffman Coding [Reading Guide]

Song Han, Huizi Mao, W. Dally · 2015 · International Conference on Learning Representations

Three-Pass Reading Method

The three-pass reading method is a systematic approach designed to efficiently extract maximum understanding from research papers. The first pass (5-10 minutes) gives you a high-level overview by skimming the title, abstract, introduction, and conclusion. The second pass (up to 1 hour) involves careful reading of the paper with emphasis on methodology and key technical details. The third pass (1-5 hours) focuses on deep understanding, critical analysis, and connecting ideas to related work.

This structured approach helps you determine a paper's relevance quickly, then dive deeper only when needed, making your research workflow more efficient and effective.

This guide will help you efficiently understand "Deep Compression: Compressing Deep Neural Network with Pruning, Trained Quantization and Huffman Coding" using the three-pass approach.


First pass (5–10 min)

What to skim in this paper: Begin by reading the Title, Abstract, Introduction (Section 1), and Conclusion (Section 9). These sections provide a high-level overview of the paper's purpose, methods, and key findings.

What to notice:

  • Problem: Deep Neural Networks (DNNs) are memory and computationally intensive, making them difficult to deploy on resource-constrained embedded systems and mobile devices.
  • Contributions: The paper introduces "Deep Compression," a novel three-stage pipeline: (1) pruning, (2) trained quantization, and (3) Huffman coding. This pipeline significantly reduces model size without accuracy loss.
  • Key Results: The method achieves 35x to 49x storage reduction for AlexNet and VGG-16 on ImageNet, fitting models into on-chip SRAM. It also leads to 3x-4x layer-wise speedup and 3x-7x better energy efficiency.
  • Setting: The primary application context is deploying large DNNs on mobile and embedded systems for real-time inference.

Second pass (up to 1 hour)

Using SpatialRead in the Second Pass

  • Use the Screenshot tool to capture figures, tables, diagrams, and formulae from the PDF and use AI for simple explanations.
  • Ask: "Explain Figure X at a high level", "Compare Table 2 vs 3", or "What does the y-axis represent here?"
  • Download SpatialRead →

What sections/figures to focus on: This pass aims to grasp the main arguments and supporting evidence.

  • Introduction (Section 1): Re-read to understand the motivation for compression (app size, bandwidth, energy consumption due to DRAM access).
  • Figure 1: This is the core diagram of the "Deep Compression" pipeline. Understand the three stages (pruning, quantization, Huffman coding) and the iterative retraining steps after pruning and quantization. Note the approximate compression ratios achieved at each stage.
  • Section 2 (Network Pruning): Understand the basic idea: removing small-weight connections and then retraining the network.
  • Section 3 (Trained Quantization and Weight Sharing): Focus on how weights are clustered using k-means to share values, reducing the number of unique weights.
    • Figure 3: Visually explains weight sharing and how gradients are grouped for fine-tuning shared centroids.
    • Note Equation (1) for the theoretical compression rate calculation from quantization.
  • Section 4 (Huffman Coding): Understand that this stage leverages the non-uniform distribution of quantized weights and sparse matrix indices for further lossless compression.
    • Figure 5: Shows the biased distributions of quantized weights and sparse matrix indices, justifying the use of Huffman coding.
  • Section 5 (Experiments): Skim the experimental setup.
    • Table 1: Provides an excellent summary of the overall compression rates and accuracy for LeNet-300-100, LeNet-5, AlexNet, and VGG-16.
    • Table 4 (AlexNet) and Table 5 (VGG-16): Examine the detailed compression statistics per layer, noting how pruning, quantization, and Huffman coding contribute to the final compression rate.
  • Section 6.1 (Pruning and Quantization Working Together):
    • Figure 6: Crucially demonstrates that combining pruning and quantization achieves much higher compression rates without accuracy loss compared to applying either method individually.
  • Section 6.3 (Speedup and Energy Efficiency):
    • Figure 9: Illustrates the speedup achieved by pruned networks on different hardware (CPU, GPU, mobile GPU) for a batch size of 1.
    • Figure 10: Shows the energy efficiency gains from pruned networks under the same conditions.

Key terms/questions to note:

  • Pruning threshold
  • Weight sharing
  • Codebook and centroids
  • K-means clustering
  • Fine-tuning (after pruning and quantization)
  • Sparse matrix representation (CSR/CSC)
  • Index difference encoding
  • Lossless compression (Huffman coding)
  • Impact of batch size on performance (especially batch size = 1 for real-time inference).

Third pass (1–5 hours)

Using SpatialRead in the Third Pass

  • Highlight complex keywords, dense paragraphs, equations, or proofs and ask for a plain-English explanation that preserves notation.
  • Use AI to explain the concepts in a way that is easy to understand.
  • Ask for alternative phrasings or analogies to confirm understanding without changing technical meaning.
  • Connect concepts with each other using AI to build a comprehensive understanding of the paper.
  • Download SpatialRead →

Deep reading guidance: This pass involves a critical and detailed understanding of the methodology, results, and implications.

  • Methods (Sections 2, 3, 4):
    • Pruning: Delve into how "small-weight connections" are identified and removed. How is the sparse structure stored efficiently (e.g., using relative indexing and filler zeros as shown in Figure 2)?
    • Quantization: Understand the k-means clustering process (Equation 2) and how centroids are initialized (Section 3.2). Pay attention to Figure 4 which compares different centroid initialization methods and their impact on weight distribution. Understand the gradient calculation for shared weights (Equation 3).
    • Huffman Coding: Confirm how the biased distributions (from Figure 5) are exploited to achieve additional compression.
  • Results (Section 5, 6):
    • Thoroughly analyze Tables 1-5. Understand the specific bit-widths chosen for convolutional (CONV) and fully-connected (FC) layers (e.g., 8-bit for CONV, 5-bit for FC for AlexNet/VGG-16).
    • Examine Figure 6 and Figure 7 to understand the synergistic effect of pruning and quantization on accuracy across different bit-widths and compression ratios.
    • Review Figure 8 to see which centroid initialization method (linear) performs best and why (Section 6.2).
    • Analyze Figure 9 and Figure 10 in detail, noting the specific hardware platforms and the context of batch size 1 for real-time applications.
    • Figure 11 provides a breakdown of the storage ratio for weights, indices, and codebook, showing the relative overheads.
  • Limitations and Future Work (Section 8): Identify the acknowledged limitations, such as the lack of off-the-shelf library support for benchmarking quantized networks, which suggests avenues for future research or custom hardware/software development.
  • Related Work (Section 7): Compare Deep Compression's approach and results with other compression techniques mentioned in Table 7, understanding its advantages in terms of compression rate and accuracy preservation.

Replication pointers if applicable:

  • The paper describes a three-stage pipeline: pruning, trained quantization, and Huffman coding, with retraining after the first two stages.
  • Pruning involves removing connections below a threshold and then retraining.
  • Quantization uses k-means clustering to group weights, followed by retraining to fine-tune the shared centroids. Linear initialization of centroids is shown to work best (Section 6.2).
  • Huffman coding is applied offline after all training and fine-tuning are complete.
  • Specific bit-widths (e.g., 8-bit for CONV, 5-bit for FC) are mentioned for ImageNet models.
  • The overall process is iterative, involving training, pruning, retraining, quantization, retraining, and finally Huffman coding.