[Paper Review] KroneckerBERT: Learning Kronecker Decomposition for Pre-trained Language Models via Knowledge Distillation
KroneckerBERT proposes a novel framework for extreme compression of BERT-based models using Kronecker decomposition across the embedding layer and all linear transformations in Transformer blocks, combined with intermediate-layer knowledge distillation. For a 19× compression factor (5% of BERT_BASE size), KroneckerBERT achieves state-of-the-art performance on GLUE and SQuAD, outperforming prior methods despite high compression.
The development of over-parameterized pre-trained language models has made a significant contribution toward the success of natural language processing. While over-parameterization of these models is the key to their generalization power, it makes them unsuitable for deployment on low-capacity devices. We push the limits of state-of-the-art Transformer-based pre-trained language model compression using Kronecker decomposition. We use this decomposition for compression of the embedding layer, all linear mappings in the multi-head attention, and the feed-forward network modules in the Transformer layer. We perform intermediate-layer knowledge distillation using the uncompressed model as the teacher to improve the performance of the compressed model. We present our KroneckerBERT, a compressed version of the BERT_BASE model obtained using this framework. We evaluate the performance of KroneckerBERT on well-known NLP benchmarks and show that for a high compression factor of 19 (5% of the size of the BERT_BASE model), our KroneckerBERT outperforms state-of-the-art compression methods on the GLUE. Our experiments indicate that the proposed model has promising out-of-distribution robustness and is superior to the state-of-the-art compression methods on SQuAD.
Motivation & Objective
- To address the challenge of deploying large, over-parameterized pre-trained language models on low-capacity edge devices.
- To develop a compression framework that enables extreme compression (factor >10) without significant performance degradation.
- To extend Kronecker decomposition beyond standard matrix decomposition by applying it to the embedding layer and all linear layers in Transformer blocks.
- To improve the performance of compressed models through a two-stage knowledge distillation strategy using intermediate-layer supervision from the teacher model.
- To evaluate the trade-off between model size, inference speed, and accuracy on standard NLP benchmarks.
Proposed method
- Kronecker decomposition is applied to represent weight matrices in the embedding layer, multi-head attention, and feed-forward networks as Kronecker products of smaller matrices, reducing parameter count.
- The method decomposes each weight matrix W as W = A ⊗ B, where A and B are smaller matrices, enabling significant model size reduction.
- Knowledge distillation is applied at both pre-training and fine-tuning stages, using the original BERT_BASE as the teacher to guide the student model's intermediate-layer representations.
- The framework is applied to compress BERT_BASE into KroneckerBERT, with ablation studies validating the impact of distillation.
- Inference speed is evaluated on smartphones and high-performance CPUs to assess real-world latency improvements under compression.
- TorchScript is used to serialize the compressed model for deployment and latency measurement on edge devices.
Experimental results
Research questions
- RQ1Can Kronecker decomposition be effectively applied to the embedding layer and all linear layers in Transformer-based models to enable extreme compression?
- RQ2How does intermediate-layer knowledge distillation mitigate performance degradation in Kronecker-compressed models?
- RQ3What is the performance of KroneckerBERT on standard NLP benchmarks at high compression factors (e.g., 19×)?
- RQ4Does the reduction in FLOPs from Kronecker decomposition translate to actual inference speedup on edge devices?
- RQ5How does KroneckerBERT compare to state-of-the-art compressed models in terms of accuracy and robustness on out-of-distribution data?
Key findings
- KroneckerBERT achieves a 19× compression factor (5% of BERT_BASE size), significantly outperforming existing methods at this compression level.
- On the GLUE benchmark, KroneckerBERT with 19× compression outperforms state-of-the-art compressed BERT models, demonstrating superior compression-performance trade-off.
- On SQuAD, KroneckerBERT shows superior performance compared to state-of-the-art compression methods, indicating strong robustness and generalization.
- The ablation study confirms that knowledge distillation at both pre-training and fine-tuning stages is essential, with the two-stage KD yielding the highest performance.
- On edge devices (smartphones), KroneckerBERT with 19× compression achieves up to 2.4× speedup, confirming practical inference benefits.
- On high-performance CPUs, no speedup is observed due to the serial nature of Kronecker matrix multiplication, highlighting the importance of hardware-aware optimization.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.