[论文解读] DiSAN: Directional Self-Attention Network for RNN/CNN-Free Language Understanding
DiSAN 引入定向和多维自注意力来在不使用 RNN/CNN 的情况下对句子进行编码,在 SNLI、SST、MultiNLI、SICK 及其他基准上实现最先进的结果,同时提高效率。
Recurrent neural nets (RNN) and convolutional neural nets (CNN) are widely used on NLP tasks to capture the long-term and local dependencies, respectively. Attention mechanisms have recently attracted enormous interest due to their highly parallelizable computation, significantly less training time, and flexibility in modeling dependencies. We propose a novel attention mechanism in which the attention between elements from input sequence(s) is directional and multi-dimensional (i.e., feature-wise). A light-weight neural net, "Directional Self-Attention Network (DiSAN)", is then proposed to learn sentence embedding, based solely on the proposed attention without any RNN/CNN structure. DiSAN is only composed of a directional self-attention with temporal order encoded, followed by a multi-dimensional attention that compresses the sequence into a vector representation. Despite its simple form, DiSAN outperforms complicated RNN models on both prediction quality and time efficiency. It achieves the best test accuracy among all sentence encoding methods and improves the most recent best result by 1.02% on the Stanford Natural Language Inference (SNLI) dataset, and shows state-of-the-art test accuracy on the Stanford Sentiment Treebank (SST), Multi-Genre natural language inference (MultiNLI), Sentences Involving Compositional Knowledge (SICK), Customer Review, MPQA, TREC question-type classification and Subjectivity (SUBJ) datasets.
研究动机与目标
- 为多样的自然语言处理任务(超出 seq2seq 应用)提出一个统一的、无 RNN/CNN 的注意力模型以示范其潜力。
- 提出定向和多维自注意力以保留时间顺序与特征级别依赖。
- 构建一个轻量级的 DiSAN,通过前向/后向定向自注意力及多维 source2token 注意力来产生一个单一向量的句子编码。
- 证明 DiSAN 在 SNLI、SST、MultiNLI、SICK 等数据集上具有更高的准确性与效率。
提出的方法
- 引入多维注意力,使其为每个标记计算特征维度的分数,而非单一标量分数。
- 将多维注意力扩展为 token2token 和 source2token 变体以实现自注意力。
- 开发带掩码的 token2token 自注意力的定向自注意力(DiSA)并使用融合门来结合输入与上下文。
- 通过应用前向和后向 DiSA 块、拼接它们的输出,并使用多维 source2token 注意力来生成最终的句子向量来构建 DiSAN 架构。
- 使用掩码(对角线禁用、前向、后向)来编码注意力中的时间顺序与方向信息。
- 用交叉熵损失加上 L2 正则化、Adadelta 优化器、Glorot 初始化、300D GloVe 嵌入、 dropout 以及特定任务的分类器进行训练。
实验结果
研究问题
- RQ1一个仅依赖注意力、无递归或卷积的模型是否可以在标准 NLP 基准上达到有竞争力甚至更优的表现?
- RQ2定向(有序)和多维(特征级)注意力是否比传统注意力机制在句子编码上带来改进?
- RQ3在准确性和效率方面,轻量级 DiSAN 相对于基于 RNN/CNN 的编码器在诸如 NLI、情感分析和分类等任务上表现如何?
- RQ4前向与后向方向掩码及其组合对上下文表示有何影响?
- RQ5DiSAN 是否能够在跨越多种 NLP 任务的泛化能力方面超越仅用于自然语言推理的应用?
主要发现
- 在 SNLI 的句子编码模型中,DiSAN 取得最高测试准确度,并将最佳结果提高了 1.02%。
- DiSAN 在 SST、MultiNLI、SICK、Customer Review、MPQA、SUBJ 和 TREC 等数据集上显示出最先进的性能。
- DiSAN 使用的参数更少(2.35M),比许多基于 RNN/CNN 的基线显著更快(例如在 SNLI 上比 Bi-LSTM 快 3 倍)。
- 多维与定向注意力组件相较基线带来显著提升,其中定向掩码编码时间顺序可提升性能。
- 基于 DiSA 的一个块加上多维 source2token 注意力可以在多项任务上超越 Bi-LSTM 编码器,甚至优于具有树状结构架构的模型。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。