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

利用查询-值交互改进注意力机制

Improving Attention Mechanism with Query-Value Interaction

Tsinghua University(清华大学);Microsoft Research Asia(微软亚洲研究院)

Chuhan Wu, Fangzhao Wu, Tao Qi, Yongfeng Huang

摘要:

注意力机制在各种最先进的自然语言处理模型中扮演着重要的角色,如Transformer和BERT。它可以被公式化为三元函数,该三元函数通过使用由从查询和键之间的交互导出的注意力权重加权的值的总和来将输入查询、键和值映射到输出。与查询-键交互类似,查询和值之间也存在固有的相关性,并且结合查询-值交互具有通过根据查询的特征学习定制值来增强输出的潜力。然而,查询值的相互作用被忽略现有的注意力方法,这可能不是最佳的。在本文中,我们提出了改进现有的注意力机制,将查询值的相互作用。我们提出了一个查询值交互函数,它可以学习查询感知的注意力值,并将它们与原始值和注意力权重相结合,形成最终的输出。在四个不同任务的数据集上进行的大量实验表明,我们的方法可以通过引入查询值交互来不断提高许多基于注意力的模型的性能。

英文摘要:

Attention mechanism has played critical roles in various state-of-the-art NLP models such as Transformer and BERT. It can be formulated as a ternary function that maps the input queries, keys and values into an output by using a summation of values weighted by the attention weights derived from the interactions between queries and keys. Similar with query-key interactions, there is also inherent relatedness between queries and values, and incorporating query-value interactions has the potential to enhance the output by learning customized values according to the characteristics of queries. However, the query-value interactions are ignored by existing attention methods, which may be not optimal. In this paper, we propose to improve the existing attention mechanism by incorporating query-value interactions. We propose a query-value interaction function which can learn query-aware attention values, and combine them with the original values and attention weights to form the final output. Extensive experiments on four datasets for different tasks show that our approach can consistently improve the performance of many attention-based models by incorporating query-value interactions.

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

↑