An Actor-Critic Algorithm for Sequence Prediction

Dzmitry Bahdanau, Philemon Brakel, Kelvin Xu, Anirudh Goyal, Ryan Lowe, Joelle Pineau, Aaron Courville, Yoshua Bengio

This paper, a notable contribution to the early "Deep RL for NLP" era, comes from a powerhouse team including Yoshua Bengio and Dzmitry Bahdanau. It tackles one of the most persistent headaches in sequence generation: the gap between how we train models and how we actually use them.

TL;DR

The authors introduce an actor-critic reinforcement learning framework to train sequence models (like those used in translation). By using a "critic" network that knows the ground-truth answer to evaluate the "actor's" guesses, the model learns to optimize for task-specific metrics like BLEU score while avoiding the compounding errors common in standard training.

What Problem Does This Paper Address?

Most sequence models are trained using Teacher Forcing. During training, the model is given the "correct" previous word to predict the next one. However, at test time, the model doesn't have a teacher; it has to rely on its own (potentially wrong) previous guesses. This discrepancy is known as exposure bias: small errors early in a sentence compound, leading to gibberish.

Furthermore, standard training maximizes log-likelihood—essentially asking, "How likely is the correct word?" But in the real world, we care about metrics like BLEU or ROUGE, which measure the quality of the whole sentence. Log-likelihood is a proxy that doesn't always correlate perfectly with these scores.

Methods

The authors propose an Actor-Critic approach to bridge this gap:

Actor-Critic Architecture
  • The Actor: A Recurrent Neural Network (RNN) that acts as the policy, choosing which token to generate next.
  • The Critic: A separate RNN that predicts the "value" of a token—the expected future reward (e.g., the final BLEU score) if the actor chooses that token and continues generating.

Key Innovations: 1. Informed Critic: Unlike traditional RL where the agent explores a dark room, here the critic is shown the ground-truth target during training. This allows it to provide much more accurate feedback to the actor. 2. Temporal Difference (TD) Learning: Instead of waiting until the end of a sentence to calculate a reward (which is slow and noisy), the critic uses TD learning to estimate rewards step-by-step. 3. Stabilization Techniques: To make RL work with the massive "action space" of a human vocabulary, the authors used target networks (a stable version of the critic) and a variance penalty to prevent the critic from overestimating the value of rare words.

Datasets

The researchers evaluated their method on two main fronts:

  • Synthetic Spelling Correction: Using the One Billion Word dataset, they corrupted text with random characters and tasked the model with recovering the original strings.
  • Machine Translation:
    • IWSLT 2014: German-to-English translation (approx. 153k sentence pairs).
  • WMT 14: A much larger English-to-French dataset (over 12 million pairs).

Key Insights and Ideas

  • The Regularization Effect: The authors found that training on the model's own generated sequences acts as a powerful regularizer. It prevents the model from becoming "spoiled" by perfect training data and makes it more robust to its own mistakes.
  • Lower Variance than REINFORCE: Previous attempts to use RL in NLP relied on the REINFORCE algorithm, which is notoriously "noisy" and slow to converge. By using a critic to provide a baseline, this method produces much smoother gradients, leading to faster and more stable training.
  • The Vocabulary Challenge: In RL, having 30,000+ possible actions (words) is a nightmare. The "aha moment" here was realizing that penalizing the variance of the critic’s outputs is essential to keep the training from diverging.

Key Results

Training curves showing BLEU score improvements
  • Spelling Correction: The actor-critic method consistently achieved lower Character Error Rates (CER) than standard maximum likelihood training.
  • Machine Translation: On the IWSLT German-English task, the method improved the BLEU score by 2.3 points over the baseline when using greedy search. The training curves clearly demonstrate the Actor-Critic (AC) method achieving higher validation BLEU scores compared to Log-Likelihood (LL) and REINFORCE (RF).
  • Scaling Up: On the massive WMT 14 English-French task, the actor-critic approach provided a significant 1.5 BLEU point boost, proving the method could scale to "real-world" production-sized datasets.

Limitations and Future Work

  • Optimization Sensitivity: The authors noted that the training can be brittle. If the actor becomes too "sure" of itself too quickly (determinism), the gradients vanish, and learning stops.
  • Pre-training is Mandatory: You can't start from scratch. The model must be pre-trained with standard log-likelihood; otherwise, the actor and critic just provide "weak signals" to each other in a cycle of confusion.
  • Bias vs. Variance: While the critic reduces variance, it introduces "bias" because the critic itself is just an approximation. The authors suggest future work could explore multi-sample criteria to further refine the critic's accuracy.

Summary updated

BibTeX
@inproceedings{bahdanau2017actor,
  author = {Dzmitry Bahdanau and Philemon Brakel and Kelvin Xu and Anirudh Goyal and Ryan Lowe and Joelle Pineau and Aaron Courville and Yoshua Bengio},
  title = {{An Actor-Critic Algorithm for Sequence Prediction}},
  booktitle = {International Conference on Learning Representations},
  year = {2017},
  url = {https://openreview.net/forum?id=SJDaqqveg},
}
Figure