arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1906.11024cs.CL
收藏

快速Transformer的注意力权重分担

Sharing Attention Weights for Fast Transformer

Northeastern University(东北大学);NiuTrans Co., Ltd.(小牛翻译有限公司);Kunming University of Science and Technology(昆明理工大学);Institute of Psychology, CAS(中国科学院心理研究所)

Tong Xiao, Yinqiao Li, Jingbo Zhu, Zhengtao Yu, Tongran Liu

摘要:

最近,Transformer机器翻译系统通过在源语言侧和目标语言侧堆叠注意力层而显示出强大的结果。但是,由于自回归解码中大量使用点积注意力,该模型的推理速度较慢。在本文中,我们加快了Transformer通过一个快速和轻量级的注意力模型。更具体地说,我们在相邻层中共享注意力权重,并以垂直方式有效地重用隐藏状态。此外,共享策略可以与MT模型联合学习。我们测试我们的方法上的10个WMT和NIST OpenMT任务。实验结果表明,它产生了平均1.3倍的加速(几乎没有减少BLEU)的最先进的实现,已经采用了高速缓存的快速推理。此外,我们的方法获得了1.8倍的速度时,它与\textsc{Aan}模型。这甚至比不使用注意力缓存的基线快16倍。

英文摘要:

Recently, the Transformer machine translation system has shown strong results by stacking attention layers on both the source and target-language sides. But the inference of this model is slow due to the heavy use of dot-product attention in auto-regressive decoding. In this paper we speed up Transformer via a fast and lightweight attention model. More specifically, we share attention weights in adjacent layers and enable the efficient re-use of hidden states in a vertical manner. Moreover, the sharing policy can be jointly learned with the MT model. We test our approach on ten WMT and NIST OpenMT tasks. Experimental results show that it yields an average of 1.3X speed-up (with almost no decrease in BLEU) on top of a state-of-the-art implementation that has already adopted a cache for fast inference. Also, our approach obtains a 1.8X speed-up when it works with the \textsc{Aan} model. This is even 16 times faster than the baseline with no use of the attention cache.

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

↑