Topic-relevant Response Generation using Optimal Transport for an Open-domain Dialog System (2020)

Abstract: Conventional neural generative models tend to generate safe and generic responses which have little connection with previous utterances semantically and would disengage users in a dialog system. To generate relevant responses, we propose a method that employs two types of constraints - topical constraint and semantic constraint. Under the hypothesis that a response and its context have higher relevance when they share the same topics, the topical constraint encourages the topics of a response to match its context by conditioning response decoding on topic words’ embeddings. The semantic constraint, which encourages a response to be semantically related to its context by regularizing the decoding objective function with semantic distance, is proposed. Optimal transport is applied to compute a weighted semantic distance between the representation of a response and the context. Generated responses are evaluated by automatic metrics, as well as human judgment, showing that the proposed method can generate more topic-relevant and content-rich responses than conventional models.

## introduction in the past decade, personal assistants based on a speech dialog system have shown significant potential and become a trend, which have aroused great interest in dialog systems. recently, because of the access to large public conversation datasets, neural response generation has been investigated for an open-domain dialog system. neural response generation is to learn a response generation model under sequence-to-sequence (seq2seq) @xcite framework. such a model is trained to optimize the conditional likelihood p (y |x) of generating a response y given its context x. this objective function is especially suitable for tasks like machine translation, of which the source and its target translation are semantically corresponding. however, for open-domain dialog response generation, a response can be weakly relevant to its previous utterances. there usually does not exist an obvious alignment between previous utterances and the response. thus, neural generative models tend to generate safe and generic response, which contains little meaningful information, such as "really?", and "i don't know.". these generic responses are usually short and vague, and can seldom provide effective information as feedback to the other partner in the dialog. this has been identified as one of major challenges in neural response generation @xcite . to ameliorate the problem of generic responses, we design a model that can generate responses that are relevant to previous utterances. two constraints are introduced, 1) topical constraint and 2) semantic constraint, to modify the objective function p (y |x). responses which are highly related to their context usually have the same topic as the context does. thus, the topical constraint conditions the model's decoding process on topic words in the context, which are identified by a topic word sequence labeler. moreover, a relevant response should be semantically related to its context. the semantic constraint regularizes the model's predicted response by minimizing the semantic distance between the generated response and its context. optimal transport @xcite is a method for finding a joint distribution of two distributions which minimizes the wasserstein distance when converting one distribution this work is licensed under a creative commons attribution 4.0 international licence. licence details: http:// creativecommons.org/licenses/by/4.0/ . to another. it is applied to the computation of semantic distance in the proposed method. we use both automated evaluation and human evaluation to verify the effect of our proposed method. the hred model is used as the baseline model in this work. ## topical and semantic constraints to generate responses that are more relevant to the context, topical constraint and semantic constraint into the hred are explored. if a response and its context have the same topic, then the response is likely to be relevant to the context. topic words are keywords which have more impact on following conversation, and they can dynamically define the topic of a conversation. to push the topic of a response more relevant to its context, we train a sequence labeler to recognize topic words {t 1 , ..., t n } from a context and condition the decoding process on both the context and topic words. then the objective function is modified as eq ( 2) : here @xmath0, ..., t n } indicates the topic words extracted from the context. to further strengthen the semantic relevance between a generated response and its context, we try to close the representation of these two in the semantic space @xcite . we compute the semantic distance between a response and its context at the sequence level, and regularize the objective function with the distance as in @xcite . here ∆ is the function computing the semantic distance between the response and the context; emb() indicates the word embedding of a sequence of tokens. theoretically, by adding the topical and semantic constraints into the hred, we can have more control on selecting generated content. ## incorporating topical constraint to encourage topics of a response to be relevant to the topic of its context, we first pre-train a sequence labeler to extract topic words from the context, then jointly train it with the hred. we use topic words to refer to a topic. here topic words are defined as words that 1) contain meaningful information and 2) are shared by the context and the response. in the example in ## incorporating semantic constraint another approach to generate more relevant responses is to consider the semantic distance between a generated response and its context. in some past works, the semantic distance was calculated by the similarity of the sequence-level semantic representations. however, it is possible to lose details in the process. we propose a novel method to calculate the semantic distance from a word-level representation. many word alignments between a response and the context may not be meaningful, such as an alignment of two irrelevant stop words. it is reasonable that we should value the alignments with strong semantic connection. thus, a semantic distance considering the weights of different alignments is needed. ## related work our proposed work is related to some past works. to generate more content-rich responses, a seq2seq model with an additional topic and semantic constraint that are based on a topic model @xcite and cosine similarity @xcite has been proposed, showing promising results in the content richness of generated responses @xcite model @xcite . to improve the model structure, mou el al. proposed a model that generates responses backward and forward starting from a keyword, which is a noun with the highest pointwise mutual information (pmi) score as a hard constraint, outperforming traditional sequence-to-sequence model @xcite . zhang et al. built their system for "relevant, contentful and context-consistent responses"( zhang et al., 2019 ); adiwardana et al. built a multi-turn open-domain chatbot and proposed a metric called sensibleness and specificity average (ssa) for human evaluation (adiwardana et al., 2020); smith et al. wanted their chatbot to be engaging, knowledgeable, and empathetic and proposed a new dataset called blendedskilltalk for analysis (smith et al., 2020); roller et al. evaluated their multi-turn dialogue model for engagingness and humanness (roller et al., 2020). ## conclusion a topic-relevant response should have a common or similar topic with its context, and it should be semantically related to the context. to generate topic-relevant responses and avoid generic responses like "i don't know", two constraints placed onto the decoding process are proposed. the first constraint is a topical constraint. to extract topic information from the context, a sequence labeler is trained on two differently constructed dataset with topic word annotations. the topic word information predicted by the sequence labeler is then integrated into the context vector generated by the hierarchical encoder to guide the decoding process. the second constraint is a semantic constraint. a model is designed to generate responses semantically related to context by adding the semantic distance is added into the global loss of the model. in this work, semantic distance is calculated by optimal transport, which gives the optimal alignments between context and its response in a semantic space. the calculated semantic distance is used as a regularization for the objective function, giving sequence-level guidance on the decoding process. the experimental evaluations demonstrated that combining these constraints lead to responses that are content-rich and with higher relevance to the context while maintaining good performance in the grammar for long sentences. this work has some distinct features in 1) using topic words to dynamically refer to topics; 2) providing with semantic sequence-level guidance, but with access to word-level similarity values.