Condition-transforming Variational Autoencoder for Conversation Response Generation

Yu-Ping Ruan, Zhen-Hua Ling, Quan Liu, Zhigang Chen, Nitin Indurkhya

TL;DR

Researchers have developed the Condition-Transforming Variational AutoEncoder (CTVAE) to fix a common flaw in AI chatbots: the tendency to give boring, generic responses. By fundamentally changing how the model incorporates context into its "creative" latent space, CTVAE generates responses that are significantly more fluent, informative, and topic-relevant than standard Variational AutoEncoders (CVAEs).

What Problem Does This Paper Address?

In the world of "chit-chat" dialogue systems, the goal is to map one input (a "post") to many possible valid outputs (responses). Standard Sequence-to-Sequence (Seq2Seq) models struggle here because they are deterministic; they often default to safe, high-probability "dull" responses like "I don't know" or "That's okay."

To solve this, researchers previously turned to Conditional Variational AutoEncoders (CVAEs). These models use a latent variable $z$ to capture high-level semantic concepts, allowing for diverse outputs. However, CVAEs suffer from a "condition independence" problem: during the generation phase, the model often ignores the input context $x$ when sampling $z$. Because natural language input is sparse and complex, the "prior network" (which is supposed to tell the model how to pick $z$ based on $x$) fails to learn a meaningful connection. The result is a chatbot that is diverse but often nonsensical or off-topic.

Methods

The authors propose the CTVAE, which shifts the role of the input condition.

  1. The "Transitional" Latent Variable: Instead of trying to predict a complex, condition-dependent distribution for $z$, CTVAE starts with a simple, condition-independent "transitional" variable $t$ sampled from a standard Gaussian distribution $\mathcal{N}(0, \mathbf{I})$.
  2. The Transformation Network: To get the final latent variable $z$, the model passes both the input condition $x$ and the sample $t$ through a non-linear transformation network (a multi-layer perceptron). This forces the model to mathematically combine the context and the random noise to create the latent representation used for decoding.
  3. Architecture: The model uses 1-layer LSTM-RNNs for encoders and decoders.
  4. Reranking: To ensure the best output is chosen from multiple samples, they implemented a Topic Coherence Discrimination (TCD) model. This acts as a secondary filter to judge how well a generated response actually fits the original post.

Datasets

The models were trained and tested on the STC (Short Text Conversation) dataset from NTCIR-12.

  • Source: Crawled from the Chinese social media platform Sina Weibo.
  • Scale: Approximately 1.8 million post-response pairs.
  • Characteristics: It features a 1-to-n mapping (one post often has many different responses), making it ideal for testing diversity in conversation.

Key Insights and Ideas

  • The "CVAE-simple" Revelation: The authors tested a "simplified" CVAE where the condition was intentionally removed from the prior. They found it performed almost identically to a standard CVAE. This confirmed their suspicion: standard CVAEs weren't actually using the input condition effectively in their latent space.
  • Forcing Dependency: By moving the condition $x$ from the distribution parameters (mean/variance) to a transformation function, the authors made it much harder for the model to ignore the context.
  • Fluency vs. Diversity Trade-off: While standard CVAEs showed higher "diversity" scores in some metrics, the authors noted this was often because the models were generating fluent-but-irrelevant gibberish. CTVAE strikes a better balance by being more grounded in the topic.

Key Results

The CTVAE was compared against Seq2Seq, a standard CVAE, and the "CVAE-simple" baseline.

  • Fluency (Perplexity): CTVAE achieved a perplexity (PPL) of 21.75, significantly better than the standard CVAE (36.96), though still higher than the "safe" Seq2Seq model (7.61).
  • Subjective Human Evaluation: This is where CTVAE shined. In "ABX" preference tests (where humans pick the better of two responses):
  • Topic Relevance: CTVAE was preferred over CVAE in 40.8% of cases vs. 29.6% (with 29.6% ties), a statistically significant win ($p < 0.05$).
  • Informativeness: CTVAE beat CVAE significantly ($p < 0.01$), being judged as more interesting and content-rich.
  • Qualitative Example: For a post about a sunny day in Beijing, Seq2Seq gave a generic "What's this software?" response. CVAE gave a generic "Good morning." CTVAE generated specific, relevant responses like "The early bird catches the worm" and "Good weather in Beijing."

Limitations and Future Work

  • Single-Turn Focus: The current work only addresses single-turn "post-and-response" interactions. Real-world conversation requires maintaining state over multiple turns.
  • Diversity Metrics: The authors acknowledge that high diversity scores in standard CVAEs can be misleading if the responses aren't fluent.
  • Future Directions: The authors plan to apply the CTVAE framework to multi-turn dialogue generation and explore "controllable sampling," where one might influence specific attributes of the generated response (like sentiment or style) through the latent variable $z$.

Summary updated

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 N(0,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.
BibTeX
@inproceedings{ruan2019condition,
  author = {Yu-Ping Ruan and Zhen-Hua Ling and Quan Liu and Zhigang Chen and Nitin Indurkhya},
  title = {{Condition-transforming Variational Autoencoder for Conversation Response Generation}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2019},
  url = {https://openreview.net/forum?id=94tGV14qFY},
}

Loading related content...

Figure