arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1805.00631cs.CL
收藏

利用平均注意力网络加速神经Transformer

Accelerating Neural Transformer via an Average Attention Network

Xiamen University(厦门大学);Beijing Advanced Innovation Center for Language Resources(北京语言资源高精尖创新中心);Soochow University(苏州大学)

Biao Zhang, Deyi Xiong, Jinsong Su

摘要:

利用可并行化的注意力网络,神经Transformer的训练速度非常快。然而,由于自回归结构和自注意力在解码器中,解码过程变得缓慢。为了缓解这个问题,我们提出了一个平均注意力网络作为替代的自我注意力网络的神经Transformer的解码器。平均注意力网络由两层组成,平均层对先前位置的依赖性进行建模,门控层堆叠在平均层上,以增强所提出的注意力网络的表现力。我们将此网络应用于神经Transformer的解码器部分,以取代原始的目标侧自我注意模型。通过掩蔽技巧和动态规划,我们的模型使神经Transformer能够以比原始版本快四倍的速度解码句子,而几乎没有损失训练时间和翻译性能。我们对WMT 17翻译任务进行了一系列实验,在6种不同的语言对上,我们获得了鲁棒且一致的解码速度。

英文摘要:

With parallelizable attention networks, the neural Transformer is very fast to train. However, due to the auto-regressive architecture and self-attention in the decoder, the decoding procedure becomes slow. To alleviate this issue, we propose an average attention network as an alternative to the self-attention network in the decoder of the neural Transformer. The average attention network consists of two layers, with an average layer that models dependencies on previous positions and a gating layer that is stacked over the average layer to enhance the expressiveness of the proposed attention network. We apply this network on the decoder part of the neural Transformer to replace the original target-side self-attention model. With masking tricks and dynamic programming, our model enables the neural Transformer to decode sentences over four times faster than its original version with almost no loss in training time and translation performance. We conduct a series of experiments on WMT17 translation tasks, where on 6 different language pairs, we obtain robust and consistent speed-ups in decoding.

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

↑