Abstract
The rapid advancement of Natural Language Processing (NLP) has been driven by increasingly massive deep learning models like BERT, GPT, and T5. However, their immense size poses significant challenges for deployment on resource-constrained devices. This survey provides a comprehensive roadmap for model compression, categorizing techniques into six major pillars: pruning, quantization, knowledge distillation, parameter sharing, tensor decomposition, and efficient Transformer architectures. We explore how these methods bridge the "efficiency gap" between state-of-the-art performance and hardware limitations.
Introduction
The "size explosion" in NLP has revolutionized the field but at a substantial cost. Modern models require gigabytes of memory and high-end GPUs, creating a barrier for real-world deployment on mobile phones, IoT sensors, and low-latency environments. This survey organizes the extensive body of work in model compression to help researchers and engineers navigate the trade-offs between model size, latency, and accuracy.
Methodology and Taxonomy
The landscape of model compression is structured around six distinct methodologies, as illustrated in the taxonomy below.
1. Pruning
Pruning involves removing redundant components of a network. This can range from unstructured pruning (individual weights) to structured pruning (neurons, attention heads, or entire layers). As shown in Figure 2, different pruning granularities target different structural elements of the model, allowing for varying degrees of hardware-friendly acceleration.
2. Quantization
Quantization reduces the precision of weights, moving from 32-bit floating-point representations to lower-bit formats like 8-bit, 4-bit, or even binary (1-bit) weights.
3. Knowledge Distillation (KD)
KD involves training a smaller "student" model to mimic a larger "teacher" model. It is currently the most prevalent method for compressing Transformers.
4. Parameter Sharing
This technique forces different parts of the model to use the same weights, reducing the total number of unique parameters (e.g., ALBERT shares weights across all its layers).
5. Tensor Decomposition
Linear algebra techniques like Singular Value Decomposition (SVD) or Tensor Train are used to factorize large weight matrices into smaller, more efficient ones.
6. Sub-quadratic Transformers
These methods replace the standard $O(n^2)$ self-attention mechanism with more efficient linear or super-linear alternatives to handle longer sequences.
Benchmarks and Evaluation
The effectiveness of these compression methods is evaluated across standard NLP benchmarks, including GLUE, SuperGLUE, SQuAD for question answering, and various language modeling tasks like WikiText-103 and the One Billion Word Benchmark.
Key Insights and Ideas
- The Pruning Paradox: Pruning a large model often yields better results than training a small model from scratch, as the process acts as a powerful regularizer.
- Transformer Resilience: Transformers are notably resistant to quantization, often maintaining accuracy even at 4-bit precision.
- Knowledge Distillation Dominance: Distilling a Transformer into a simpler architecture like a BiLSTM can result in models that are up to 434x faster while retaining significant performance.
- Inherent Redundancy: Research suggests that only about 5% of a model's weights are strictly necessary for performance; the rest is over-parameterization that aids training but isn't needed for inference.
- Layer Dropping: A simple "Every Other Layer" strategy works remarkably well for BERT-style models.
Key Results
- TinyBERT: Achieves 96% of BERT-base performance on GLUE while being 7.5x smaller and 9.4x faster.
- MobileBERT: Provides a 5.5x speedup over BERT-base, reaching a 62ms latency on a Pixel 4 phone.
- Distilled BiLSTM: Uses 349x fewer parameters than BERT-large, making it feasible for the most resource-constrained environments.
- Quantization Savings: Methods like Alternating LAQ can achieve 10.5x memory savings and 3x real inference acceleration on LSTMs.
Future Directions
Despite significant progress, several challenges remain:
- Hardware Specificity: Compression gains are highly dependent on the target hardware architecture (e.g., Nvidia RTX vs. mobile CPUs).
- Combinatorial Research: There is a need for more studies on combining multiple techniques (e.g., "Quantized Distilled Pruning").
- Interpretability and Bias: The impact of compression on a model's internal knowledge and inherent biases is not yet fully understood.
- Automation: Utilizing Reinforcement Learning to automatically discover optimal compression strategies is a promising frontier.
Summary updated