强化自注意网络:一种软硬注意混合的序列建模方法
Reinforced Self-Attention Network: a Hybrid of Hard and Soft Attention for Sequence Modeling
摘要:
许多自然语言处理任务仅仅依赖于句子中的几个标记之间的稀疏依赖关系。软注意力机制在通过两个标记之间的软概率来建模局部/全局依赖关系方面表现出很好的性能,但在应用于长句时效果不佳。相比之下,硬注意力机制直接选择标记的子集,但是由于它们的组合性质,训练是困难和低效的。在本文中,我们将软注意和硬注意整合到一个上下文融合模型中,即“强化自我注意(ReSA)”,以实现彼此的互利。在ReSA中,硬注意力为软自我注意力处理修剪序列,而软注意力反馈奖励信号以促进硬注意力的训练。为此,我们开发了一种新的硬注意力称为“增强序列采样(RSS)",选择令牌并行和训练通过策略梯度。使用两个RSS模块,ReSA有效地提取了每对选定标记之间的稀疏依赖关系。最后,我们提出了一个无RNN/CNN的重复编码模型,“强化自我注意力网络(ReSAN)”,完全基于ReSA。它在斯坦福自然语言推理(SNLI)和涉及成分知识的句子(SICK)数据集上都实现了最先进的性能。
英文摘要:
Many natural language processing tasks solely rely on sparse dependencies between a few tokens in a sentence. Soft attention mechanisms show promising performance in modeling local/global dependencies by soft probabilities between every two tokens, but they are not effective and efficient when applied to long sentences. By contrast, hard attention mechanisms directly select a subset of tokens but are difficult and inefficient to train due to their combinatorial nature. In this paper, we integrate both soft and hard attention into one context fusion model, "reinforced self-attention (ReSA)", for the mutual benefit of each other. In ReSA, a hard attention trims a sequence for a soft self-attention to process, while the soft attention feeds reward signals back to facilitate the training of the hard one. For this purpose, we develop a novel hard attention called "reinforced sequence sampling (RSS)", selecting tokens in parallel and trained via policy gradient. Using two RSS modules, ReSA efficiently extracts the sparse dependencies between each pair of selected tokens. We finally propose an RNN/CNN-free sentence-encoding model, "reinforced self-attention network (ReSAN)", solely based on ReSA. It achieves state-of-the-art performance on both Stanford Natural Language Inference (SNLI) and Sentences Involving Compositional Knowledge (SICK) datasets.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。