arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2108.01377cs.CL
收藏

一种用于神经机器翻译的头部重要度动态计算机制

A Dynamic Head Importance Computation Mechanism for Neural Machine Translation

International Institute of Information Technology - Hyderabad(海得拉巴国际信息技术学院)

Akshay Goindani, Manish Shrivastava

摘要:

使用多个注意力头的多个并行注意力机制促进了用于各种应用的Transformer模型的更大性能,神经机器翻译(NMT),文本分类。在多头注意力机制中,不同的头注意输入的不同部分。然而,限制是多个磁头可能会处理输入的同一部分,导致多个磁头冗余。因此,模型资源未得到充分利用。避免这种情况的一种方法是基于某个重要性分数来修剪最不重要的头部。在这项工作中,我们专注于设计一个动态的头部重要性计算机制(DHICM),动态地计算相对于输入的头部的重要性。我们的想法是设计一个额外的注意力层与多头注意力,并利用输出的多头注意力与输入,计算每个头的重要性。此外,我们增加了一个额外的损失函数,以防止模型分配相同的分数给所有的头,以识别更重要的头和即兴表演。我们分析了不同语言的NMT的DHICM的性能。在不同数据集上的实验表明,DHICM的性能明显优于传统的基于transformer的方法,特别是在训练数据较少的情况下。

英文摘要:

Multiple parallel attention mechanisms that use multiple attention heads facilitate greater performance of the Transformer model for various applications e.g., Neural Machine Translation (NMT), text classification. In multi-head attention mechanism, different heads attend to different parts of the input. However, the limitation is that multiple heads might attend to the same part of the input, resulting in multiple heads being redundant. Thus, the model resources are under-utilized. One approach to avoid this is to prune least important heads based on certain importance score. In this work, we focus on designing a Dynamic Head Importance Computation Mechanism (DHICM) to dynamically calculate the importance of a head with respect to the input. Our insight is to design an additional attention layer together with multi-head attention, and utilize the outputs of the multi-head attention along with the input, to compute the importance for each head. Additionally, we add an extra loss function to prevent the model from assigning same score to all heads, to identify more important heads and improvise performance. We analyzed performance of DHICM for NMT with different languages. Experiments on different datasets show that DHICM outperforms traditional Transformer-based approach by large margin, especially, when less training data is available.

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

↑