Multi-Turn Response Selection for Chatbots with Deep Attention Matching Network

Xiangyang Zhou, Lu Li, Daxiang Dong, Yi Liu, Ying Chen, Wayne Xin Zhao, Dianhai Yu, Hua Wu

TL;DR

The Deep Attention Matching (DAM) network moves away from traditional Recurrent Neural Networks (RNNs) to solve multi-turn response selection for chatbots. By using stacked self-attention and cross-attention—inspired by the Transformer architecture—DAM captures complex semantic dependencies across multiple conversation turns, setting a new state-of-the-art on major benchmarks while being significantly faster to train and deploy.

The Challenge of Multi-Turn Context

In retrieval-based chatbots, the goal is to select the best response from a pool of candidates given a conversation's history (the "context"). Early models often focused on the final message, but human conversation is rarely that simple. Meaning is frequently buried in "multi-turn" dependencies: a pronoun like "it" in the current turn might refer to a technical term mentioned several turns ago.

Existing models typically relied on RNNs to encode these sequences. However, RNNs are computationally expensive and often struggle to capture "multi-grained" representations—the idea that matching happens at the level of words, phrases, and entire sentences simultaneously. The authors aim to build a model that captures these multi-level dependencies more effectively and efficiently.

Methodology: The DAM Architecture

The authors introduce the Deep Attention Matching (DAM) network. Its architecture is built entirely on attention mechanisms, extending the "Transformer" approach in two key ways:

  1. Stacked Self-Attention: Instead of using an RNN to "read" a sentence, DAM uses multiple layers of self-attention. Each layer builds a more sophisticated representation: the bottom layers might capture word-level meaning, while higher layers capture phrase-level or sentence-level semantics.
  2. Cross-Attention: To find the "link" between the context and a potential response, the model makes them "attend" to each other. This helps the model realize that a phrase like "its just reassurance" in a response might be latently related to a question about "what packages are installed" asked earlier in the context.
The DAM architecture consists of representation, matching, and aggregation modules.

The Pipeline

  • Representation: Utterances and responses are passed through $L$ layers of an "Attentive Module" to create multi-grained representations.
  • Matching: The model creates two types of matching matrices for every layer: one based on self-attention (textual relevance) and one on cross-attention (dependency relevance).
  • Aggregation: These matrices are stacked into a 3D Matching Image. The model then uses 3D convolutions and max-pooling—similar to computer vision techniques—to distill the most important matching features into a final score.

Datasets and Evaluation

The model was evaluated on two large-scale multi-turn response selection benchmarks:

  • Ubuntu Corpus V1: A collection of English-language logs from Ubuntu Technical Support Online. It is highly technical and contains 0.5 million training contexts.
  • Douban Conversation Corpus: Crawled from a popular Chinese social networking site. Unlike the Ubuntu corpus, this is open-domain and more "chatty," testing how well the model handles diverse, non-technical human language.

Key Results

DAM significantly outperformed previous state-of-the-art models, such as the Sequential Matching Network (SMN), across both technical and open-domain datasets.

Comparison of DAM against baseline models on the Ubuntu and Douban corpora.
  • Ubuntu Corpus: DAM achieved an $R_{10}@1$ of 0.767, a 4.1% absolute improvement over the best baseline (0.726).
  • Douban Corpus: DAM improved the Mean Average Precision (MAP) to 0.550 (up from 0.529).
  • Efficiency: Because it avoids the sequential nature of RNNs, the "light" version of the model ($DAM_{first}$) is roughly 2.3 times faster than the previous leading RNN-based model during inference.

Key Insights and Ideas

  • Attention is All You Need (for Chatbots too): This paper demonstrates that the Transformer's success in machine translation translates directly to dialogue selection. By removing RNNs, the model becomes highly parallelizable and faster.
  • Multi-Grained Matching: Matching isn't just about keyword overlap. By stacking attention layers, the model can match a response to the context at different levels of abstraction (e.g., matching the intent of a sentence even if the words are different).
  • The Power of Cross-Attention: The authors found that cross-attention captures "latent dependencies" that self-attention misses. It acts as a bridge, helping the model resolve coreferences (like "it" or "that") across different turns of the conversation.

Limitations and Future Work

An error analysis of 100 "bad cases" identified two main hurdles:

  • Fuzzy Candidates: Sometimes multiple response candidates are technically "correct" or very similar, and the model struggles to pick the absolute best one based on subtle details.
  • Logical Errors: The model still lacks true "common sense" or logic. For example, if Speaker A says "I want to stay home," and a candidate response says "Sure, I was planning to go out tomorrow," the model might miss the logical contradiction.

The authors suggest that future work should involve adversarial training (generating tricky negative examples) to help the model better understand these logical nuances.

Summary updated

BibTeX
@inproceedings{zhou2018multi,
  author = {Xiangyang Zhou and Lu Li and Daxiang Dong and Yi Liu and Ying Chen and Wayne Xin Zhao and Dianhai Yu and Hua Wu},
  title = {{Multi-Turn Response Selection for Chatbots with Deep Attention Matching Network}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2018},
  doi = {10.18653/v1/p18-1103},
}
Figure