LadaBERT: Lightweight Adaptation of BERT through Hybrid Model Compression

Yihuan Mao, Yujing Wang, Chufan Wu, Chen Zhang, Yang Wang, Yaming Yang, Quanlu Zhang, Yunhai Tong, Jing Bai

Abstract

LadaBERT (Lightweight Adaptation of BERT) is a novel framework designed to compress massive BERT models efficiently. By combining weight pruning, matrix factorization, and knowledge distillation in an iterative pipeline, LadaBERT achieves state-of-the-art accuracy on natural language processing tasks. Notably, it reduces training overhead by an order of magnitude compared to existing methods like TinyBERT, making it highly suitable for resource-constrained environments and real-time services.

Introduction

While BERT has revolutionized Natural Language Processing (NLP), its massive size—exceeding 110 million parameters for the base model—presents a significant barrier to deployment. It is often too slow for real-time online services and too memory-intensive for mobile devices. Existing solutions typically rely on Knowledge Distillation (KD), where a small "student" model is trained to mimic a large "teacher." However, these methods are computationally expensive, often requiring days of re-training on massive datasets. LadaBERT addresses this by asking: Can we create adaptive, small models without the massive time and resource cost?

Methodology

LadaBERT introduces an iterative hybrid compression pipeline that integrates three complementary techniques to systematically reduce model size while preserving performance.

  1. Matrix Factorization (SVD): Singular Value Decomposition breaks down large weight matrices into two smaller, low-rank matrices ($W \approx AB^T$), significantly reducing the parameter count.
  2. Weight Pruning: Unstructured pruning is applied to the decomposed matrices, removing the least important connections to introduce sparsity.
  3. Knowledge Distillation (KD): To recover accuracy lost during compression, the model is fine-tuned under the guidance of the original BERT teacher across four levels: embeddings, attention maps, hidden representations, and final predictions.
The iterative hybrid compression pipeline of LadaBERT, showing the transition from a full teacher model to a target-sized student through SVD, pruning, and KD.

Unlike methods that start with a randomly initialized student, LadaBERT begins with the full teacher model and compresses it iteratively. By shrinking the model by a small ratio ($\Delta$) at each step and performing KD, the student retains the teacher's knowledge more effectively and converges much faster.

Experimental Setup

The authors evaluated LadaBERT on five major datasets from the GLUE (General Language Understanding Evaluation) benchmark: SST-2 (sentiment), QQP (semantic equivalence), MNLI-m/mm (inference), and QNLI (question-answering). These benchmarks measure the model's ability to handle diverse linguistic nuances.

Results and Discussion

LadaBERT demonstrates superior performance-to-size trade-offs compared to existing compression techniques.

Accuracy vs. parameter size for various BERT compression methods. LadaBERT consistently maintains higher accuracy at smaller parameter counts compared to baselines.

Key Findings:

  • Efficiency: On the MNLI-m dataset, LadaBERT reached the same accuracy level as TinyBERT in just 20,000 steps—a 10x acceleration in training speed compared to TinyBERT's 200,000 steps.
  • Accuracy: LadaBERT-3 (at 7.5x compression) outperformed both TinyBERT and BERT-Small. Even at 10x compression, the model retained significant performance (e.g., 84.0 on SST-2).
  • Hybrid Synergy: The combination of factorization (global structure) and pruning (local sparsity) proved more effective than using either technique in isolation. This hybrid approach results in a smoother weight distribution, making the model more stable during fine-tuning.

Conclusion

LadaBERT proves that massive data augmentation and weeks of compute are not strictly necessary for effective model compression. By utilizing an iterative hybrid approach, it achieves state-of-the-art results with significantly lower overhead. Future work will focus on optimizing hyperparameters for new tasks and exploring specialized hardware kernels to better leverage the speed benefits of unstructured sparsity in industrial applications.

Summary updated

BibTeX
@inproceedings{mao2020ladabert,
  author = {Yihuan Mao and Yujing Wang and Chufan Wu and Chen Zhang and Yang Wang and Yaming Yang and Quanlu Zhang and Yunhai Tong and Jing Bai},
  title = {{LadaBERT: Lightweight Adaptation of BERT through Hybrid Model Compression}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2020},
  url = {https://openreview.net/forum?id=aQao3npPJz},
}
Figure