Abstract
TextGAIL revitalizes the use of Generative Adversarial Networks (GANs) for text generation by integrating large-scale pre-trained models with a stable reinforcement learning objective and a novel contrastive discriminator. By utilizing GPT-2 and RoBERTa within a Generative Adversarial Imitation Learning framework, TextGAIL overcomes the long-standing "credibility crisis" where text GANs historically underperformed relative to simple Maximum Likelihood Estimation (MLE) baselines.
The Problem: Exposure Bias and GAN Instability
For years, the gold standard for training text generators has been Maximum Likelihood Estimation (MLE)—teaching a model to predict the next word in a human-written sentence. However, MLE suffers from exposure bias: during training, the model only sees perfect human text, but during inference, it must rely on its own potentially flawed previous outputs. This often leads to compounding errors and repetitive, dull text.
While Generative Adversarial Networks (GANs) were proposed as a solution, they faced significant hurdles. Previous research showed that most text GANs performed worse than well-tuned MLE models when evaluated on the trade-off between quality and diversity. The primary issues were high gradient variance leading to unstable training and "weak" discriminators that failed to provide useful feedback to the generator.
The TextGAIL Framework
TextGAIL addresses these challenges through three technical pillars designed to stabilize training and improve the quality of the reward signal:
- Pre-trained Foundations: Unlike earlier GANs that started from scratch, TextGAIL uses GPT-2 as the generator and RoBERTa as the discriminator, providing a high-quality starting point for both components.
- Contrastive Discriminator: Standard discriminators evaluate single sentences as "real" or "fake," often saturating too quickly. TextGAIL’s discriminator takes a pair—one real and one generated—and uses a softmax layer to decide which is more realistic. This relative comparison provides a smoother and more informative reward signal.
- Proximal Policy Optimization (PPO): To stabilize updates, the authors utilize PPO. This includes a "trust region" constraint that prevents the generator from changing too drastically in a single step, preserving the knowledge gained during pre-training.
- Imitation Replay Buffer: To handle the massive action space of human language, human-written "demonstrations" are mixed directly into the training buffer, ensuring the model stays grounded.
Key Results and Insights
Quality-Diversity Trade-off
The authors evaluated TextGAIL on both unconditional tasks (COCO Captions, EMNLP2017 News) and conditional tasks (CommonGEN, ROCStories). Using "temperature sweeps" for rigorous evaluation, TextGAIL consistently outperformed MLE and previous GAN architectures. It produced text that was both higher quality (higher BLEU scores) and more diverse (lower Self-BLEU or higher Distinct-n).
Human Preference and Latent Logic
In head-to-head human evaluations on ROCStories, humans preferred TextGAIL's endings 60.5% of the time, compared to only 23.4% for the MLE baseline. Beyond fluency, the discriminator proved to be an effective teacher; when tested on the "Story Cloze Test" (identifying the correct ending to a story), the TextGAIL discriminator achieved 79.1% accuracy without ever being explicitly trained for that task.
Limitations and Future Work
While TextGAIL excelled at short-to-medium text, the improvements on long-form text (such as EMNLP News) were less pronounced, likely due to noisier reward signals in longer sequences. Additionally, training two large transformer models in an RL loop is computationally intensive compared to standard fine-tuning. Future work may explore scaling this framework to even larger models or more complex reasoning tasks.
Conclusion
TextGAIL demonstrates that GANs can be a powerful tool for text generation when combined with strong pre-trained foundations and stable RL objectives. By shifting from absolute to relative discrimination and employing PPO, the framework successfully navigates the quality-diversity trade-off that has long hindered adversarial text generation.
Summary updated