Generating Relevant and Coherent Dialogue Responses using Self-Separated Conditional Variational A uto E ncoders (2021)

Abstract: Conditional Variational AutoEncoder (CVAE) effectively increases the diversity and informativeness of responses in open-ended dialogue generation tasks through enriching the context vector with sampled latent variables. However, due to the inherent one-to-many and many-to-one phenomena in human dialogues, the sampled latent variables may not correctly reflect the contexts’ semantics, leading to irrelevant and incoherent generated responses. To resolve this problem, we propose Self-separated Conditional Variational AutoEncoder (abbreviated as SepaCVAE) that introduces group information to regularize the latent variables, which enhances CVAE by improving the responses’ relevance and coherence while maintaining their diversity and informativeness. SepaCVAE actively divides the input data into groups, and then widens the absolute difference between data pairs from distinct groups, while narrowing the relative distance between data pairs in the same group. Empirical results from automatic evaluation and detailed analysis demonstrate that SepaCVAE can significantly boost responses in well-established open-domain dialogue datasets.

## introduction when conversing with a human user, an opendomain dialogue system is expected to generate human-like responses -responses that not only are diverse and informative, but also contain relevant and cohesive information that correctly addresses the context dialogue. through using sampled latent variables, conditional variational autoencoders (cvae) are powerful tools to ensure diversity and informativeness of the generated responses @xcite @xcite @xcite . yet, it is challenging for a cvae-based dialogue generation model to keep the responses relevant and coherent. the challenge arises as human dialogues inherently exhibit the one-to-many and many-toone phenomena @xcite , meaning that the same context could lead to very different responses, and different contexts could lead to the same response, respectively. as a result, the latent variables sampled by cvae often fail to capture the correct contextual semantics, as shown in fig. 1 , leaving open the possibility that similar contexts producing drastically different latent variables. this has two particular drawbacks: first, the discrepancy between latent variables could lead to irrelevant and incoherent generated responses. different latent variables in a continuous latent space correspond to different responses @xcite . as dissimilar latent variables may be sampled for similar contexts, the generated responses for contexts in the test set could be drastically different from responses to similar contexts in the training set. for instance, given a context "everything about this movie is awesome!", a standard cvae may generate response as dis-similar as"smartphones of the best games!." and "caves would never say yes, but i'd love to know." @xcite . thus this approach sacrifices too much relevance and coherence for diversity and informativeness. second, the disparity between contexts and latent variables hurts model generalizability. model generalizability is often evaluated using a separate dataset taken from a similar distribution as the training set (e.g., a validation or a noisy version of the training set). high generalizability is indicated if the model can transfer favourable abilities from the training set to this second dataset, in the sense that it produces consistent responses between similar contexts across the two datasets. this suggests that the model has acquired certain semantic relations between sentences from the training set. however, if the sampled latent variable departs significantly from the contextual semantics, the model may perform quite differently on the second dataset from the training set. to address these drawbacks, we propose a novel model, namely self-separated conditional variational autoencoder (sepacvae). sepacvae proactively partitions the input data into a number of groups, and then widens the absolute differences between data pairs across different groups while narrowing the relative distance between data pairs within the same group. in this way, sepacvae aims to put the contexts that sample similar latent variables into the same groups, thereby regularizing the latent variables. the design of sepac-vaeinvolves three components that are built on top of standard cvae. first, inspired from image augmentation, we propose a dialogue augmentation method to partition data without any prior knowledge. for this, we construct n orthogonal vectors to classify data into n groups, which retain the original semantic relationships of data within a group. we directly enlarge the semantic distance of the data across different groups. then, we propose a gradient blocking algorithm to select the most suitable group for each data according to gains obtained from different groups. here, the gains are evaluated using reconstruction loss. finally, inspired from the contrastive learning paradigm @xcite @xcite , we propose relationship enhancement to increase similarity between the representations of data within the same group, and differentiate the representations of data between different groups. contributions: our first contribution is a theoretical analysis on why sampled latent variables fail to reflect the contexts' semantics. the next contribution lies in the proposal of sepacvae to overcome issues of irrelevant and incoherent responses caused by standard cvae. our third contribution involves a series of experiments. the results show that our sepacvae can generate more relevant and coherent responses compared to existing methods. ## problem formulation the problem with the standard cvae model lies in that the sampled latent variables may not accurately reflect the contextual semantics due to the apparent one-to-many (one context may correspond to many responses) and many-to-one (many contexts may also correspond to one response) phenomena. this leads to irrelevant and incoherent responses, and harms model generalizability. our aim is to adapt sampled latent variables to capture the contextual semantics, so that the effects of these phenomena are neutralized. this will in turn be helpful to generate relevant and coherent responses. with this goal, we focus on single-turn dialogue datasets where the one-to-many situations appear more frequently than multi-turn dialogue datasets. ## method in this section, we introduce in detail the proposed sepacvae model and its three key components, dialogue augmentation, gradient blocking, and relationship enhancement. as shown in fig. 3 , sepacvae uses g(•) to separate the contexts into different groups. for the one-to-many phenomenon, the contexts in different groups will have different prior distributions p(z|g * (•)), which is easily affected by the different posterior distributions. as for the many-to-one phenomenon, sepacvae makes the contexts (c 1 , c 2 ) generate latent variables related to the response r 1 only when it contains group information g 1 (•). the other group would help the contexts to align with the other latent variables. ## conclusion in this paper, we theoretically prove that latent variables hardly reflect the semantics of contexts due to the one-to-many and many-to-one phenomena of dialogues. for the standard cvae model, these issues lead to irrelevant and incoherent responses during the validation or test stage, and also damaging the generalization performance. to address these problems, we proposed the sepacvae model. there are three main technical novelties of sepacvae: dialogue augmentation, gradient blocking, and relationship enhancement, which enable the latent variables to reflect semantic relationships between contexts. as demonstrated in the experimental results, sepacvae could get the best performance for large-scale dataset.