Introduction
Text generation is a fundamental task in Natural Language Processing (NLP), yet it remains challenging. Traditional methods like Maximum Likelihood Estimation (MLE) often lead to "exposure bias," where small errors during inference compound over time, resulting in repetitive or nonsensical text. While Generative Adversarial Networks (GANs) have revolutionized image generation by introducing a discriminator to judge realism, their application to text is hindered by the discrete nature of language. Because tokens are discrete, gradients cannot flow directly from a discriminator back to a generator. Current solutions typically rely on Reinforcement Learning (RL) to estimate rewards, but RL-based GANs are notoriously unstable, sensitive to hyperparameters, and computationally expensive.
The SLGAN Framework
To address these challenges, the authors propose SLGAN (Sequence Contrastive GAN). SLGAN departs from the traditional binary "Real vs. Fake" classification paradigm. Instead, it employs a Sequence Contrast Discrimination framework.
The Siamese Discriminator ($G_d$)
The core innovation is the Siamese Discriminator, which is itself a sequence generator rather than a simple classifier. It acts as a "refiner" or "amplifier" that highlights features of realism. When presented with either real text ($x$) or generated text ($y$), it produces a discriminative sequence ($\hat{y}$).
Sequence Contrast Loss and Direct Guidance
The discriminator is trained using a contrastive objective: it minimizes the distance between its output for real text and the real text itself (intra-class similarity) while maximizing the distance between its outputs for real and fake text (inter-class contrast).
Crucially, because the discriminator provides a full sequence, the generator ($G$) receives a much richer gradient signal. It can directly compare its output to the discriminator's "refined" version. This direct guidance bypasses the high-variance reward estimation of RL, leading to a more stable training process. The final training objective for the generator is a hybrid loss, combining standard MLE loss for basic linguistic structure with the adversarial sequence contrast loss for high-level realism.
Experimental Setup
The performance of SLGAN was evaluated on two distinct benchmarks:
- Synthetic Dataset: Utilizing the Texygen platform, this controlled environment allows for evaluation against a known "oracle" distribution.
- Real-World Dataset: The COCO Image Captions dataset was used to test the model's ability to capture the nuances and complexities of human language.
Results and Discussion
SLGAN demonstrates significant improvements in both training stability and output quality compared to state-of-the-art baselines like SeqGAN, LeakGAN, and TextGAN.
Training Stability
One of the most prominent advantages of SLGAN is its convergence behavior. Unlike RL-based models that often exhibit erratic loss patterns, SLGAN's Negative Log-Likelihood (NLL) loss drops rapidly and remains stable throughout the training process.
Quality and Diversity
On the COCO dataset, SLGAN achieved superior diversity, as evidenced by its low Self-BLEU scores. Furthermore, human evaluations favored SLGAN in terms of "Topicality" (semantic consistency) and "Overall Quality." The model successfully maintains low perplexity—ensuring grammatical fluency—while producing more creative and less conservative text than MLE-trained models.
Conclusion
SLGAN represents a shift in adversarial text generation by moving from scalar rewards to sequence-level contrastive signals. By avoiding the RL bottleneck, it achieves greater stability and produces higher-quality, more diverse text. Future work will focus on adapting this framework for conditional tasks, such as dialogue systems, and optimizing the computational overhead associated with the Siamese architecture.
Summary updated