Batch Policy Gradient Methods for Improving Neural Conversation Models

Kirthevasan Kandasamy, Yoram Bachrach, Ryota Tomioka, Daniel Tarlow, David Carter

Training a chatbot that doesn't just repeat "I'm not sure" or "Give me a second" is a notorious challenge in Natural Language Processing (NLP). While standard supervised learning gets us part of the way there, it often results in generic, safe, and ultimately boring responses. Reinforcement Learning (RL) offers a path to more engaging agents, but traditional RL assumes we can interact with the environment (or a human) infinitely and in real-time.

In their work, researchers from CMU and Microsoft Research propose Batch Policy Gradient (BPG), a method designed to refine neural conversation models using limited, noisy, and offline human feedback.

The Problem: Generic Responses and Expensive Feedback

Most modern chatbots are trained using Maximum Likelihood Estimation (MLE)—essentially teaching the bot to predict the next word a human would say based on a training corpus. However, MLE suffers from a "generic response" problem. Because phrases like "I don't know" or "Okay" are common and safe answers in many contexts, the bot learns to over-rely on them.

Reinforcement Learning can fix this by rewarding specific behaviors, such as being helpful, accurate, or diverse. But there is a catch: standard RL is typically on-policy and online, meaning the bot needs to try out an action and get an immediate reward. In the real world, getting a human to score every single sentence a bot says in real-time is prohibitively expensive and slow. Instead, we usually have "batch" data—logs of past conversations already scored by humans. Standard RL methods fail here because they aren't designed to learn from data generated by a different, older version of the bot (the "off-policy" problem).

Methodology: Batch Policy Gradients

To address this, the authors frame chatbot training as a Markov Decision Process (MDP) and introduce an off-policy batch reinforcement learning method. Key technical components include:

  • Off-policy Learning via Importance Sampling: Since the training data comes from a "behavior policy" (an older bot or a human), the authors use an importance sampling ratio to re-weight updates. This ensures the current bot learns correctly from actions it might not have taken itself.
  • $\lambda$-returns: To handle noisy rewards (as human scoring is highly subjective), they use a $\lambda$-return. This is a weighted average of the actual reward received and an estimated "value" of the state, helping balance the high variance of real-world rewards with the stability of a model's predictions.
  • Value Function Estimation: They implement a critic—a secondary model that predicts how much reward a state is likely to get. They tested both a simple constant mean reward and a more complex GTD($\lambda$) estimator that uses the LSTM's hidden states to predict future success.
  • Targeted Seq2Seq Updates: The underlying model is a standard Encoder-Decoder LSTM. However, to maintain language fluency while adjusting strategy, the RL process specifically targets only the top layers and the final softmax output of the decoder to "nudge" the bot toward better responses.
Illustration of the encoder and decoder RNNs. The RL algorithm only updates the top LSTM and softmax layer of the decoder (red dashed lines).

Datasets and Experiments

The paper evaluates BPG on two distinct fronts:

  1. Europarl (Synthetic): A dataset based on European Parliament proceedings. The authors created a synthetic task where the bot had to reproduce input words without using a "forbidden" list, allowing for controlled testing of the algorithm's mechanics.
  2. Restaurant Recommendations: A real-world dataset of customer service logs. They used Amazon Mechanical Turk (AMT) to have humans score bot responses on a scale of 0 to 2. This dataset represents the "noisy and expensive" reality of chatbot training.

Key Insights and Results

The experiments revealed several critical insights about applying RL to conversational agents:

  • Online vs. Batch: The authors demonstrate that Online Policy Gradient (OPG) performs poorly in batch settings. OPG assumes the environment is stationary, but in a fixed dataset, the "future" is already written. BPG's ability to look ahead at the rewards already present in the batch gives it a massive advantage.
  • Bootstrapping is Essential: You cannot easily start RL from scratch for natural language. The most effective pipeline is to train with MLE first to establish the basics of grammar and vocabulary, and then use BPG to refine the strategy and personality.
Average reward over epochs comparing BPG, OPG, and ML baselines. BPG methods significantly outperform online and ML-only approaches.
  • Quantitative Gains: In the restaurant recommendation task, one of the BPG-tuned bots showed a statistically significant improvement in mean human scores, moving from an MLE score of 0.70 to a BPG score of 0.73. In the realm of subjective human scoring, this represents a meaningful shift in conversational quality.
  • Qualitative Improvements (The "Generic" Filter): BPG effectively penalizes the bot for giving safe but useless answers. For example, if the conversation history shows a user's budget was already established, the MLE bot might still ask "How large is your group?" or ask for the budget again. The BPG bot learned to "remember" the context and move the conversation forward appropriately.

Limitations and Future Work

While promising, the approach has limitations. Importance sampling can lead to very high variance in updates if the new policy becomes too different from the old one, requiring "clipping" to keep training stable. Furthermore, even with batch methods, deep learning models still crave large amounts of labeled data; the 1,200 labeled conversations used here is only a starting point. Finally, because the reward is currently only given at the end of the sentence, future work could explore "dense" rewards—scoring the conversation word-by-word or turn-by-turn to provide a clearer, more immediate signal to the model.

Summary updated

BibTeX
@inproceedings{kandasamy2017batch,
  author = {Kirthevasan Kandasamy and Yoram Bachrach and Ryota Tomioka and Daniel Tarlow and David Carter},
  title = {{Batch Policy Gradient Methods for Improving Neural Conversation Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2017},
  url = {https://openreview.net/forum?id=rJfMusFll},
}
Figure