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

Transformers学习硬检索解码器注意力

Learning Hard Retrieval Decoder Attention for Transformers

DFKI(德国人工智能研究中心);Saarland University(萨尔大学);China Mobile Online Services(中国移动在线服务有限公司);Tianjin University(天津大学);Global Tone Communication Technology Co., Ltd.(全球语通通信技术有限公司)

Hongfei Xu, Qiuhui Liu, Josef van Genabith, Deyi Xiong

摘要:

Transformer翻译模型基于多头注意力机制,易于并行化。多头注意力网络并行执行缩放点积注意力函数,通过联合关注来自不同位置的不同表示子空间的信息来赋予模型能力。在本文中,我们提出了一种方法来学习一个硬提取注意,注意头只参加一个令牌的句子,而不是所有的令牌。因此,注意概率与标准标度点积注意中的值序列之间的矩阵乘法可以由简单且有效的检索操作代替。我们表明,我们的硬检索注意力机制是1.43倍的解码速度,同时保留翻译质量的广泛的机器翻译任务时,使用的解码器的自我和交叉注意力网络。

英文摘要:

The Transformer translation model is based on the multi-head attention mechanism, which can be parallelized easily. The multi-head attention network performs the scaled dot-product attention function in parallel, empowering the model by jointly attending to information from different representation subspaces at different positions. In this paper, we present an approach to learning a hard retrieval attention where an attention head only attends to one token in the sentence rather than all tokens. The matrix multiplication between attention probabilities and the value sequence in the standard scaled dot-product attention can thus be replaced by a simple and efficient retrieval operation. We show that our hard retrieval attention mechanism is 1.43 times faster in decoding, while preserving translation quality on a wide range of machine translation tasks when used in the decoder self- and cross-attention networks.

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

↑