Abstract
Generative Adversarial Networks (GANs) have seen limited success in natural language generation due to the discrete nature of text and the "binary bottleneck" of traditional discriminators. We present RankGAN, a framework that replaces the binary classifier with a ranker. By measuring the relative quality of generated sequences against a human-written reference set, RankGAN provides a richer reward signal for the generator. Experimental results across synthetic and real-world datasets—including Chinese poetry and COCO captions—demonstrate that RankGAN significantly outperforms existing methods like SeqGAN in terms of both quality and diversity.
Introduction
The application of GANs to language generation faces two primary hurdles. First, the discrete data gap prevents the direct application of gradient descent, as small changes in word space are not differentiable. Second, the binary bottleneck of a standard discriminator (outputting a simple real/fake probability) often fails to capture the complex, high-dimensional nuances of language. This binary signal frequently leads to vanishing gradients, where the generator receives insufficient feedback to improve once the discriminator becomes too proficient.
RankGAN addresses these issues by shifting the objective from absolute classification to relative ranking. Instead of asking "is this real?", the model asks "how does this compare to known human examples?". By using a set of human-written sentences as a benchmark, the ranker can make more nuanced assessments, helping the generator avoid "mode collapse" where it might otherwise repeat a single "safe" sentence.
Methods
RankGAN consists of two adversarial components: an LSTM-based Generator ($G_\theta$) and a CNN-based Ranker ($R_\phi$).
The Ranking Mechanism
The Ranker evaluates a collection of sentences against a human-written reference set ($U$). It computes a Rank Score based on the cosine similarity between embeddings of the reference and target sentences. These scores are then passed through a softmax-like function to determine relative priority. To optimize the non-differentiable text output, RankGAN employs Policy Gradient reinforcement learning. The generator acts as an agent, and the ranker's relative score serves as the reward. To handle incomplete sequences, Monte Carlo (MC) search is used to estimate the expected future reward for each partial sentence.
Key Results
The model was rigorously tested on synthetic data, Chinese quatrains, COCO image captions, and Shakespearean text.
On synthetic data, RankGAN achieved a Negative Log-Likelihood (NLL) of 8.247, outperforming SeqGAN (8.736) and MLE (9.038). In the Chinese poem dataset, RankGAN's BLEU-2 score reached 0.812, and human evaluators rated its output at 4.52/10, significantly closer to human-written poems (6.69) than previous baselines like SeqGAN (3.58). Similar gains were observed in COCO captions and Shakespearean plays, where the model demonstrated a superior ability to capture long-range dependencies and specific stylistic nuances.
Conclusion
By moving beyond binary discrimination to a ranking-based adversarial framework, RankGAN provides a more informative and stable training signal for language generation. This approach effectively mitigates mode collapse and gradient vanishing by providing a smoother reward landscape. Future work will explore the application of ranking-based GANs to conditional generation tasks, such as image captioning, and multi-modal synthesis.
Summary updated