Learning an Effective Context-Response Matching Model with Self-Supervised Tasks for Retrieval-based Dialogues

Ruijian Xu, Chongyang Tao, Daxin Jiang, Xueliang Zhao, Dongyan Zhao, Rui Yan

Abstract

Building an intelligent dialogue system with the ability to select a proper response according to a multi-turn context is a great challenging task. Existing studies focus on building a context-response matching model with various neural architectures or PLMs and typically learning with a single response prediction task. These approaches overlook many potential training signals contained in dialogue data, which might be beneficial for context understanding and produce better features for response prediction. Besides, the response retrieved from existing dialogue systems supervised by the conventional way still faces some critical challenges, including incoherence and inconsistency. To address these issues, in this paper, we propose learning a context-response matching model with auxiliary self-supervised tasks designed for the dialogue data based on pre-trained language models. Specifically, we introduce four self-supervised tasks including next session prediction, utterance restoration, incoherence detection and consistency discrimination, and jointly train the PLM-based response selection model with these auxiliary tasks in a multi-task manner. Experiment results on two benchmarks indicate that the proposed auxiliary self-supervised tasks bring significant improvement for multi-turn response selection in retrieval-based dialogues, and our model achieves new state-of-the-art results on both datasets.

Introduction

Retrieval-based dialogue systems aim to select the most appropriate response from a candidate pool given a multi-turn conversation context. While recent advances have utilized Pre-trained Language Models (PLMs) like BERT, they often rely on a single supervision signal: whether a response matches the context. This narrow focus frequently leads to issues such as incoherence (logical disconnects) and inconsistency (contradicting speaker persona). This research introduces BERT-SL, which utilizes self-supervised learning to capture the rich structural and semantic signals inherent in dialogue history.

Methodology

The BERT-SL framework extends the standard BERT architecture by incorporating a multi-task learning objective. The model is trained to minimize a joint loss function that combines the primary response prediction task with four novel auxiliary self-supervised tasks.

Overall architecture of the BERT-SL model, showing the integration of auxiliary tasks and response prediction.

Auxiliary Self-Supervised Tasks

The four auxiliary tasks are designed to force the model to learn different aspects of dialogue structure:

  1. Next Session Prediction (NSP): Determines if two dialogue segments are chronologically adjacent, fostering long-term semantic understanding.
  2. Utterance Restoration (UR): Requires the model to reconstruct an entirely masked utterance based on surrounding turns, a more challenging variant of standard masked language modeling.
  3. Incoherence Detection (ID): Identifies a randomly inserted "intruder" utterance within a dialogue, teaching the model to recognize logical flow.
  4. Consistency Discrimination (CD): Learns to distinguish between utterances from the same speaker/session and random ones, capturing speaker style and persona.
The four auxiliary self-supervised tasks: (a) Next session prediction, (b) Utterance restoration, (c) Incoherence detection, and (d) Consistency discrimination.

Experimental Setup

The model was evaluated on two large-scale benchmarks:

  • Ubuntu Dialogue Corpus (v1.0): 1 million English context-response pairs from technical support logs, known for requiring strong logical reasoning.
  • E-commerce Dialogue Corpus: 1 million Chinese pairs from Taobao customer service, featuring diverse styles and personalities.

Results and Discussion

BERT-SL achieved state-of-the-art results on both datasets. On the Ubuntu Corpus, it reached an 88.4% $R_{10}@1$, a 2.9% absolute improvement over previous best models. On the E-commerce Corpus, it achieved 77.6% $R_{10}@1$, a 4.8% absolute improvement.

Key insights include:

  • Domain-Specific Task Importance: Incoherence Detection was found to be the most critical task for the logic-heavy Ubuntu dataset, while Consistency Discrimination was more impactful for the personality-driven E-commerce dataset.
  • Model Agnostic Benefits: The self-supervised schema also significantly boosted the performance of simpler models like ESIM, suggesting the tasks provide universal dialogue understanding signals that transcend specific architectures.
  • Robustness: The model maintained high performance even with long dialogue contexts (18+ turns), effectively filtering noise through its learned structural understanding.

Conclusion

By leveraging self-supervised auxiliary tasks, BERT-SL effectively captures the nuances of human conversation that standard matching models miss. While the training phase is more complex due to the dynamic generation of these tasks, the inference time remains unchanged. Future work will address hyperparameter sensitivity regarding task weighting and explore the application of these tasks to open-domain "chit-chat" systems.

Summary updated

BibTeX
@inproceedings{xu2021learning,
  author = {Ruijian Xu and Chongyang Tao and Daxin Jiang and Xueliang Zhao and Dongyan Zhao and Rui Yan},
  title = {{Learning an Effective Context-Response Matching Model with Self-Supervised Tasks for Retrieval-based Dialogues}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i16.17666},
}
Figure