arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2211.02899cs.CLcs.AI
收藏

Tri-Attention:自然语言处理中的显式上下文感知注意力机制

Tri-Attention: Explicit Context-Aware Attention Mechanism for Natural Language Processing

Qilu University of Technology (Shandong Academy of Sciences)(齐鲁工业大学(山东省科学院));Brock University(布鲁克大学);University of Technology Sydney(悉尼科技大学)

Rui Yu, Yifeng Li, Wenpeng Lu, Longbing Cao

摘要:

在自然语言处理中,单词或句子的上下文起着至关重要的作用。上下文信息,如段落或历史对话的语义表示,构成了对话的重要组成部分,也是对当前短语或句子的准确理解。然而,标准的注意力机制通常使用查询和键生成权重,但忽略上下文,形成双注意力框架,尽管它们在建模序列比对方面取得了巨大的成功。这种双注意力机制没有明确地对目标序列的上下文、查询和键之间的交互进行建模,丢失了重要的上下文信息,导致注意力表现不佳。因此,一个新的和一般的三重注意力(三注意力)框架扩展了标准的双注意力机制,并显式地交互查询,关键字,上下文作为第三个维度在计算相关性分数。通过将Bi-Attention中基于二维向量的加法、点积、缩放点积和双线性运算扩展为Tri-Attention的张量运算,生成了Tri-Attention的四种变体。对三个NLP任务的广泛实验表明,Tri-Attention优于大约30种最先进的非注意力,标准的Bi-Attention,上下文Bi-Attention方法和预训练的神经语言模型。

英文摘要:

In natural language processing (NLP), the context of a word or sentence plays an essential role. Contextual information such as the semantic representation of a passage or historical dialogue forms an essential part of a conversation and a precise understanding of the present phrase or sentence. However, the standard attention mechanisms typically generate weights using query and key but ignore context, forming a Bi-Attention framework, despite their great success in modeling sequence alignment. This Bi-Attention mechanism does not explicitly model the interactions between the contexts, queries and keys of target sequences, missing important contextual information and resulting in poor attention performance. Accordingly, a novel and general triple-attention (Tri-Attention) framework expands the standard Bi-Attention mechanism and explicitly interacts query, key, and context by incorporating context as the third dimension in calculating relevance scores. Four variants of Tri-Attention are generated by expanding the two-dimensional vector-based additive, dot-product, scaled dot-product, and bilinear operations in Bi-Attention to the tensor operations for Tri-Attention. Extensive experiments on three NLP tasks demonstrate that Tri-Attention outperforms about 30 state-of-the-art non-attention, standard Bi-Attention, contextual Bi-Attention approaches and pretrained neural language models1.

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

↑