Retrieval-based chatbots traditionally select responses by matching a query to each candidate in isolation. This paper introduces the Self-attention Comparison Module (SCM), a plug-in component that allows models to compare candidate responses against one another, capturing relational information that significantly boosts performance across multiple benchmarks.
The Problem: Isolated Matching
In open-domain dialog systems, retrieval-based models are favored for their ability to provide fluent, human-like responses from a pre-existing corpus. Current state-of-the-art architectures, such as Bi-encoders and Poly-encoders, typically calculate a matching score between the conversation context and each candidate response independently.
The authors argue that this approach is akin to a judge grading contestants one by one without ever seeing them together. By ignoring the comparison information among candidate responses, these models miss subtle cues that distinguish the best response from several good ones. A model should ideally make better decisions by evaluating the entire "lineup" of candidates simultaneously.
The Self-attention Comparison Module (SCM)
The proposed SCM is a lightweight, plug-in module designed to be integrated into existing Bi-encoder or Poly-encoder architectures. It consists of three primary sub-components:
- Context-aware Representations: The model concatenates the representation of the conversation context with each candidate response, ensuring the comparison is grounded in the current dialogue.
- Candidate Comparison: Utilizing a Transformer encoder with self-attention, the model processes all candidate representations simultaneously. This allows each candidate to "attend" to others, capturing relative strengths and differences.
- Gated Mechanism: To preserve the original semantic meaning of a response, a gated mechanism blends the original representation with the new, comparison-informed representation.
Experimental Setup and Datasets
The researchers evaluated the SCM on three major Chinese open-domain dialog datasets:
- E-Commerce Corpus: Real-world customer service logs from Taobao.
- Douban Corpus: Dyadic dialogs from the Douban social network.
- Zh50w Corpus: A large-scale Chinese open-domain dialog dataset.
To test robustness, they also created extended test sets where the number of candidate responses was increased from the standard 10 up to 300.
Key Results
The SCM provided a consistent and significant boost to performance across all metrics and datasets.
- Accuracy Boost: On the E-Commerce dataset, adding SCM to a Poly-encoder improved the $R_{10}@1$ (Recall at 1 among 10 candidates) from 0.718 to 0.794.
- Consistency: Across all three datasets, SCM-enhanced models achieved an average absolute improvement of over 3% on the primary $R_{10}@1$ metric.
- Scalability: In experiments with up to 300 candidates, SCM-equipped models maintained a clear lead, demonstrating utility in large-scale retrieval tasks where "noise" from semantically similar but incorrect responses is high.
Key Insights
- Relative Information is Key: The relationship between candidates is a powerful signal. Self-attention is ideal for modeling these dependencies.
- Defeating Adversarial "Traps": BERT-based models are often tricked by sentences sharing many words with the context but lacking logical sense. The SCM showed better resistance to these traps by comparing them directly against the ground-truth response.
Limitations and Future Work
Despite its effectiveness, the SCM faces challenges:
- Adversarial Vulnerability: Performance still drops significantly against specifically crafted adversarial examples, suggesting underlying language models struggle with deep logical consistency.
- Computational Overhead: Adding a Transformer layer for comparison increases inference-phase computational costs compared to standard bi-encoders.
- Future Directions: Potential applications include generative models or refining bi-encoder training through improved negative sampling.
Summary updated