On many natural language processing tasks, large pre-trained language models (PLMs) have shown overwhelming performances compared with traditional neural network methods. Nevertheless, their huge model size and low inference speed have hindered the deployment on resource-limited devices in practice. In this paper, we target to compress PLMs with knowledge distillation, and propose a hierarchical relational knowledge distillation (HRKD) method to capture both hierarchical and domain relational information. Specifically, to enhance the model capability and transferability, we leverage the idea of meta-learning and set up domain-relational graphs to capture the relational information across different domains. And to dynamically select the most representative prototypes for each domain, we propose a hierarchical compare-aggregate mechanism to capture hierarchical relationships. Extensive experiments on public multi-domain datasets demonstrate the superior performance of our HRKD method as well as its strong few-shot learning ability. For reproducibility, we release the code at https://github.com/cheneydon/hrkd.
翻译:在许多自然语言处理任务方面,与传统神经网络方法相比,大型的预先培训语言模型(PLM)表现出了压倒性的性能,尽管如此,其庞大的模型规模和低的推论速度阻碍了实际在资源有限的装置上的部署。在本文中,我们的目标是用知识蒸馏来压缩PLM,并提出一种等级关系知识蒸馏法(HRKD),以捕捉等级和域际关系信息。具体地说,为了提高模型能力和可转移性,我们利用元学习的理念,并设置域关系图,以捕捉不同领域的关系信息。为了动态地选择每个领域最具代表性的原型,我们提议了一个等级比较聚合机制,以捕捉等级关系。关于公共多域数据集的广泛实验显示了我们HRKD方法的优异性表现以及其强大的微小的学习能力。关于可复制性,我们在http://github.com/cheneydon/hrkd上发布了代码。