Abstract
Generative Adversarial Networks (GANs) have experienced a recent surge in popularity, performing competitively in a variety of tasks, especially in computer vision. However, GAN training has shown limited success in natural language processing. This is largely because sequences of text are discrete, and thus gradients cannot propagate from the discriminator to the generator. Recent solutions use reinforcement learning to propagate approximate gradients to the generator, but this is inefficient to train. We propose to utilize an autoencoder to learn a low-dimensional representation of sentences. A GAN is then trained to generate its own vectors in this space, which decode to realistic utterances. We report both random and interpolated samples from the generator. Visualization of sentence vectors indicate our model correctly learns the latent space of the autoencoder. Both human ratings and BLEU scores show that our model generates realistic text against competitive baselines.
Introduction
Generative Adversarial Networks (GANs) have revolutionized computer vision, but their application to Natural Language Processing (NLP) has been hindered by the "discrete bottleneck." Unlike continuous pixel values in images, text is composed of discrete tokens. This discreteness prevents the direct backpropagation of gradients from a discriminator to a generator, as one cannot "slightly nudge" a word like "cat" toward "dog" in a differentiable way.
Previous attempts to bridge this gap relied on Reinforcement Learning (RL) to provide policy gradients. However, RL-based GAN training is notoriously unstable, computationally expensive, and difficult to tune. This paper introduces LaTextGAN (Latent-space GAN for text), a framework that bypasses RL entirely by operating in the continuous latent space of a pre-trained autoencoder.
Methodology
LaTextGAN employs a two-stage training strategy to transform the discrete text generation problem into a continuous one.
Two-Stage Training
- Textual Autoencoder: An LSTM-based autoencoder is first trained to compress sentences into low-dimensional latent vectors and reconstruct them. This stage establishes a continuous manifold representing the sentence space.
- Latent GAN: Once the autoencoder is frozen, a GAN is trained. The Generator ($G$) learns to produce synthetic vectors that mimic the distribution of real sentence vectors, while the Discriminator ($D$) attempts to distinguish between them.
Technical Implementation
To ensure stability, the authors utilize Wasserstein GAN (WGAN) with a gradient penalty (WGAN-GP). Both the generator and discriminator are built using 40-layer deep ResNets rather than standard fully-connected layers. For inference, a random noise vector is passed through the GAN generator to create a synthetic latent vector, which is then decoded by the LSTM into a natural language sentence.
The model was trained on the Toronto Book Corpus, using two million sentences restricted to a maximum length of 20 words. Rare words were filtered to ensure the quality of the generated output.
Key Results and Insights
The performance of LaTextGAN was benchmarked against a standard Neural Language Model (NLM) and a Variational Autoencoder (VAE).
Performance Metrics
Evaluation included both automated BLEU scores and human judgment. In human evaluations, participants were asked to compare generated sentences against real ones. LaTextGAN was judged "more realistic" than the ground truth 13.9% of the time, outperforming both the NLM and VAE baselines.
Latent Space Properties
A significant advantage of the latent-space approach is the ability to perform interpolation. By "walking" between two latent vectors, the model generates a sequence of sentences that transition smoothly in structure. Furthermore, t-SNE visualizations confirmed that the GAN-generated vectors effectively covered the same regions as real sentence vectors, suggesting the model avoids mode collapse and successfully captures the underlying data distribution.
Discussion and Future Work
LaTextGAN demonstrates that global sentence planning via latent vectors can produce more coherent text than token-by-token autoregressive models. While the model achieves high syntactic smoothness, semantic consistency during interpolation remains an area for improvement. Future research may explore mapping generated vectors back into a Gaussian space to enhance interpretability or applying this architecture to dialogue systems to improve response diversity. By moving the adversarial objective to a continuous space, LaTextGAN provides a stable and efficient alternative to RL-based text generation.
Summary updated