Model Compression

Model compression is a critical subfield of machine learning focused on reducing the size, computational complexity, and memory footprint of deep neural networks (specifically Deep Learning models) to enable efficient deployment. This is vital for running advanced AI applications on resource-constrained devices or in latency-sensitive production environments.

Key Features & Techniques

  1. Pruning

    • Mechanism: Simplifies a model by identifying and removing parameters or connections that contribute minimally to the model’s output.
    • Types:
      • Unstructured Pruning: Removes individual weights, leading to sparse matrices (requires specialized hardware/libraries to see speedups).
      • Structured Pruning: Removes entire coherent units such as channels, filters, or layers, which translates directly to speed improvements on standard hardware.
  2. Quantization

    • Mechanism: Reduces the numerical precision of weights and/or activations.
    • Types:
      • Post-Training Quantization (PTQ): Directly converts a trained high-precision model (e.g., FP32) into a lower-precision representation (e.g., INT8 or INT4) without additional training.
      • Quantization-Aware Training (QAT): Simulates quantization errors during training, enabling the model to learn representations resilient to lower precision.
  3. Knowledge Distillation

    • Mechanism: Transfers knowledge from a large, complex model (the “teacher”) to a smaller, compact model (the “student”). The student is trained to match the output probability distributions (soft labels) of the teacher.
  4. Low-Rank Factorization / Tensor Decomposition

    • Mechanism: Approximates high-dimensional weight tensors using sequences of smaller tensors (e.g., Singular Value Decomposition), cutting both computation and storage requirements.

Benefits & Applications

  • Edge Deployment & TinyML: Enables execution on mobile phones, IoT devices, and smart appliances.
  • Latency and Cost Reduction: Lowers operational costs and increases throughput during inference.
  • Energy Efficiency: Dramatically decreases power consumption for green computing.