Dialogue Response Generation via Contrastive Latent Representation Learning (2021)

Abstract: Large-scale auto-regressive models have achieved great success in dialogue response generation, with the help of Transformer layers. However, these models do not learn a representative latent space of the sentence distribution, making it hard to control the generation. Recent works have tried on learning sentence representations using Transformer-based framework, but do not model the context-response relationship embedded in the dialogue datasets. In this work, we aim to construct a robust sentence representation learning model, that is specifically designed for dialogue response generation, with Transformer-based encoder-decoder structure. An utterance-level contrastive learning is proposed, encoding predictive information in each context representation for its corresponding response. Extensive experiments are conducted to verify the robustness of the proposed representation learning mechanism. By using both reference-based and reference-free evaluation metrics, we provide detailed analysis on the generated sentences, demonstrating the effectiveness of our proposed model.

## introduction large-scale pretrained language models with transformer-based architecture @xcite @xcite have achieved state-of-the-art performance across a variety of natural language processing (nlp) tasks, including open-domain dialogue response generation. the majority of these models are auto-regressive (ar) language models, creating a matching mechanism between the input context and the generated response. however, such an approach often ignores the semantic meaning shared among sentences from an abstract level @xcite , generating responses that have matching components with the context, but are not logically sound. figure 1 demonstrates this potential problem by using some generated samples, where the response generation model generates similar patterns to the context but fail to predict semantically reasonable responses to continue the conversation. in comparison, variational autoencoders (vaes) @xcite @xcite are able to explicitly model sentences in a representation space, providing control on the generated responses. while most vae-based language models adopt shallow network such as lstms, it is straightforward to construct such a latent representation learning with a transformer framework. recent works @xcite aim to build a pretrained language model that uses a sentence-level vae objective with a bert @xcite encoder and a gpt-2 @xcite decoder. nevertheless, being designed for multiple language understanding and generation tasks, they do not utilize the enriched context-response relationship in the dialogue response generation task. (maybe change to something like this: nevertheless, these models are unable to utilize the enriched context-response relationship in the dialogue. this limits the model ability to capture predictive relationship between context and response latent representations and hence constrains the response generation quality. ) in this work, we aim to design a dialogue response understanding and generation framework, that combines a higher-level sentence representation learning with a transformer-based encoderdecoder architecture, yielding controllable response generation from an abstract level, while achieving top-tier generation quality. we adopt the approach that uses a bert encoder and a gpt-2 decoder as the model backbone, and enrich the underlying information in the learned representation by performing utterance-level contrastive learning. specifically, the latent representation of the context input (one or multiple utterances) is used to predict that of the response input (a single utterance). note that our proposed contrastive loss is built based upon utterances, while the entire context input is encoded by a single context encoder. to benefit the contrastive learning of the latent representation, we propose to use the hard negative sampling mechanism. such an approach has been used in the computer vision domain @xcite , guiding a learning method to correct its mistakes more quickly. in our case, we select the negative samples by using a pretrained context-response matching model @xcite . given a context input, the responses with the top matching scores would be considered as the negative samples, and used for the contrastive objective. in terms of model architecture, we select conditional variational autoencoder (cvae) @xcite . this provides an encoder-decoder structure, in which the bert-gpt backbone can be applied. ## method we include detailed model design in the following section. by introducing the utterance-level contrastive learning, our proposed model learns sentence representations that are capable of predicting future utterances. cvae is considered as our main model architecture, where we use a bert encoder and a gpt-2 decoder. ## related work transformer-based representation learning for text generation. transformer layers have been applied in various language models and achnce engaged in such a framework, it aims to generate novel ieved great results @xcite @xcite . many are pretrained models and can be fine-tuned to adapt to various downstream tasks @xcite @xcite . recent works try to learn an interpretable representation space for the sentence encoding, using transformer-based encoders and decoders. optimus @xcite provides a pretrained language model with a bert encoder and a gpt-2 decoder. with variational inferesentences by learning a universal latent space through the pretraining. plato @xcite also adopts bert framework. it is specifically designed for dialogue generation, while learning a discrete latent variable for action recognition, upon which the generation is based. contrastive learning in nlp. contrastive learning has been widely used with applications on various computer vision @xcite and nlp problems @xcite . it aims to learn a latent representation by contrasting positive and negative pairs in different setups. in the nlp domain, contrastive learning is applied in word2vec @xcite , a word embedding model, in which neighbouring words are predicted from context. other than that, it is also used for sentence representation, where the positive and negative pairs are sampled as two contiguous sentences and sentences from other document, respectively @xcite . claps @xcite ## conclusion in this work, we propose a dialogue response generation model that combines the controllability of representation learning models and sota performance of ar-based frameworks. an efficient utterance level contrastive learning is introduced to enrich the information learned in the latent representations (i.e., predictive information of utterance in the next time step). our proposed model achieves competitive performance comparing to the sota models in different benchmark datasets.