In natural language processing (NLP) tasks, slow inference speed and huge footprints in GPU usage remain the bottleneck of applying pre-trained deep models in production. As a popular method for model compression, knowledge distillation transfers knowledge from one or multiple large (teacher) models to a small (student) model. When multiple teacher models are available in distillation, the state-of-the-art methods assign a fixed weight to a teacher model in the whole distillation. Furthermore, most of the existing methods allocate an equal weight to every teacher model. In this paper, we observe that, due to the complexity of training examples and the differences in student model capability, learning differentially from teacher models can lead to better performance of student models distilled. We systematically develop a reinforced method to dynamically assign weights to teacher models for different training instances and optimize the performance of student model. Our extensive experimental results on several NLP tasks clearly verify the feasibility and effectiveness of our approach.
翻译:在自然语言处理(NLP)任务中,在GPU使用中,缓慢的推导速度和巨大的脚印仍然是在生产中应用预先训练的深层模型的瓶颈。知识蒸馏作为一种流行的模型压缩方法,知识蒸馏将知识从一个或多个大型(教师)模型转移到一个小型(学生)模型。当多种教师模型在蒸馏中可用时,最先进的方法在整个蒸馏中给教师模型分配固定的重量。此外,大多数现有方法给每个教师模型分配同等的份量。在本文中,我们注意到,由于培训实例的复杂性和学生模型能力的差异,与教师模型不同,学习能够提高蒸馏学生模型的性能。我们系统地开发一种强化的方法,为不同培训实例的教师模型动态分配重量,优化学生模型的性能。我们关于NLP数项任务的广泛实验结果明确验证了我们方法的可行性和有效性。