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

任务无关蒸馏方法用于压缩Transformer语言模型的比较分析

A Comparative Analysis of Task-Agnostic Distillation Methods for Compressing Transformer Language Models

IBM Research AI(IBM研究院人工智能部门)

Takuma Udagawa, Aashka Trivedi, Michele Merler, Bishwaranjan Bhattacharjee

AI总结:

本文比较分析了任务无关蒸馏方法(OD、HS、MHA)压缩Transformer语言模型,发现基于MiniLMv2的MHA迁移最优,HS迁移有竞争力,OD迁移最差,并用于延迟关键型应用。

摘要:

大型语言模型已成为现代自然语言处理中至关重要的组成部分,在各种任务中取得了最先进的性能。然而,由于推理成本高昂,它们在实际部署中往往效率低下。知识蒸馏是一种有前景的技术,可以在保留大部分有效性的同时提高其效率。在本文中,我们复现、比较并分析了若干种代表性的任务无关(通用)蒸馏方法,用于Transformer语言模型。我们的研究对象包括输出分布(OD)迁移、具有各种层映射策略的隐藏状态(HS)迁移,以及基于MiniLMv2的多头注意力(MHA)迁移。通过大量实验,我们研究了每种方法在不同学生架构下在单语(英语)和多语言环境中的有效性。总体而言,我们表明基于MiniLMv2的MHA迁移通常是蒸馏的最佳选择,并解释了其成功背后的潜在原因。此外,我们表明HS迁移仍然是一个有竞争力的基线,特别是在复杂的层映射策略下,而OD迁移始终落后于其他方法。本研究的发现帮助我们为延迟关键型应用部署了高效且有效的学生模型。

英文摘要:

Large language models have become a vital component in modern NLP, achieving state of the art performance in a variety of tasks. However, they are often inefficient for real-world deployment due to their expensive inference costs. Knowledge distillation is a promising technique to improve their efficiency while retaining most of their effectiveness. In this paper, we reproduce, compare and analyze several representative methods for task-agnostic (general-purpose) distillation of Transformer language models. Our target of study includes Output Distribution (OD) transfer, Hidden State (HS) transfer with various layer mapping strategies, and Multi-Head Attention (MHA) transfer based on MiniLMv2. Through our extensive experiments, we study the effectiveness of each method for various student architectures in both monolingual (English) and multilingual settings. Overall, we show that MHA transfer based on MiniLMv2 is generally the best option for distillation and explain the potential reasons behind its success. Moreover, we show that HS transfer remains as a competitive baseline, especially under a sophisticated layer mapping strategy, while OD transfer consistently lags behind other approaches. Findings from this study helped us deploy efficient yet effective student models for latency-critical applications.

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

↑