MLR: A Two-stage Conversational Query Rewriting Model with Multi-task Learning

Shuangyong Song, Chao Wang, Qianqian Xie, Xinxing Zu, Huan Chen, Haiqing Chen

Abstract

In natural multi-turn conversations, users frequently employ ellipsis and coreference, making it difficult for dialogue systems to maintain context. We present MLR (Multi-task model on sequence Labeling and query Rewriting), a novel architecture that transforms multi-turn conversational histories into standalone, single-turn queries. By integrating a sequence labeling task that explicitly identifies key informative tokens, MLR provides the decoder with critical guidance. Evaluated on a massive dataset from Alibaba's AliMe assistant, MLR demonstrates significant improvements over standard sequence-to-sequence models, achieving an 84.03% rewriting accuracy.

Introduction

Natural human dialogue is rarely explicit. We rely on pronouns and omit previously mentioned context, assuming our interlocutor can "fill in the blanks." For AI dialogue systems, this context dependency is a primary source of error. For instance, if a user asks "How's the weather in London?" followed by "What about tomorrow?", the system must understand that "tomorrow" refers to the weather in London.

Existing approaches typically use sequence-to-sequence (seq2seq) models to rewrite these queries. However, these models often fail to distinguish between redundant filler words and the essential components that define user intent. MLR addresses this by explicitly modeling the importance of each word in the conversation history.

Methodology

The MLR architecture utilizes a two-stage approach integrated into a single neural network for joint optimization.

  1. Encoder (Bi-LSTM): The conversation history is processed through a bidirectional Long Short-Term Memory network to generate contextualized hidden representations.
  2. Labeling Stage (CRF Layer): A Conditional Random Field layer sits atop the encoder to categorize every word into three classes: K (Key word) for essential information, E (Separation word) for turn markers, and N (Normal word) for redundant tokens.
  3. Fusion and Decoding: The predicted category vectors are added to the hidden states, effectively "highlighting" key information. An attention-based LSTM decoder then uses these enhanced states to generate the final rewritten query.
The MLR architecture featuring a Bi-LSTM encoder, a CRF labeling layer, and an attention-based decoder.

Experimental Setup

The model was trained and tested on a dataset derived from AliMe, Alibaba’s intelligent personal assistant. The dataset comprises over 5.3 million training samples and 50,000 test samples. To facilitate the multi-task learning, ground truth labels for the CRF layer were automatically generated by tagging tokens from previous turns that appeared in the final human-rewritten queries as "Key words."

Results and Discussion

Experimental results indicate that MLR (denoted as seq2seq_crfj in the results) significantly outperforms standard baselines and models equipped with copy mechanisms across all metrics, including Accuracy (ACC), BLEU scores, and Exact Match (EM).

Performance comparison of MLR against baseline models across multiple metrics.

The jump in human-evaluated Rewriting Accuracy from 63.87% (standard seq2seq) to 84.03% is particularly noteworthy. This suggests that explicit guidance via the auxiliary labeling task is far more effective than relying on the model to learn importance implicitly. Furthermore, joint optimization proved superior to training the labeling and generation stages separately, as the two tasks provide mutual reinforcement during the learning process.

Conclusion

MLR effectively acts as an information filter, stripping away the noise of multi-turn dialogue to isolate the user's true intent. While the model achieves high accuracy, future work will focus on optimizing the architecture for lower latency to meet the high Queries Per Second (QPS) requirements of large-scale production environments like Alibaba's assistant. The underlying language-agnostic architecture remains a promising solution for improving context understanding in diverse conversational AI applications.

Summary updated

BibTeX
@inproceedings{song2020mlr,
  author = {Shuangyong Song and Chao Wang and Qianqian Xie and Xinxing Zu and Huan Chen and Haiqing Chen},
  title = {{MLR: A Two-stage Conversational Query Rewriting Model with Multi-task Learning}},
  booktitle = {The Web Conference},
  year = {2020},
  doi = {10.1145/3366424.3382671},
}
Figure