TL;DR
Researchers have developed a method to "extremely" compress BERT-style models using advanced tensor decomposition. By exploiting redundancy across different layers and heads, they shrank the encoder to just 1/48th of its original size while retaining 96.7% of its performance and achieving a 2.7x inference speedup. This proves that high-performing NLP models can be made small enough for edge devices without severe degradation.
The "Weight" Problem of Large Language Models
Large-scale Pre-trained Language Models (PLMs) like BERT and GPT have revolutionized natural language processing, but they come with massive computational and ecological costs. They are expensive to run, consume vast amounts of energy, and are often too large for edge deployment.
While techniques like pruning and quantization exist, they often hit a "compression ceiling." The authors argue that current models are massively over-parameterized, exhibiting redundancy not just within individual weight matrices (intra-matrix redundancy), but also across different layers (inter-matrix redundancy).
To push past existing limits, this paper tackles extreme parameter compression, aiming to squash these models down much further than previously thought possible without sacrificing significant accuracy or speed.
Methods: The Power of Tensor Decomposition
The core of their approach relies on Tensor Decomposition, specifically a variation known as Tucker Decomposition.
- The Matrix Bank (Tucker Decomposition): Instead of storing every weight matrix for every layer, the researchers create a "matrix bank"—a shared pool of small basis matrices. Each actual weight matrix in the model is represented as a unique linear combination of these shared bases. This allows the model size to stay nearly constant even as more layers are added.
- Exploiting Decomposability: Transformer components, such as Self-Attention and Feed-Forward Networks, are "decomposable." They can be broken into independent sub-parts (like attention heads) that often learn redundant patterns, making them prime targets for this shared matrix approach.
- Two-Stage Knowledge Distillation (KD): Simply decomposing weights mathematically leads to a performance drop due to approximation discrepancies. To recover accuracy, the authors use the original BERT as a "teacher" to re-train the compressed "student" model in two stages: General Distillation (learning internal representations) and Task-specific Distillation (fine-tuning for the end goal).
- Efficient Reconstruction Protocol: A common pitfall of decomposition is that the extra math required to "reconstruct" the weights during a forward pass can slow the model down. The authors derived a specific order of matrix multiplications that minimizes computational overhead, ensuring the compressed model is actually faster in practice.
Key Insights and Results
The models were evaluated on the GLUE (General Language Understanding Evaluation) benchmark (including SST-2, MNLI, QNLI, QQP, MRPC, RTE, and STS-B) and compared against the original BERT-base, ALBERT, and TinyBERT.
- Global Redundancy: Most compression focuses on one layer at a time. This paper shows that patterns learned in early layers are often very similar to those in later layers. Sharing a "matrix bank" across the entire depth of the model successfully exploits this cross-layer redundancy.
- Extreme Compression: The "Tiny" version of their model achieved 96.7% of BERT-base performance with only 1/48th of the encoder parameters (less than 2M parameters total, excluding embeddings). Another variant achieved 1/7th the parameters in the Transformer layers while performing on-par with or slightly better than the original BERT-base.
- Inference Speedup: By re-arranging how the compressed matrices interact with the input data, the authors turned a potential mathematical slowdown into a significant speedup. The compressed models were 2.7x faster than the original BERT-base on a standard V100 GPU.
- Orthogonality to Distillation: Their method is complementary to existing techniques. Applying their decomposition to an already-distilled model (TinyBERT) yielded even better results, proving these compression strategies can be stacked.
Limitations and Future Work
- Embedding Layer: The authors did not compress the embedding layer, noting that while it is large, it acts as a computationally "cheap" lookup table. For truly extreme edge deployment, compressing the embedding layer is the logical next step.
- Encoder-Only Focus: Experiments were limited to BERT (an encoder-only model). Future work should explore applying these techniques to massive decoder-only models like GPT.
- Training Overhead: While the final deployed model is fast and small, the initial process of decomposition followed by two stages of Knowledge Distillation adds significant computational overhead to the training phase.
Summary updated