D ial A ug: Mixing up Dialogue Contexts in Contrastive Learning for Robust Conversational Modeling (2022)

Abstract: Retrieval-based conversational systems learn to rank response candidates for a given dialogue context by computing the similarity between their vector representations. However, training on a single textual form of the multi-turn context limits the ability of a model to learn representations that generalize to natural perturbations seen during inference. In this paper we propose a framework that incorporates augmented versions of a dialogue context into the learning objective. We utilize contrastive learning as an auxiliary objective to learn robust dialogue context representations that are invariant to perturbations injected through the augmentation method. We experiment with four benchmark dialogue datasets and demonstrate that our framework combines well with existing augmentation methods and can significantly improve over baseline BERT-based ranking architectures. Furthermore, we propose a novel data augmentation method, ConMix, that adds token level perturbations through stochastic mixing of tokens from other contexts in the batch. We show that our proposed augmentation method outperforms previous data augmentation approaches, and provides dialogue representations that are more robust to common perturbations seen during inference.

## introduction conversational systems have gained immense research attention in the past few years due to their practical applications in building intelligent digital assistants. in order to converse with humans in natural language, a conversational system needs to produce meaningful and contextual responses at every turn of a dialogue. this is often accomplished by a ranking model, the goal of which is to select the most appropriate response among a set of curated candidate responses @xcite @xcite @xcite @xcite . for practical applications a bi-encoder model architecture is often adopted, due to its computational efficiency @xcite @xcite . in this approach, the dialogue context and candidate responses are encoded into latent vectors separately, and the ranking scores are computed based on the similarity between these vectors. learning effective vector representations of dialogue contexts is a challenging task. since most dialogue datasets consist of free-text multi-turn interactions between humans, the exact same contextresponse pair is likely to be seen only once in the whole training set. however, during inference, the same response could be appropriate for various different forms of contexts. for example, in the customer service domain, a response such as "i can issue a refund for the damaged item" could be appropriate for many contexts that fall into the general theme of a customer having received a damaged item. such contexts may differ from one another due to variations in customer language, the particular item details, or the type of damage etc. hence, a response ranking model needs to learn representations that are robust to syntactic and fine-grained semantic variations in the dialogue context. in order to learn representations with improved generalization capabilities, data augmentation has become ubiquitous in computer vision @xcite . recent research @xcite @xcite has also reported success in leveraging augmentations for nlp tasks. an effective method of incorporating data augmentation for better representation learning is through a contrastive learning framework @xcite @xcite @xcite @xcite , where the objective is to maximize similarity between encoded representations of an input and its augmented ver-sion. while contrastive learning with data augmentations has shown promising results in several nlp tasks, to the best of our knowledge the potential of such approaches for conversational modeling has not yet been explored. in this work we propose a multi-objective model architecture, dialaug, for learning robust dialogue response ranking. the proposed architecture leverages the power of text data augmentations in combination with contrastive learning. during training, the model learns to predict the same response for both the original dialogue context and for its augmented version, thus making it agnostic to variations in the context. to capture the notion of coherence and semantic relevance of a dialogue, we introduce an auxiliary contrastive objective that learns the similarity between different views of a dialogue context, in contrast to views of contexts of other dialogues. we further propose a novel data augmentation method for context mixing, namely conmix, that adds token level perturbations to the dialogue context. the aim of introducing the perturbations is to simulate different variations of a multi-turn context. conmix stochastically replaces some of the input tokens in a dialogue context with tokens from another randomly sampled context in the training batch. the benefits of this method are twofold. first, we are creating a perturbed version of the original context that will help learn generalizable representations. second, we are also generating hard negatives for other responses and contexts in the batch, due to the word overlap infused through stochastic mixing from other context in the same training batch. to summarize, in this paper we make the following major contributions: ## related work we review two closely related research areas: data augmentation techniques for text data, and contrastive learning. data augmentation for text : data augmentation has been widely used for computer vision tasks, in order to increase the size of a labeled dataset, and to improve robustness of the model to input noise. typical image augmentations include cropping, flipping, rotating, resizing, applying color distortions, and gaussian blurring @xcite . equivalent simple augmentation techniques have been proposed and explored for text data tasks, e.g., word deletions and permutations, and have been shown to improve the model's robustness and performance @xcite . there has also been some active research into semantic augmentation techniques, such as back-translation, synonym replacement, or generative models @xcite @xcite @xcite . however, these are comparatively complex to implement, and rely on external knowledge (i.e., synonym lists) or additional models, making them only suitable for tasks where appropriate models or knowledge exists. in this work we only consider automatic data augmentation techniques, i.e., techniques that do not require external knowledge or additional models, and can be easily implemented for any language or task. contrastive learning : contrastive learning has been shown to be a powerful representation learning technique for both vision and text data tasks @xcite @xcite @xcite . it essentially aims to learn a better representation of the input by maximizing agreement between two similar data points. these data points can be either augmented versions of the same input in selfsupervised learning @xcite @xcite , or from the same class label in supervised learning @xcite @xcite . contrastive learning has been explored for both pretraining and finetuning tasks in nlp. for example, @xcite @xcite xie, 2020) use contrastive learning to pretrain largescale transformer encoders for sentence representations, while other researchers focus on more taskspecific finetuning settings, such as summarization @xcite ), text classification @xcite , textual similarity @xcite , and user satisfaction prediction @xcite . recent work @xcite has demonstrated success in adopting contrastive finetuning for neural rankers in the qa domain, however, the authors do not leverage data augmentations. our work is more similar to clear @xcite which uses contrastive learning with text data augmentations for pretraining language models. however, we focus on the finetuning stage of dialogue response ranking and leverage augmentations for dialogue contexts in the contrastive learning objective. we use deletion and reordering based augmentations proposed in their work as baselines for conmix. ## approach consider a batch with b inputs {c i , r i } @xmath0,2,••• ,b} , where c i is a dialogue context and r i is the corresponding response. given the dialogue context c i , objective of the model is to predict the most likely response r i among a set of candidate responses ## results and discussion we use recall@1 and mrr as evaluation metrics and report numbers after averaging over 3 runs. ## summary in this work we proposed dialaug, a modular architecture for conversational response ranking. it combines the traditional cross-entropy loss for ranking with a contrastive counterpart to learn from augmented views of the dialogue context. we presented a novel data augmentation method, conmix, which generates multiple views of the same con-text via stochastic mixing of tokens from other contexts in the batch during training. we conducted an extensive set of experiments on four datasets and show that a model trained with conmix outperforms strong baselines and other augmentation methods. our proposed model is also proven to be robust against common perturbations encountered during inference. we hope our work encourages further research in such data-centric methods to improve robustness of nlp models for practical applications of conversational modeling.