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

Retrieval-based dialogue systems typically rely on a single binary task for fine-tuning, which fails to capture the rich structural and semantic nuances of multi-turn conversations. This paper introduces BERT-SL, a multi-task learning framework that incorporates four self-supervised auxiliary tasks: Next Session Prediction, Utterance Restoration, Incoherence Detection, and Consistency Discrimination. Experimental results on the Ubuntu and E-commerce datasets demonstrate that BERT-SL achieves new state-of-the-art performance, highlighting the value of internal dialogue structure as a training signal.

Introduction

In retrieval-based dialogue systems, the objective is to select the most appropriate response from a candidate pool based on a multi-turn conversation history (the context). While Pre-trained Language Models (PLMs) like BERT have become the standard for this, they are typically fine-tuned using a simple binary classification task: "Is this response the correct one for this context?"

This approach often ignores the rich structural information inherent in dialogue data. Consequently, models struggle with incoherence (responses that do not follow the logical flow) and inconsistency (responses that contradict a speaker’s established persona). The challenge lies in extracting hidden training signals within the dialogue history to help the model understand the nuances of human conversation.

The BERT-SL Framework

The proposed BERT-SL (Self-supervised Learning) model uses a multi-task learning framework. While the model learns its primary job of response selection, it simultaneously trains on four auxiliary self-supervised tasks designed specifically for dialogue. This allows the model to learn deeper representations of what constitutes a "good" conversation.

The architecture of the BERT-SL model, showing the integration of context and response inputs with auxiliary task heads.

Self-Supervised Auxiliary Tasks

To extract more training signals from dialogue data, the authors designed four tasks that force the model to solve "puzzles" within the conversation history:

  1. Next Session Prediction (NSP): The model determines if two dialogue segments are consecutive or if one was sampled from a different conversation, aiding long-term context flow understanding.
  2. Utterance Restoration (UR): An entire utterance is masked, and the model must restore it based on surrounding turns, capturing high-level semantic connections.
  3. Incoherence Detection (ID): One utterance is replaced with a random sentence; the model must identify the "intruder," forcing attention to discourse coherence.
  4. Consistency Discrimination (CD): The model determines if two utterances likely came from the same speaker based on style, topic, or personality.
Illustration of the Utterance Restoration (b) and Consistency Discrimination (d) auxiliary tasks.

Experimental Results

The model was evaluated on two major benchmarks: the Ubuntu Dialogue Corpus (v1.0) and the E-commerce Dialogue Corpus. BERT-SL achieved new state-of-the-art (SOTA) performance across both:

  • Ubuntu Corpus: Achieved an 88.4% R10@1, a 2.9% absolute improvement over previous best models.
  • E-commerce Corpus: Achieved a 77.6% R10@1, representing a 4.8% absolute improvement.

Key insights revealed that task importance varies by domain. Incoherence Detection (ID) was most helpful for the technical Ubuntu dataset, where logic is paramount, while Consistency Discrimination (CD) was more impactful for the E-commerce dataset, where speaker persona is more distinct.

Conclusion

By treating dialogue history as a structured source of information rather than a flat sequence, BERT-SL significantly improves response retrieval. The success of these self-supervised tasks suggests that dialogue data contains far more training signals than previously utilized. Future work may involve applying similar coherence tasks to generative models to reduce nonsensical AI responses.

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