Personalized Search-based Query Rewrite System for Conversational AI (2021)

Abstract: Query rewrite (QR) is an emerging component in conversational AI systems, reducing user defect. User defect is caused by various reasons, such as errors in the spoken dialogue system, users’ slips of the tongue or their abridged language. Many of the user defects stem from personalized factors, such as user’s speech pattern, dialect, or preferences. In this work, we propose a personalized search-based QR framework, which focuses on automatic reduction of user defect. We build a personalized index for each user, which encompasses diverse affinity layers to reflect personal preferences for each user in the conversational AI. Our personalized QR system contains retrieval and ranking layers. Supported by user feedback based learning, training our models does not require hand-annotated data. Experiments on personalized test set showed that our personalized QR system is able to correct systematic and user errors by utilizing phonetic and semantic inputs.

## introduction with the increased popularity of virtual assistant agents such as alexa, cortana and siri, millions of users interact with spoken dialog system on daily basis. some of the user interactions lead to defect experiences, where users do not get what they requested for, or the ai agent has to engage with the user again to clarify the user request. such errors originate either from the spoken dialogue system itself (e.g. automatic speech recognition (asr) error, natural language understanding (nlu) error, etc.) or the user. for example, an asr error can lead to "play son in dance" instead of the correct query "play stolen dance". often users' slips of the tongue can lead to the similar issue. it can be also the case that a partial song name is used in the request, or lyrics instead of the song name. the goal of qr component is to automatically recover from the defect and achieve better user experience. in production spoken dialogue systems, qr component is often triggered when the conversational ai cannot process user requests with a good confidence. for example, if asr confidence score is low or named entity tagger (ner) confidence score for nlu is low, qr component can be triggered to automatically map a user query to another form, so that the dialog system can be more robust. a crucial nature of qr is that often it needs to reflect personal preference or personalized error types to recover from the defect. while certain generic defect patterns may occur globally for many users, personalized error recovery is often expected to correctly fulfill each individual user's request. for example, a query "turn on the moon" might be a mis-recognized utterance requesting for the moonlight sonata. for other users who have a smart light device called "the moon lamp", this might be a request to turn on the lamp. personalized qr can be leveraged for such scenario, providing rewrites such as "turn on the moonlight sonata" or "turn on the moon lamp". inspired by @xcite , we approach the personalized qr task here with a search-based solution. a search system mainly comprises of two stacks operating sequentially: retrieval and ranking. figure 1 shows the overall framework of our search-based personalized rewrite system. personalized index contains successful utterances from each user. given the user query, retrieval model first retrieves top n candidates from the user's personalized index. in the retrieval stage, we aim to obtain the most relevant rewrite candidates with a good recall. the retrived candidates are ranked by the ranking model, utilizing personalized features extracted from personalized index. top 1 ranked candidate is returned as a final rewrite for the query. in the example shown in figure 1 , we observe that the rewrite does not only correct the song name, but also finds the correct artist name based on the personalization for the user. we utilize semi-supervised learning to obtain data and create the personalized index for each user in the conversational ai system. the personalized index primarily serves as a search pool for each user in the retrieval component. in our work, the index encompasses diverse affinity layers, which are utilized further as features in the ranking process. in section 3, we describe how the documents are constructed for personalization index. in section 4, we present the retrieval models we explored. section 5 describes the ranker model and its diverse set of features. ## related work many previous work focused on solving the qr problem in a non-personalized use case. in ponnusamy et al. (2020), authors proposed a markov chain model as a collaborative filtering mechanism to mine users' reformulation patterns. once the patterns are discovered, rewrite pairs are extracted (i.e. asr recognition of defect query -detected reformulation interaction). at runtime, if a query is an exact text match with a defect query, a rewrite will be triggered using the offline mined pairs. different from the markov chain model, @xcite proposed a retrieval model for qr task, utilizing a query encoder that incorporates contextual language modeling pre-training. at the same time, qr problem has been explored for other tasks as well. in @xcite , authors explored paraphrase retrieval for defect reduction on question answering task. a machine translation based method @xcite was explored for a qr problem in a search engine. @xcite further extended previous work on search-based qr in spoken dialogue system to both global layer (serving non-personalized, generic rewrites) and personalized layer. they utilize the search based methods and metrics such as similarity measures. compared to the markov chain model @xcite , this work provided a further flexibility to generalize over unseen input queries. for global layer, authors ex-plore the importance of a ranking layer leveraging a neural feature extractor and a tree model. in @xcite , authors present a retrieval model compared with a pointer-generator network with hierarchical attention to perform personalized rewrites within smart home domain. in our work, we focus on the search-based qr system that utilizes retrieval and ranking components. one strength of the search-based qr is that as the rewrite candidate pool is defined in the index, rewrite quality can be tightly controlled. compared to generation-based methods, which may provide enhanced flexibility and diversity of the rewrites, this provides an advantage for system stability, especially for a task like qr which is strongly relevant with runtime production setup. our work distinguishes itself from previous work from the following aspects. first, we significantly extend the personalized index to incorporate diverse affinities and associated personal preferences. our qr system is not limited to certain domains or usage, but capable of providing rewrites across all domains and functionalities within the spoken dialogue system (e.g. playing music, reading books, weather forecast, handling smart home devices, etc.). the retrieval component is further extended so that not only it utilizes the utterance information, but it incorporates phonetic information as well as asr n-best information. while personalized search-based qr system in @xcite only leveraged a retrieval component, we introduce a ranking model with personalized features. ## personalized index in order to support personalized rewrites, we build an index for each user, leveraging individual interaction history. personalized index reflects nondefect experiences for each user foot_0 observed within last 30 days of time window. we utilize a defect detection model such as @xcite ; @xcite as well as rule-based criteria to obtain nondefect turns. the rule-based criteria utilizes both users' response (if user barged in or stopped agent's response, the turn is defect) as well as agent's response (if agent responds as "sorry, i do not know that" or similar, the turn is defect). to better define the search space and consider runtime aspects, we limit the personalized index size, by selecting top l history utterances based on utterance count and recency from the user. in order to control runtime latency, we use @xmath0. our personalized index contains different layers to represent fine-grained affinities; utterance (with nlu hypothesis), entity, intent, and template. the utterance layer directly serves as the search space for the personalized retrieval. the other layers provide personalized features utilized for ranking process. in the following sections, we describe each of them in detail. ## retrieval component in a search system, retrieval layer aims to retrieve a set of relevant documents from a great amount of documents. the goal is to retrieve them with good recall, with low latency and computational cost. @xcite based embedder. the learning objective is to project the embedding of input query (e.g. "turn on tape timer") and that of target rewrite (e.g. "turn on tea timer") closely. ## ranking model given retrieved rewrite candidates, ranking layer aims to rank the most desired rewrite to the top. thus, precision is critical in the ranking layer. in this work, we build a gradient boosting model that utilizes both global level features as well as personalized features. in our personalized qr system, we retrieve top 10 rewrite candidates in the retrieval component and pass them down to the ranking component. the top 1 rewrite whose ranking score is higher than an empirically chosen θ is selected as the final rewrite. ## experiments and results in order to build the test set, we first find potential rephrase pairs that fulfill the following conditions: a) for the two consecutive utterances, the second turn utterance y is followed by the first turn utterance x within a short time window (i.e. 45 seconds) and their minimum edit distance is below an empirically chosen threshold, b) we can observe y in the user's personalized index with successful interaction indicated by the defect detection model. these location (wharton beach, australia). ## conclusions in this paper, we introduced a personalized searchbased query rewrite system for conversational ai system. in order to fulfill personalization, the individualized index tracks each user's successful interaction history and is further expanded to reflect diverse affinities. retrieval model leverages both utterance and phoneme information, and retrieves top 10 rewrite candidates. the candidates are ranked by the ranking model, utilizing highly personalized features based on the affinity layers as well as generic features for the query rewrite task. ex-periments demonstrated that the search-based qr system with personalization advancements brings a significant improvement on both precision and trigger rate on the personalized rewrite test set. for future work, we will focus on improving the model components further, including incorporation of richer prior information into the system (e.g. pretrained contextual language modeling). another future direction is to include richer contextual and personalized information into the retrieval process. the goal is to utilize contextual, cohort information and expand the qr experience to the functionalities that the user has not explored yet. also, we will explore including external common knowledge into the ranking process.