Deep Reinforcement Learning for Dialogue Generation

Jiwei Li, Will Monroe, Alan Ritter, Michel Galley, Jianfeng Gao, Dan Jurafsky

TL;DR

This paper moves dialogue generation beyond simple "next-word prediction" by framing conversation as a sequential decision-making process. By using Deep Reinforcement Learning to simulate dialogues between two virtual agents, the authors train models to prioritize long-term conversational success—rewarding responses that are informative, coherent, and easy to answer—rather than just mimicking high-frequency training data.

What Problem Does This Paper Address?

Standard neural dialogue systems typically use a Sequence-to-Sequence (Seq2Seq) framework trained via Maximum Likelihood Estimation (MLE). While effective for translation, MLE is "shortsighted" for conversation. It encourages the model to predict the most probable next turn based on the training data.

Because generic phrases like "I don't know" or "I'm sorry" appear so frequently in human datasets and are compatible with almost any context, MLE-based models default to these "dull" responses. Furthermore, these models often fall into infinite loops of repetitive utterances because they lack a mechanism to account for the long-term impact of a turn on the conversation's future. As shown in the baseline examples in the figure below, these models quickly hit "conversational black holes."

A comparison between baseline MLE models and the proposed RL model, showing how the RL model avoids repetitive loops and generic responses.

Methods

The authors propose a Deep Reinforcement Learning (DRL) framework where two virtual agents simulate a conversation.

The Architecture

The system uses an LSTM encoder-decoder as its backbone. The parameters are first initialized using standard supervised learning (MLE) and then refined using a policy gradient method (REINFORCE).

The Reward Function

The core innovation lies in the developer-defined reward function, which targets three specific conversational properties:

  1. Ease of Answering ($r_1$): A turn is rewarded if it is unlikely to be followed by a "dull" response (e.g., "I have no idea"). The model essentially learns to avoid putting the interlocutor in a conversational dead-end.
  2. Information Flow ($r_2$): This penalizes semantic redundancy. If an agent repeats itself or stays too close to its previous turn's meaning (measured by cosine similarity), the reward decreases.
  3. Semantic Coherence ($r_3$): To ensure the agent doesn't just say random high-reward words, this component uses mutual information to ensure the response is relevant to the previous turns and remains grammatical.

Training Strategy

To handle the massive action space (all possible natural language sentences), the authors use Curriculum Learning. They start by simulating only two turns and gradually increase the depth to five turns as the model improves.

Figure 1: Dialogue simulation between the two agents.

Datasets

The models were trained and evaluated using the OpenSubtitles dataset, which contains roughly 80 million source-target dialogue pairs. To ensure high-quality simulations, the authors filtered the set to 0.8 million sequences that were specifically "easy to respond to" (i.e., they had a low likelihood of triggering an "I don't know" response) to serve as initial inputs for the agents.

Key Insights and Ideas

  • Dialogue as a Game: By treating conversation like a game with long-term rewards (similar to AlphaGo), the model learns that a "safe" move now (a generic response) might lead to a "loss" later (a dead conversation).
  • The "Ease of Answering" Metric: This is a clever inversion of standard objectives. Instead of just trying to be relevant, the model actively tries to be helpful to the next speaker, fostering sustained interaction.
  • Initialization Matters: The authors found that RL cannot start from scratch in natural language. Initializing with MLE provides the "grammar" and basic semantics, while RL provides the "strategy."

Key Results

The RL-based model outperformed both vanilla Seq2Seq and Mutual Information (MI) baselines across several metrics:

  • Conversation Length: The RL model sustained dialogues for an average of 4.48 turns before hitting a dead-end, compared to only 2.68 for the standard Seq2Seq model.
  • Diversity: The RL model showed significantly higher unigram and bigram diversity, meaning it used a wider, more interesting vocabulary.
  • Human Evaluation: In a "multi-turn general quality" test, human judges preferred the RL model's conversations 72% of the time over the MI baseline.
Quantitative results showing the RL model produces longer and more diverse conversations.

Qualitatively, the RL agent showed a distinct tendency to end sentences with questions, effectively "handing the conversation over" to the user to keep the interaction alive.

Sample responses showing the RL model's tendency to be more interactive and inquisitive compared to baselines.

Limitations and Future Work

  • Reward Engineering: The rewards are still heuristic approximations. The authors note that ideally, the system should receive rewards from real human interaction rather than manually defined functions.
  • Computational Complexity: Simulating deep conversations is expensive. The current model only looks a few turns ahead because the search space grows exponentially.
  • Relevance vs. Repetition: There is a delicate tradeoff between staying on topic (relevance) and avoiding repetition. Sometimes the model might jump to a less relevant topic just to avoid being repetitive.
  • Cycle Loops: While the model avoids immediate repetition, it can still fall into longer cycles (e.g., A-B-A-B) because the conversational history considered is limited.

Summary updated

BibTeX
@inproceedings{li2016deep,
  author = {Jiwei Li and Will Monroe and Alan Ritter and Michel Galley and Jianfeng Gao and Dan Jurafsky},
  title = {{Deep Reinforcement Learning for Dialogue Generation}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2016},
  doi = {10.18653/v1/d16-1127},
}
Figure