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

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

Abstract

Conversational query rewriting is essential for dialogue systems to understand user intent across multiple turns. We propose MLR (Multi-task model on sequence Labeling and query Rewriting), a two-stage approach that simultaneously labels word importance and generates rewritten queries. By incorporating a Conditional Random Field (CRF) layer to categorize words in the dialogue history, the model explicitly guides the decoder toward salient information. Our results on a large-scale dataset from Alibaba's AliMe assistant show that MLR significantly improves rewriting accuracy and BLEU scores compared to traditional sequence-to-sequence models.

Introduction

In natural human conversation, speakers frequently use pronouns and omit subjects, relying on context to convey meaning. For dialogue systems, this necessitates "looking back" at previous turns to resolve dependencies. While sequence-to-sequence (Seq2Seq) models are often used for this task, they frequently struggle with the "noise" of redundant information in conversational history. The challenge lies in extracting key components to create a concise, self-contained query suitable for downstream tasks like Question Answering (QA).

Methodology

The MLR model employs a two-stage architecture integrated into a single neural network. It begins with a Bi-LSTM encoder that processes the multi-turn history into hidden states. The core innovation is the addition of a CRF layer that predicts a category for every word: Key word (K), Separation word (E), or Normal word (N). These predicted category vectors are then added back into the hidden states, providing explicit guidance to an attention-based LSTM decoder.

Architecture of the MLR model showing the integration of the CRF labeling layer with the Seq2Seq framework.

The model is trained using a joint loss function ($L = L_{generation} + L_{labeling}$), forcing the network to learn both tasks simultaneously. This synergy allows the labeling task to act as a regularizer, improving the overall quality of the generated rewrites.

Experimental Setup

The model was evaluated using a massive dataset derived from AliMe, Alibaba's intelligent personal assistant. The dataset contains over 5.3 million training samples. Ground truth for the labeling task was automatically generated by tagging words in the history that appeared in human-rewritten queries.

Results and Discussion

The joint MLR model (seq2seq_crfj) was compared against several baselines, including standard Seq2Seq and models with copy mechanisms.

Performance comparison of various models across Accuracy, BLEU, and Exact Match metrics.

As shown in the results, MLR achieved an accuracy of 84.03%, a substantial improvement over the 63.87% achieved by the standard Seq2Seq baseline. It also reached an Exact Match (EM) score of 58.01% and consistently outperformed other models in BLEU scores. These findings suggest that explicit word categorization significantly enhances the model's ability to identify and preserve critical information during the rewriting process.

Conclusion

MLR demonstrates the effectiveness of multi-task learning for conversational query rewriting. By decoupling dialogue complexity into a single-turn format, it simplifies downstream processing. Future work will focus on improving the model's computational efficiency to meet the high Queries Per Second (QPS) demands of real-time production environments.

Summary updated

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