屏蔽注意力网络:反思和强化Transformer
Mask Attention Networks: Rethinking and Strengthen Transformer
摘要:
Transformer是一种基于注意力的神经网络,它由两个子层组成,即自注意力网络(SAN)和前馈网络(FFN)。现有的研究探索分别增强这两个子层,以提高Transformer的文本表示能力。在本文中,我们提出了一个新的理解SAN和FFN的掩模注意力网络(MAN),并表明它们是两个特殊情况下的MAN与静态掩码矩阵。然而,它们的静态掩码矩阵限制了文本表示学习中局部性建模的能力。因此,我们引入了一个新的层,名为动态掩码注意力网络(DMAN),具有可学习的掩码矩阵,能够自适应地对局部性进行建模。结合DMAN,SAN和FFN的优点,我们提出了一个顺序分层结构,结合三种类型的层。对各种任务的广泛实验,包括神经机器翻译和文本摘要,表明我们的模型优于原始的Transformer。
英文摘要:
Transformer is an attention-based neural network, which consists of two sublayers, namely, Self-Attention Network (SAN) and Feed-Forward Network (FFN). Existing research explores to enhance the two sublayers separately to improve the capability of Transformer for text representation. In this paper, we present a novel understanding of SAN and FFN as Mask Attention Networks (MANs) and show that they are two special cases of MANs with static mask matrices. However, their static mask matrices limit the capability for localness modeling in text representation learning. We therefore introduce a new layer named dynamic mask attention network (DMAN) with a learnable mask matrix which is able to model localness adaptively. To incorporate advantages of DMAN, SAN, and FFN, we propose a sequential layered structure to combine the three types of layers. Extensive experiments on various tasks, including neural machine translation and text summarization demonstrate that our model outperforms the original Transformer.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。