Retrieve and Refine: Improved Sequence Generation Models For Dialogue

Jason Weston, Emily Dinan, Alexander H. Miller

TL;DR

This paper introduces the Retrieve and Refine (RetNRef) framework, a hybrid approach to dialogue that combines the creative flair of retrieval models with the contextual sensitivity of generative models. By first retrieving a candidate response and then using a sequence-to-sequence model to "refine" it, the authors significantly reduce the production of generic, boring responses (the "I don't know" problem) and outperform standard baselines in human engagingness evaluations.

What Problem Does This Paper Address?

Building engaging conversational AI is a balancing act between two flawed paradigms:

  1. Sequence Generation (e.g., Seq2Seq): These models are great at staying on topic because they generate text token-by-token based on context. However, they are notoriously "cowardly." Because they are trained to minimize loss against a variety of possible human responses, they gravitate toward safe, generic, and uninformative sentences like "That's cool" or "I don't know."
  2. Retrieval Models: These models search a massive database for the best existing human response. While they surface interesting and diverse language, they are rigid. If the perfect response isn't in the database, they might provide a reply that is engaging but factually or contextually nonsensical.

The authors aim to bridge this gap, creating a system that can leverage the rich vocabulary of retrieved utterances while maintaining the flexibility to tune those utterances to the specific conversation at hand.

Methods

The proposed Retrieve and Refine model follows a simple yet effective pipeline:

  • The Retriever: A Key-Value Memory Network attends over the dialogue history to find the most relevant candidate response from the training set.
  • The Generator: A standard 2-layer LSTM with attention. The "trick" is in the input: the model concatenates the dialogue history with the retrieved candidate (separated by a special token). The generator then produces the final response, treating the retrieval as additional context to be edited or ignored.

The authors also introduced two key variants to improve performance:

  • RetNRef+: To prevent the model from ignoring the retrieval in favor of the dialogue history, they truncated the history, forcing the model to rely more heavily on the retrieved utterance.
  • RetNRef++: The authors noticed the generator sometimes made "copy errors"—changing just one or two words in a way that ruined a perfectly good retrieved sentence. This variant uses a heuristic: if the generated output has >60% word overlap with the retrieval, the model simply outputs the retrieved sentence exactly.

Datasets

The models were evaluated on the ConvAI2 challenge dataset, which is based on PersonaChat.

  • Nature: A "chit-chat" task where two speakers are assigned specific personas (e.g., "I have a dog," "I like to hike") and must get to know each other.
  • Scale: Approximately 160,000 utterances across 11,000 dialogues.
  • Significance: Unlike machine translation, dialogue in ConvAI2 is open-ended, making it a rigorous test for how well a model can maintain a consistent personality while remaining engaging.

Key Insights and Ideas

  • Perplexity is a Deceptive Metric: The authors found that lower perplexity (a standard measure of how well a model predicts a test set) does not necessarily correlate with better dialogue. As shown in Table 1, a model can have "poor" perplexity but still be highly rated by humans because it chooses an engaging path that simply differs from the specific ground-truth label.
Table 1: Perplexity results showing that while the true label gives the best PPL, standard retrievers don't necessarily improve PPL over vanilla Seq2Seq.
  • Injecting "Rare" Words: One of the biggest wins was in vocabulary distribution. Generative models usually fail to use rare words. By conditioning on a retrieval, the RetNRef models produced word statistics much closer to human-level diversity.
Table 2: Output sequence statistics for the methods. Seq2Seq generates shorter sentences with more com- mon words than humans, which RetNRef alleviates.
  • Learning to Ignore: The model effectively learns a "soft" copy mechanism. It can choose to copy the retrieval when it's high-quality or generate something entirely new when the retrieval is a poor fit.

Key Results

The hybrid approach proved superior in human evaluations across multiple metrics, particularly Engagingness.

  • Human Preference: In A/B testing, RetNRef++ won against the pure Memory Network retriever 54.5% of the time and against vanilla Seq2Seq 53.7% of the time.
  • Engagingness Scores: On a 1-5 scale, RetNRef++ achieved a score of 3.80, significantly higher than vanilla Seq2Seq (2.70) and even slightly better than the pure retrieval model (3.66).
Table 4: Human Evaluation scores for the models,scoring fluency, engagingness, consistency and persona detec- tion, with standard deviation in parentheses. We consider engagingness to be the most important metric.

Limitations and Future Work

Despite the improvements, the authors noted several lingering issues:

  • Persona Consistency: While engaging, the models were slightly weaker at consistently using their assigned personas compared to pure generative models.
  • Heuristics: The RetNRef++ model relies on a hard-coded 60% overlap threshold to fix copy errors. The authors suggest that more sophisticated, learnable copy mechanisms (like Pointer-Generator networks) or Byte Pair Encoding (BPE) could be more robust solutions.
  • Joint Training: In this work, the retriever and generator were treated as separate modules. Future work could involve training them jointly to optimize the retrieval process specifically for the refinement step.

Summary updated

BibTeX
@inproceedings{weston2018retrieve,
  author = {Jason Weston and Emily Dinan and Alexander H. Miller},
  title = {{Retrieve and Refine: Improved Sequence Generation Models For Dialogue}},
  booktitle = {SCAI @ EMNLP},
  year = {2018},
  doi = {10.18653/v1/w18-5713},
}
Figure