[Paper Review] Model Compression with Two-stage Multi-teacher Knowledge Distillation for Web Question Answering System
This paper proposes Two-stage Multi-teacher Knowledge Distillation (TMKD), a method that first pre-trains a student model on a multi-teacher distillation task and then fine-tunes it using knowledge from multiple diverse teacher models (e.g., BERT and GPT). The approach significantly reduces inference latency while matching or exceeding teacher model performance, achieving 79.22% accuracy on a large-scale Q&A dataset—surpassing even the original BERT large model—while enabling substantial speedups in real-world deployment.
Deep pre-training and fine-tuning models (such as BERT and OpenAI GPT) have demonstrated excellent results in question answering areas. However, due to the sheer amount of model parameters, the inference speed of these models is very slow. How to apply these complex models to real business scenarios becomes a challenging but practical problem. Previous model compression methods usually suffer from information loss during the model compression procedure, leading to inferior models compared with the original one. To tackle this challenge, we propose a Two-stage Multi-teacher Knowledge Distillation (TMKD for short) method for web Question Answering system. We first develop a general Q\&A distillation task for student model pre-training, and further fine-tune this pre-trained student model with multi-teacher knowledge distillation on downstream tasks (like Web Q\&A task, MNLI, SNLI, RTE tasks from GLUE), which effectively reduces the overfitting bias in individual teacher models, and transfers more general knowledge to the student model. The experiment results show that our method can significantly outperform the baseline methods and even achieve comparable results with the original teacher models, along with substantial speedup of model inference.
Motivation & Objective
- To address the high inference latency of large pre-trained models (e.g., BERT, GPT) in real-time web question answering systems.
- To overcome performance degradation in model compression caused by knowledge distillation-induced information loss.
- To improve student model generalization by leveraging diverse, multi-source knowledge from multiple teacher models.
- To enable efficient deployment of compressed models in production-scale web Q&A pipelines with strict latency constraints (≤10ms).
- To explore the impact of training data scale, model depth, and loss weighting on distillation effectiveness.
Proposed method
- Introduces a two-stage training pipeline: first, pre-train the student model on a general Q&A distillation task using outputs from multiple teacher models.
- Second, fine-tune the pre-trained student model using multi-teacher knowledge distillation (m-o-1) on downstream tasks such as Web Q&A, MNLI, SNLI, and RTE.
- Uses soft label distillation with a weighted loss combining cross-entropy on golden labels and knowledge distillation loss from multiple teachers.
- Employs a dynamic loss weighting ratio α to balance supervision from golden labels and soft labels from multiple teachers.
- Utilizes diverse teacher models (e.g., BERT base/large, GPT) trained with different hyperparameters to reduce overfitting bias and enhance knowledge diversity.
- Applies ensemble distillation where each student is trained on a different teacher, and predictions are combined to improve robustness.
Experimental results
Research questions
- RQ1Can a two-stage multi-teacher distillation framework outperform single-teacher knowledge distillation in terms of student model accuracy and inference efficiency?
- RQ2Does pre-training the student model on a multi-teacher distillation task improve its generalization on downstream NLP tasks?
- RQ3How does the number of transformer layers in the student model affect the trade-off between performance and inference speed?
- RQ4What is the optimal balance between golden label supervision and soft label distillation in multi-teacher knowledge distillation?
- RQ5Can multi-teacher distillation surpass the performance of the original teacher models, especially on large-scale datasets?
Key findings
- TMKD achieves 79.22% accuracy on a 0.1-billion-sample Q&A dataset, exceeding the original BERT large model (77.00%)
- The method outperforms both 1-o-1 and average-based multi-teacher distillation (TKD base) across all evaluated datasets
- With 3 transformer layers, the student model achieves the best performance-to-inference-speed ratio (QPS: 217), balancing accuracy and latency
- Increasing the loss weighting ratio α improves performance up to α = 0.9, but performance drops at α = 1.0, indicating the need for golden label supervision
- The performance gain from increasing layers from 1 to 3 is substantial (e.g., +11.44% on QNLI), but gains from 3 to 5 layers are minimal (e.g., +0.37% on RTE), justifying 3 layers as optimal
- The method enables significant inference speedup—e.g., 5.2ms latency for BERT large vs. ~1.6ms for compressed student models—making it viable for real-time web Q&A systems
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.