TL;DR
This paper introduces a novel Wasserstein Autoencoder (WAE) model that uses a Gaussian Mixture Prior (GMP) to enable controllable, stylized text generation from multi-class datasets. By learning separate latent distributions for each class, their approach allows for generating sentences that accurately reflect a desired style or even a blend of styles, outperforming previous methods in fluency and diversity, especially on smaller datasets.
What Problem Does This Paper Address?
Generating text that not only makes sense but also adheres to a specific style (like formality, sentiment, or genre) is a significant challenge in Natural Language Processing (NLP). Standard autoencoder models, including Variational Autoencoders (VAEs) and Wasserstein Autoencoders (WAEs), are good at learning general text distributions and reconstructing input, but they struggle when the training data contains multiple distinct styles or topics. These models typically use a single, simple prior distribution (like a standard normal distribution) for their latent space. When applied to multi-class data, this leads to an "over-regularization" of the latent space, making it difficult to isolate and control the style of the generated output. Essentially, they can't easily generate text in the "style of class A" versus "style of class B."
Methods
The core of this work is a Wasserstein Autoencoder (WAE), which addresses some limitations of VAEs, particularly the issue of "KL collapse" and ease of training. The key innovation is the use of a Gaussian Mixture Prior (GMP) instead of a single Gaussian prior. This GMP is designed to have a number of Gaussian components equal to the number of classes in the dataset.
Here's a breakdown of their approach:
- WAE Foundation: They leverage the WAE framework, which regularizes the latent space by minimizing the Wasserstein distance between the aggregated posterior distribution of the latent variables and a chosen prior distribution. This is achieved using the Maximum Mean Discrepancy (MMD) metric.
- Gaussian Mixture Prior (GMP): Instead of a single Gaussian, they use a mixture of Gaussians as the prior. Each Gaussian component in the mixture is associated with a specific class or style in the dataset.
- Semi-Supervised Learning: The model is trained on a multi-class dataset. During training, an input sentence is encoded into a latent representation. Crucially, the model learns to map sentences to their corresponding class's Gaussian distribution within the GMP.
- Style Control: At inference time, to generate a sentence in a specific style, the model samples from the Gaussian component of the GMP that corresponds to that desired style. For generating sentences with a blend of styles, they interpolate between samples from multiple Gaussian components.
- Shared Encoder/Decoder: A significant advantage is that they use a single encoder and decoder for all classes. This allows the model to learn from relatively small datasets by leveraging shared representations and also promotes diversity in generated sentences.
- Training Objective: The overall training loss combines reconstruction loss (ensuring the decoder can reconstruct the input), KL divergence loss (to regularize the stochastic part of the model), and the MMD loss (to enforce similarity between the aggregated posterior and the GMP).
Datasets
The primary dataset used for training and evaluation is the Multi-genre Natural Language Inference (MNLI) dataset. This dataset is described as containing crowd-sourced sentences from five different genres: Slate, Telephone, Government, Fiction, and Travel. For their experiments, they specifically ignore the "Slate" genre due to its diverse topics. They also mention using a subset of 10240 sentences from the remaining four classes for some experiments.
Key Insights and Ideas
- GMP for Style Disentanglement: The most significant insight is that a Gaussian Mixture Prior, where each component corresponds to a data class, naturally disentangles the latent space according to style. This allows for explicit control over generation.
- Leveraging Small Datasets: The shared encoder-decoder architecture, combined with the GMP, enables effective learning even on relatively small datasets. This is a crucial advantage for many real-world NLP tasks where large, perfectly labeled datasets are scarce.
- Diversity through Shared Components: By sharing the encoder and decoder across multiple style-specific priors, the model can learn a richer, more diverse set of linguistic patterns, leading to more varied and fluent generated sentences.
- No Adversarial Losses for Style: Unlike some previous methods that rely on adversarial losses to separate content from style, this approach achieves style control through the structured prior distribution, simplifying the training process.
Key Results
- Improved Style Accuracy: The model demonstrates good performance in generating sentences that match the desired style, as evaluated by a separate CNN classifier trained on the MNLI classes.
- Enhanced Diversity: The proposed GMM-WAE model outperforms baselines and previous works in terms of sentence diversity, measured by distinct unigram and bigram percentages.
- Fluency: The model achieves acceptable results in fluency, as measured by perplexity using a Kneser-Ney language model, comparable to separate WAEs trained on individual classes.
- Performance on Small Datasets: When trained on just ten percent of the MNLI data, their model significantly outperforms other models, highlighting its effectiveness with limited data.
- Style Interpolation: The model can generate sentences that blend styles by interpolating between latent vectors sampled from different Gaussian components of the prior.
Limitations and Future Work
- Classifier Dependence: The evaluation of style accuracy relies on a pre-trained classifier. While this is a common practice, it means the model's perceived style accuracy is tied to the classifier's performance.
- Language Model Fluency: The paper notes that the shared decoder might sometimes use "rare words" that are common in another class, leading to slightly lower fluency scores from the language model. This suggests potential for further refinement in decoder design or training.
- Future Work: The authors suggest that the power of the GMP to capture latent representations makes it possible to augment small datasets with data from other classes to learn more robust features for generating diverse samples with desired styles. They also imply that further exploration of the model's ability to learn good language models on small datasets is a promising direction.
Summary updated