[论文解读] ReCoSa: Detecting the Relevant Contexts with Self-Attention for Multi-turn Dialogue Generation
ReCoSa 提出了一种基于自注意力机制的模型,用于在多轮对话生成中检测相关上下文,解决了层次化 RNN 模型对所有上下文一视同仁的局限性。通过应用自注意力机制更新上下文和响应表示,并计算上下文-响应注意力权重,ReCoSa 显著提升了响应的相关性和多样性,在中文和英文数据集上的自动评估与人工评估中均优于 HRED 及注意力增强基线模型。
In multi-turn dialogue generation, response is usually related with only a few contexts. Therefore, an ideal model should be able to detect these relevant contexts and produce a suitable response accordingly. However, the widely used hierarchical recurrent encoderdecoder models just treat all the contexts indiscriminately, which may hurt the following response generation process. Some researchers try to use the cosine similarity or the traditional attention mechanism to find the relevant contexts, but they suffer from either insufficient relevance assumption or position bias problem. In this paper, we propose a new model, named ReCoSa, to tackle this problem. Firstly, a word level LSTM encoder is conducted to obtain the initial representation of each context. Then, the self-attention mechanism is utilized to update both the context and masked response representation. Finally, the attention weights between each context and response representations are computed and used in the further decoding process. Experimental results on both Chinese customer services dataset and English Ubuntu dialogue dataset show that ReCoSa significantly outperforms baseline models, in terms of both metric-based and human evaluations. Further analysis on attention shows that the detected relevant contexts by ReCoSa are highly coherent with human's understanding, validating the correctness and interpretability of ReCoSa.
研究动机与目标
- 为解决多轮对话生成中模型对所有上下文同等对待的问题,避免引入噪声并提升响应质量。
- 克服余弦相似度和传统注意力机制的局限性,后者存在相关性假设不足或位置偏差的问题。
- 通过准确检测并聚焦于最相关上下文,提升响应生成质量。
- 验证自注意力机制在建模对话历史长距离依赖关系方面优于基于 RNN 的方法。
提出的方法
- 使用词级别 LSTM 编码器为对话历史中的每个上下文生成初始表示。
- 对上下文序列和掩码响应分别独立应用自注意力机制,以优化其表示。
- 基于更新后的表示计算上下文-响应注意力权重,以确定相关性得分。
- 解码器利用加权的上下文表示生成最终响应,仅关注相关输入。
- 采用多头自注意力机制,以捕捉不同注意力头之间的多样化长距离依赖关系。
- 通过最大化真实响应的似然性,实现端到端训练。
实验结果
研究问题
- RQ1自注意力机制是否能在不依赖邻近性或相似性启发式方法的前提下,有效检测多轮对话中的相关上下文?
- RQ2ReCoSa 在响应生成质量与相关性方面是否优于 HRED 及其变体?
- RQ3注意力权重与人工标注的相关性判断之间的相关性如何?
- RQ4ReCoSa 是否能够处理相关上下文并非最近一轮的情况,从而避免位置偏差?
主要发现
- 在中文客服对话和英文 Ubuntu 对话数据集上,ReCoSa 在自动评估指标上显著优于基线 HRED 及 HRED-with-attention 模型。
- 人工评估结果表明,ReCoSa 生成的响应在多样性和上下文相关性方面优于基线模型。
- 注意力热力图显示,ReCoSa 正确识别了相关上下文,例如示例1中的 context1 和 context3,以及示例2中的 context2,与人工判断一致。
- ReCoSa 有效捕捉了长距离依赖关系,即使相关上下文与响应不相邻,而基于 RNN 的注意力模型则难以实现这一点。
- 模型的多头注意力机制表明,不同头在不同类型的上下文-响应关系上具有专长,从而增强了可解释性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。