arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2109.08449cs.CLcs.LG
收藏

预训练语言模型到矩阵嵌入的通用跨体系结构蒸馏

General Cross-Architecture Distillation of Pretrained Language Models into Matrix Embeddings

Max Planck Institute for Psycholinguistics(马克斯·普朗克心理语言学研究所);University of Ulm(乌尔姆大学)

Lukas Galke, Isabelle Cuber, Christoph Meyer, Henrik Ferdinand Nölscher, Angelina Sonderecker, Ansgar Scherp

摘要:

大型预训练语言模型(PreLM)正在所有基准测试中彻底改变自然语言处理。然而,它们的庞大规模对于小型实验室或在移动设备上的部署来说是令人望而却步的。修剪和蒸馏等方法可以减小模型大小,但通常保留相同的模型架构。相比之下,我们探索将PreLM提取到一个不同的,更有效的架构中,即连续字乘法(CMOW),它将每个字嵌入为矩阵,并使用矩阵乘法来编码序列。我们扩展了CMOW架构及其CMOW/CBOW-Hybrid变体,其中包含双向组件以获得更强的表达能力,预训练期间用于一般(任务不可知)蒸馏的每个令牌表示,以及促进句子对下游任务的双序列编码方案,例如句子相似性和自然语言推理。我们的基于矩阵的双向CMOW/CBOW-Hybrid模型在问题相似度和识别文本蕴涵方面与DistilBERT具有竞争力,但仅使用一半的参数,并且在推理速度方面快三倍。除了情感分析任务SST-2和语言可接受性任务CoLA之外,我们匹配或超过了GLUE基准的所有任务的ELMo分数。然而,与以前的跨架构蒸馏方法相比,我们在检测语言可接受性方面的得分增加了一倍。这表明基于矩阵的嵌入可以用于将大型PreLM提取为竞争模型,并激励在此方向上进行进一步的研究。

英文摘要:

Large pretrained language models (PreLMs) are revolutionizing natural language processing across all benchmarks. However, their sheer size is prohibitive for small laboratories or for deployment on mobile devices. Approaches like pruning and distillation reduce the model size but typically retain the same model architecture. In contrast, we explore distilling PreLMs into a different, more efficient architecture, Continual Multiplication of Words (CMOW), which embeds each word as a matrix and uses matrix multiplication to encode sequences. We extend the CMOW architecture and its CMOW/CBOW-Hybrid variant with a bidirectional component for more expressive power, per-token representations for a general (task-agnostic) distillation during pretraining, and a two-sequence encoding scheme that facilitates downstream tasks on sentence pairs, such as sentence similarity and natural language inference. Our matrix-based bidirectional CMOW/CBOW-Hybrid model is competitive to DistilBERT on question similarity and recognizing textual entailment, but uses only half of the number of parameters and is three times faster in terms of inference speed. We match or exceed the scores of ELMo for all tasks of the GLUE benchmark except for the sentiment analysis task SST-2 and the linguistic acceptability task CoLA. However, compared to previous cross-architecture distillation approaches, we demonstrate a doubling of the scores on detecting linguistic acceptability. This shows that matrix-based embeddings can be used to distill large PreLM into competitive models and motivates further research in this direction.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑