Adversarial Ranking for Language Generation

Kevin Lin, Dianqi Li, Xiaodong He, Ming-Ting Sun, Zhengyou Zhang

TL;DR

RankGAN moves beyond the "real vs. fake" binary of traditional Generative Adversarial Networks (GANs) for text. By replacing the standard discriminator with a ranker that evaluates sentences relative to a reference set, the model receives a much richer reward signal. This approach leads to more diverse and higher-quality language generation compared to previous state-of-the-art methods.

What Problem Does This Paper Address?

Generative models for natural language face two major hurdles:

  1. Discrete Data: Text is composed of discrete tokens, making it non-differentiable and difficult to optimize using standard backpropagation.
  2. Binary Discriminators: Traditional GANs use a binary discriminator that tries to classify a sentence as either 100% human-written or 100% machine-generated.

The authors argue that this binary approach is too restrictive for the "rich structures" of language. A machine-generated sentence might be grammatically perfect and meaningful but still get heavily penalized by a binary discriminator simply because it doesn't match the training distribution exactly. This leads to vanishing gradients and a lack of diversity in the output. The challenge is to provide the generator with a more nuanced, "relative" sense of quality.

Methods

RankGAN introduces a novel adversarial framework consisting of a Generator ($G$) and a Ranker ($R$).

RankGAN Architecture
  1. The Ranker as a Critic: Instead of assigning an absolute probability of "realness," the Ranker analyzes a collection of sentences. Given a human-written "reference" sentence, the Ranker must rank other human-written sentences higher than machine-generated ones.
  2. Rank Score Calculation: The Ranker (utilizing a CNN-based architecture) embeds sentences into a feature space. It calculates a "relevance score" using cosine similarity between the input sentence and the reference. These scores are then passed through a softmax-like function to produce a relative ranking probability within a comparison set.
  3. Policy Gradient Training: To handle the non-differentiable nature of discrete text, the authors use Reinforcement Learning (Policy Gradient). The generator acts as an agent, and the ranking score provided by the Ranker acts as the reward.
  4. Monte Carlo (MC) Rollouts: Since a reward is only available once a full sentence is finished, the authors use MC rollouts to estimate the "future value" of incomplete sentences, allowing the model to learn continuously during the generation process.

Datasets

The authors evaluated RankGAN across four distinct benchmarks to test different aspects of language generation:

  • Synthetic Data: 10,000 sequences generated by a random "oracle" LSTM to test the model's ability to capture complex dependencies in a controlled environment.
  • Chinese Poems: A dataset of 13,123 five-word quatrains.
  • COCO Captions: Approximately 80,000 image captions (used here for unconditional language generation, ignoring the images).
  • Shakespeare’s Plays: Specifically Romeo and Juliet, used to test the model's ability to learn rare phrases and archaic lexical dependencies.

Key Insights and Ideas

  • From Absolute to Relative: The core insight is that ranking is a more natural fit for language than binary classification. In human evaluation, it is often easier to say "Sentence A is better than Sentence B" than to declare "Sentence A is exactly 74% human."
  • Smoothing the Reward Signal: Binary discriminators often become too strong too quickly, providing zero useful gradient to the generator. By looking at a set of samples collectively, the Ranker provides a smoother, more informative reward signal that helps prevent the "vanishing gradient" problem.
  • Information Retrieval Meets GANs: The paper successfully ports "Learning to Rank" techniques—staples of search engine optimization—into the world of generative deep learning.

Key Results

RankGAN consistently outperformed the previous state-of-the-art (SeqGAN) and standard Maximum Likelihood Estimation (MLE) across multiple metrics:

Learning Curve for Synthetic Data
  • Synthetic Data: RankGAN achieved a significantly lower Negative Log-Likelihood (NLL) of 8.247, compared to SeqGAN's 8.736 and MLE's 9.038. The learning curve demonstrates a sharp improvement once the adversarial ranking phase begins.
  • Human Evaluation: On the COCO caption dataset, human evaluators gave RankGAN a score of 4.61/10, significantly higher than SeqGAN's 3.44 (though still trailing the human-written baseline of 6.42).
  • BLEU Scores: On Shakespearean text, RankGAN achieved a BLEU-2 of 0.914, outperforming SeqGAN (0.887) and showing a better grasp of complex transition patterns between words.

Limitations and Future Work

  • Computational Complexity: Using large reference and comparison sets increases the computational cost of training. Finding the optimal balance between "ranking quality" and "training speed" remains a practical challenge.
  • Convergence Theory: While the paper demonstrates empirical success, the theoretical convergence (Nash Equilibrium) for non-Bernoulli (non-binary) GANs is still an open research question.
  • Conditional Generation: This paper focused largely on unconditional generation. Extending RankGAN to conditional tasks—like image captioning (using the image as context) or machine translation—is highlighted as the next logical step.

Summary updated

BibTeX
@inproceedings{lin2017adversarial,
  author = {Kevin Lin and Dianqi Li and Xiaodong He and Ming-Ting Sun and Zhengyou Zhang},
  title = {{Adversarial Ranking for Language Generation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2017},
  url = {https://openreview.net/forum?id=H1ZA6LZ_-S},
}
Figure