Abstract
This paper proposes a new model, called condition-transforming variational autoencoder (CTVAE), to improve the performance of conversation response generation using conditional variational autoencoders (CVAEs). In conventional CVAEs, the prior distribution of latent variable $z$ follows a multivariate Gaussian distribution with mean and variance modulated by the input conditions. Previous work found that this distribution tends to become condition independent in practical application. In our proposed CTVAE model, the latent variable $z$ is sampled by performing a non-linear transformation on the combination of the input conditions and the samples from a condition-independent prior distribution $\mathcal{N}(0, \mathbf{I})$. In our objective evaluations, the CTVAE model outperforms the CVAE model on fluency metrics and surpasses a sequence-to-sequence (Seq2Seq) model on diversity metrics. In subjective preference tests, our proposed CTVAE model performs significantly better than CVAE and Seq2Seq models on generating fluency, informative and topic relevant responses.
Introduction
In open-domain dialogue systems, the challenge lies in mapping a single input (a "post") to a variety of valid, interesting responses. Standard Sequence-to-Sequence (Seq2Seq) models often fail this task by being deterministic, frequently defaulting to safe but dull responses like "I don't know."
To introduce diversity, researchers previously adopted Conditional Variational AutoEncoders (CVAEs). These models use a latent variable $z$ to capture semantic concepts. However, CVAEs often suffer from a "condition independence" problem: the model learns to ignore the input context $x$ when sampling $z$ during generation. This happens because the prior network fails to map sparse natural language inputs to a meaningful distribution, leading to responses that are diverse but often irrelevant to the topic.
Proposed Method: CTVAE
The authors propose the Condition-Transforming Variational AutoEncoder (CTVAE) to force a dependency between the input condition and the latent space. The core innovation lies in how the latent variable $z$ is constructed.
The Transformation Network
Instead of attempting to predict the parameters of a complex, condition-dependent distribution for $z$, CTVAE introduces a "transitional" latent variable $t$. This variable $t$ is sampled from a simple, condition-independent standard Gaussian distribution $\mathcal{N}(0, \mathbf{I})$.
To obtain the final latent representation $z$, the model utilizes a Transformation Network (a multi-layer perceptron). This network takes both the input condition $x$ and the random sample $t$ as inputs. By shifting the role of the condition from defining a distribution's parameters to being a direct input in a non-linear transformation, the model is mathematically compelled to incorporate context into the latent representation.
Architecture and Reranking
The model employs 1-layer LSTM-RNNs for both encoders and decoders. To further refine the output, the researchers implemented a Topic Coherence Discrimination (TCD) model. This secondary component acts as a reranker, evaluating multiple generated samples to select the response with the highest topic relevance to the original post.
Experimental Results
The CTVAE was evaluated using the STC (Short Text Conversation) dataset, which contains approximately 1.8 million post-response pairs from Sina Weibo. The model was compared against Seq2Seq, standard CVAE, and a "CVAE-simple" baseline (where the condition was removed from the prior).
Objective Metrics
- Fluency: CTVAE achieved a perplexity (PPL) of 21.75, a marked improvement over the standard CVAE's 36.96. While Seq2Seq had the lowest PPL (7.61), this is attributed to its tendency to generate short, generic, and "safe" responses.
- Diversity: CTVAE maintained high diversity metrics (Distinct-1/2) while ensuring the responses remained grounded in the input context, unlike standard CVAEs which often generated fluent but nonsensical gibberish.
Human Evaluation
In subjective "ABX" preference tests, CTVAE significantly outperformed its competitors:
- Topic Relevance: CTVAE was preferred over CVAE in 40.8% of cases compared to 29.6% for CVAE.
- Informativeness: Human judges found CTVAE responses to be more interesting and content-rich ($p < 0.01$).
Conclusion
The CTVAE successfully addresses the condition-independence flaw in traditional CVAEs by utilizing a transformation network to fuse context and noise. This results in a chatbot capable of generating responses that are not only diverse but also highly relevant and fluent. Future work will explore extending this framework to multi-turn dialogues and implementing controllable sampling to influence specific response attributes like sentiment or style.
Summary updated