13
Filtering before Iteratively Referring for Knowledge-Grounded Response Selection in Retrieval-Based Chatbots Jia-Chen Gu 1 , Zhen-Hua Ling 1 , Quan Liu 1,2 , Si Wei 2 , Xiaodan Zhu 3 1 National Engineering Laboratory for Speech and Language Information Processing, University of Science and Technology of China, Hefei, China 2 State Key Laboratory of Cognitive Intelligence, iFLYTEK Research, Hefei, China 3 ECE & Ingenuity Labs, Queen’s University, Kingston, Canada [email protected], {zhling, quanliu}@ustc.edu.cn, [email protected], [email protected] Abstract The challenges of building knowledge- grounded retrieval-based chatbots lie in how to ground a conversation on the background knowledge and how to perform their matching with the response. This paper proposes a method named Filtering before Iteratively REferring (FIRE) for presenting the background knowledge of dialogue agents in retrieval-based chatbots. We first propose a pre-filter, which is composed of a context filter and a knowledge filter. This pre-filter grounds the conversation on the knowledge and comprehends the knowledge according to the conversation by collecting the matching information between them bidirectionally, and then recognizing the important information in them accordingly. After that, iteratively referring is performed between the context and the response, as well as between the knowledge and the response, in order to collect the deep and wide matching information. Experimental results show that the FIRE model outperforms previous methods by margins larger than 2.8% on original personas and 4.1% on revised personas on the PERSONA-CHAT dataset, as well as 3.1% on the CMU DoG dataset in terms of top-1 accuracy. 1 Introduction Building a conversational agent with intelligence has received significant attention with the emer- gence of personal assistants such as Apple Siri, Google Now and Microsoft Cortana. One approach is to building retrieval-based chatbots, which aims to select a potential response from a set of candi- dates given only the conversation context (Lowe et al., 2015; Wu et al., 2017; Zhou et al., 2018b; Gu et al., 2019a; Tao et al., 2019). However, real human conversations are often grounded on the external knowledge. People The inception 2009 Christopher Nolan Scientific Leonardo DiCaprio as Dom Cobb, a professional thief who specializes in conning secrets from his victims by infiltrating their dreams. Tom Hardy as Eames, a sharp-tongued associate of Cobb. ... Response DiCaprio, who has never been better as the tortured hero, draws you in with a love story that will appeal even to non-scifi fans. The movie is a metaphor for the power of delusional hype for itself. ... Dominick Cobb and Arthur are extractors, who perform corporate espionage using an experimental military technology to infiltrate the subconscious of their targets and extract valuable information through a shared dream world. Their latest target, Japanese businessman Saito, reveals that he arranged the mission himself to test Cobb for a seemingly impossible job: planting an idea in a person’s subconscious, or inception. Rotten Tomatoes: 86% and average: 8.1/10; IMDB: 8.8/10 Name Year Director Genre Cast Critical Response Introd- -uction Rating Background Knowledge Conversation Hi how are you today? I am good. How are you? Pretty good. Have you seen the inception? No, I have not but have heard of it. What is it about? It’s about extractors that perform experiments using military technology on people to retrieve info about their targets. Sounds interesting. Do you know which actors are in it? I haven’t watched it either or seen a preview. But it’s scifi so it might be good. Ugh Leonardo DiCaprio is the main character. He plays as Don Cobb. I’m not a big scifi fan but there are a few movies I still enjoy in that genre. Is it a long movie? Doesn’t say how long it is. The Rotten Tomatoes score is 86%. User 2: User 1: User 2: User 1: User 2: User 1: User 2: User 2: User 1: User 1: User 2: User 2: Figure 1: An example from CMU DoG dataset. Words in the same color refer to each other. Some irrelevant utterances do not refer to the knowledge but play the role of connecting the preceding and following utterances. Some knowledge entries such as Year, Director and Critical Response are not mentioned in this conversation. may associate relevant background knowledge according to the current conversation, and then reply to make it more engaging. Recently, re- searchers are devoted to simulating this motivation by grounding dialogue agents with background knowledge (Zhang et al., 2018; Zhou et al., 2018a; Mazar ´ e et al., 2018; Zhao et al., 2019; Gu et al., 2019b). In this paper, we study the problem of knowledge-grounded response selection and specify the knowledge as unstructured entries that are common sources in practice. An example is shown in Figure 1. In this way, agents can respond according to not only the semantic relevance with arXiv:2004.14550v1 [cs.CL] 30 Apr 2020

arXiv:2004.14550v1 [cs.CL] 30 Apr 2020 · gence of personal assistants such as Apple Siri, Google Now and Microsoft Cortana. One approach is to building retrieval-based chatbots,

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: arXiv:2004.14550v1 [cs.CL] 30 Apr 2020 · gence of personal assistants such as Apple Siri, Google Now and Microsoft Cortana. One approach is to building retrieval-based chatbots,

Filtering before Iteratively Referring for Knowledge-GroundedResponse Selection in Retrieval-Based Chatbots

Jia-Chen Gu1, Zhen-Hua Ling1, Quan Liu1,2, Si Wei2, Xiaodan Zhu3

1National Engineering Laboratory for Speech and Language Information Processing,University of Science and Technology of China, Hefei, China

2State Key Laboratory of Cognitive Intelligence, iFLYTEK Research, Hefei, China3ECE & Ingenuity Labs, Queen’s University, Kingston, Canada

[email protected], {zhling, quanliu}@ustc.edu.cn,[email protected], [email protected]

Abstract

The challenges of building knowledge-grounded retrieval-based chatbots lie inhow to ground a conversation on thebackground knowledge and how to performtheir matching with the response. This paperproposes a method named Filtering beforeIteratively REferring (FIRE) for presentingthe background knowledge of dialogueagents in retrieval-based chatbots. We firstpropose a pre-filter, which is composed ofa context filter and a knowledge filter. Thispre-filter grounds the conversation on theknowledge and comprehends the knowledgeaccording to the conversation by collectingthe matching information between thembidirectionally, and then recognizing theimportant information in them accordingly.After that, iteratively referring is performedbetween the context and the response, aswell as between the knowledge and theresponse, in order to collect the deep andwide matching information. Experimentalresults show that the FIRE model outperformsprevious methods by margins larger than 2.8%on original personas and 4.1% on revisedpersonas on the PERSONA-CHAT dataset,as well as 3.1% on the CMU DoG dataset interms of top-1 accuracy.

1 Introduction

Building a conversational agent with intelligencehas received significant attention with the emer-gence of personal assistants such as Apple Siri,Google Now and Microsoft Cortana. One approachis to building retrieval-based chatbots, which aimsto select a potential response from a set of candi-dates given only the conversation context (Loweet al., 2015; Wu et al., 2017; Zhou et al., 2018b;Gu et al., 2019a; Tao et al., 2019).

However, real human conversations are oftengrounded on the external knowledge. People

The inception

2009

Christopher Nolan

Scientific

Leonardo DiCaprio as Dom Cobb, a professional thief who specializes

in conning secrets from his victims by infiltrating their dreams.

Tom Hardy as Eames, a sharp-tongued associate of Cobb.

...

Response DiCaprio, who has never been better as the tortured hero,

draws you in with a love story that will appeal even to non-scifi fans.

The movie is a metaphor for the power of delusional hype for itself.

...Dominick Cobb and Arthur are extractors, who perform corporate

espionage using an experimental military technology to infiltrate the

subconscious of their targets and extract valuable information through

a shared dream world. Their latest target, Japanese businessman Saito,

reveals that he arranged the mission himself to test Cobb for a seemingly

impossible job: planting an idea in a person’s subconscious, or inception.

Rotten Tomatoes: 86% and average: 8.1/10; IMDB: 8.8/10

Name

Year

Director

Genre

Cast

Critical

Response

Introd-

-uction

Rating

Background Knowledge

Conversation

Hi how are you today?

I am good. How are you?

Pretty good. Have you seen the inception?

No, I have not but have heard of it. What is it about?

It’s about extractors that perform experiments using military technology

on people to retrieve info about their targets.

Sounds interesting. Do you know which actors are in it?

I haven’t watched it either or seen a preview. But it’s scifi so it might be

good. Ugh Leonardo DiCaprio is the main character.

He plays as Don Cobb.

I’m not a big scifi fan but there are a few movies I still enjoy in that genre.

Is it a long movie?

Doesn’t say how long it is.

The Rotten Tomatoes score is 86%.

User 2:

User 1:

User 2:

User 1:

User 2:

User 1:

User 2:

User 2:

User 1:

User 1:

User 2:

User 2:

Figure 1: An example from CMU DoG dataset. Wordsin the same color refer to each other. Some irrelevantutterances do not refer to the knowledge but playthe role of connecting the preceding and followingutterances. Some knowledge entries such as Year,Director and Critical Response are not mentioned inthis conversation.

may associate relevant background knowledgeaccording to the current conversation, and thenreply to make it more engaging. Recently, re-searchers are devoted to simulating this motivationby grounding dialogue agents with backgroundknowledge (Zhang et al., 2018; Zhou et al., 2018a;Mazare et al., 2018; Zhao et al., 2019; Gu et al.,2019b). In this paper, we study the problemof knowledge-grounded response selection andspecify the knowledge as unstructured entries thatare common sources in practice. An example isshown in Figure 1. In this way, agents can respondaccording to not only the semantic relevance with

arX

iv:2

004.

1455

0v1

[cs

.CL

] 3

0 A

pr 2

020

Page 2: arXiv:2004.14550v1 [cs.CL] 30 Apr 2020 · gence of personal assistants such as Apple Siri, Google Now and Microsoft Cortana. One approach is to building retrieval-based chatbots,

the given context, but also the relevant knowledgeout of scope of the given conversation.

The current state-of-the-art model on this task,i.e., DIM (Gu et al., 2019b), which proposed adual matching framework performing the context-response and knowledge-response matching respec-tively. This model has showed great performance toselect an appropriate response matching the contextand the knowledge simultaneously. However, thecontext has no relationships with the knowledgein DIM, as it neglects the step of grounding theconversation on the knowledge, which is essentialfor this task. Meanwhile, the matching in DIM istoo shallow to capture deep matching information,as the response refers to the context and theknowledge only once. To this end, we argueDIM has three drawbacks that: (1) it does notground the conversation on the knowledge, as notall utterances are relevant to the knowledge (suchas the greetings), (2) it does not comprehend theknowledge according to the conversation, as entriesin the knowledge are redundant (such as the entriesof Year, Director and Critical Response in Figure 1are not mentioned), and (3) the matching in DIMis performed in a shallow and limited way.

In this paper, we propose a method namedFiltering before Iteratively REferring (FIRE) forpresenting the background knowledge of dialogueagents in retrieval-based chatbots. We first proposea pre-filter which let the context and the knowledgerefer to each other bidirectionally, in order to rec-ognize the important utterances in the context andimportant entries in the knowledge. Specifically,this pre-filter is composed of a context filter and aknowledge filter. The context filter let the contextrefer to the knowledge to derive the knowledge-aware context. We utilize the soft attention mech-anism to discriminate the relevant and irrelevantutterances. Typically, a peaky distribution ofattention weights is achieved for relevant utterancesas a result of semantically relevant words, while aflat one is achieved for irrelevant ones, as shownin Appendix A.2. The relevant utterances can beenhanced by the semantically relevant words in theknowledge, while approximately averaged knowl-edge does not bring too much useful informationfor irrelevant utterances. However, we still keepthe irrelevant utterances instead of directly filteringthem out, since they still play the role of connectingthe preceding and following utterances. On theother hand, we design a knowledge filter to derive

the context-aware knowledge and directly filter outthe irrelevant knowledge entries. The entries areindependent to each other and filtering out theseirrelevant ones do not affect the whole.

Given the filtered context and knowledge, howto perform their matching with the response isanother key issue to this task. Motivated by theattention-over-attention (AoA) (Cui et al., 2017)and interaction-over-interaction (IoI) (Tao et al.,2019) neural networks, we design an iterativelyreferring network. This network follows the dualmatching framework (Gu et al., 2019b) by lettingthe response refer to the context and the knowledgesimultaneously. Different from the shallow andlimited matching in DIM, we perform the referringoperation iteratively. The outputs of each iterationare utilized as the inputs of next iteration. Eachtime of iteration is capable of capturing additionalmatching information based on previous iterations.We accumulate the outputs of each iteration andthen aggregate them into a set of matching featuresfor ranking responses. Accumulating those canhelp to derive deep and wide matching information.

We test our proposed method on the PERSONA-CHAT (Zhang et al., 2018) and CMU DoG datasets(Zhou et al., 2018a). Results show that the FIREmodel outperforms previous methods by marginslarger than 2.8% on original personas and 4.1% onrevised personas on the PERSONA-CHAT dataset,as well as 3.1% on the CMU DoG dataset in termsof top-1 accuracy, achieving a new state-of-the-art performance for knowledge-grounded responseselection in retrieval-based chatbots.

In summary, the contributions of this paperare two-fold. (1) A Filtering before IterativelyREferring (FIRE) method is proposed whichaims to filter the context and the knowledge first,and then iteratively refer to the response. (2)Experimental results on the PERSONA-CHATand CMU DoG datasets demonstrate that ourproposed model outperforms the state-of-the-artmodel by large margins on the accuracy of responseselection.

2 Related Work

2.1 Response Selection

Response selection is an important problem inbuilding retrieval-based chatbots. Existing workon response selection can be categorized intosingle-turn (Wang et al., 2013) and multi-turndialogues (Lowe et al., 2015; Wu et al., 2017;

Page 3: arXiv:2004.14550v1 [cs.CL] 30 Apr 2020 · gence of personal assistants such as Apple Siri, Google Now and Microsoft Cortana. One approach is to building retrieval-based chatbots,

Zhou et al., 2018b; Gu et al., 2019a; Tao et al.,2019). Early studies have been more on single-turndialogues, considering only the last utterance ofa context for response matching. More recently,the research focus has been shifted to multi-turnconversations, a more practical setup for realapplications. Wu et al. (2017) proposed thesequential matching network (SMN) which firstmatched the response with each context utteranceand then accumulated the matching information bya recurrent neural network. Zhou et al. (2018b)proposed the deep attention matching network(DAM) to construct representations at differentgranularities with stacked self-attention. Gu et al.(2019a) proposed the interactive matching network(IMN) to perform the bidirectional and globalinteractions between the context and the responsein order to derive the matching feature vector.Tao et al. (2019) proposed the interaction overinteraction (IoI) model which performed matchingby stacking multiple interaction blocks.

2.2 Knowledge-Grounded Chatbots

Chit-chat models suffer from a lack of explicitlong-term memory as they are typically trainedto produce an utterance given only a very recentdialogue history. Recently, some studies show thatchit-chat models can be more diverse and engagingby conditioning them on the background knowl-edge. Zhang et al. (2018) released the PERSONA-CHAT dataset which employs the speakers’ profileinformation as the background knowledge. Zhouet al. (2018a) released the CMU DoG datasetwhich employs the Wikipedia articles about popu-lar movies as the background knowledge. Mazareet al. (2018) proposed the fine-tuned persona-chat(FT-PC) model which first pre-trained a modelusing a large-scale corpus with external knowledgeand then fine-tuned it on the PERSONA-CHATdataset. Zhao et al. (2019) proposed the document-grounded matching network (DGMN) which fusedinformation in the context and the knowledgeinto representations of each other. Gu et al.(2019b) proposed a dually interactive matchingnetwork (DIM) which performed the interactivematching between responses and contexts andbetween responses and knowledge respectively.

In this paper, we make two improvements to thestate-of-the-art DIM model (Gu et al., 2019b) onthis task. Specifically, (1) a pre-filter is designedfor the context and the knowledge before their

matching with the response, and (2) the context-response and knowledge-response matching aredeeper and wider than those in DIM.

3 Task Definition

Given a dialogue dataset D, an example of thedataset can be represented as (c, k, r, y). Specifi-cally, c = {u1, u2, ..., unc} represents a contextwith {um}nc

m=1 as its utterances and nc as theutterance number. k = {e1, e2, ..., enk

} representsa knowledge description with {en}nk

n=1 as its entriesand nk as the entry number. r represents aresponse candidate. y ∈ {0, 1} denotes a label.y = 1 indicates that r is a proper responsefor (c, k); otherwise, y = 0. Our goal is tolearn a matching model g(c, k, r) from D. Forany context-knowledge-response triple (c, k, r),g(c, k, r) measures the matching degree between(c, k) and r.

4 FIRE Model

Figure 2 shows an overview of the model ar-chitecture. In general, the context utterances,responses and knowledge entries are first encodedby a sentence encoder. Then the context and theknowledge are co-filtered by referring to each other.Next, the response refers to the filtered contextand knowledge simultaneously and iteratively. Theoutputs of each iteration are aggregated into amatching feature, and utilized as the inputs of nextiteration at the same time. Finally, the matchingfeatures of each iteration are accumulated forprediction. Details are provided in the followingsubsections.

4.1 Word Representation

We follow the setting used in DIM (Gu et al.,2019b), which constructs word representations bycombining general pre-trained word embeddings,those estimated on the task-specific training set, aswell as character-level embeddings, in order to dealwith the out-of-vocabulary issue.

Formally, embeddings of the m-th utterance in acontext, the n-th entry in a knowledge descriptionand a response candidate are denoted as Um =

{um,i}lumi=1 , En = {en,j}lenj=1 and R = {rk}lrk=1

respectively, where lum , len and lr are the numbersof words in Um, En and R respectively. Each um,i,en,j or rk is an embedding vector.

Page 4: arXiv:2004.14550v1 [cs.CL] 30 Apr 2020 · gence of personal assistants such as Apple Siri, Google Now and Microsoft Cortana. One approach is to building retrieval-based chatbots,

BiLSTM

Context

Response

Knowledge

Pooling BiLSTM

Pooling

Pooling BiLSTM

Pooling

C-R Matching 1 Aggregation 1

Aggregation 1K-R Matching 1

Pooling

AttentionPooling

Pooling

AttentionPooling

C-R Matching 2 Aggregation 2

Aggregation 2K-R Matching 2

Context Filter

Knowledge Filter

… ...

… ...

g(c, k, r)

: Attention Operation

: Addition Operation

: Concatenation Operation

: Compression Operation

: Selection Operation

: Enhancement Operation

Figure 2: An overview of our proposed FIRE model.

4.2 Sentence EncoderNote that the encoder can be any existing encodingmodel. In this paper, the context utterances,knowledge entries and response candidate areencoded by bidirectional long short-term memories(BiLSTMs) (Hochreiter and Schmidhuber, 1997).Detailed calculations are omitted due to limitedspace. After that, we can obtain the encodedrepresentations for utterances, entries and response,denoted as Um = {um,i}lumi=1 , En = {en,j}lenj=1

and R = {rk}lrj=1 respectively. Each um,i, en,j orrk is an embedding vector of d-dimensions. Theparameters of these three BiLSTMs are shared inour implementation.

4.3 Pre-FilterAs illustrated in Figure 1, not each utterancerefers to the knowledge, and not each entry ismentioned in the conversation. In order to groundthe conversation on the knowledge and comprehendthe knowledge according to the conversation, wepropose a pre-filter. It let the context and the knowl-edge refer to each other bidirectionally to derive thefiltered context and knowledge representations C0

and K0, which are then utilized to match with theresponse. This pre-filter is composed of a contextfilter and a knowledge filter. We will introducethem as follows.

Context Filter The context refers to the knowl-edge in order to derive the knowledge-awarecontext representation C0 by collecting the match-ing information between them and dynamicallydetermining the importance of each utterance. We

still keep those irrelevant utterances softly insteadof directly filtering them out, since they still playthe role of connecting the preceding and followingutterances.

First, given the set of utterance representations{Um}nc

m=1 encoded by the sentence encoder, weconcatenate them to form the context representa-tion C = {ci}lci=1 with lc =

∑ncm=1 lum . Also, the

knowledge representation K = {kj}lkj=1 with lk =∑nkn=1 len is formed similarly by concatenating

{En}nkn=1. Then, a soft alignment is performed

by computing the attention weight between eachtuple {ci, kj} as

eij = c>i · kj . (1)

After that, local inference is determined by the at-tention weights computed above to obtain the localrelevance between the context and the knowledge.For a word in the context, its relevant represen-tation carried by the knowledge is identified andcomposed using eij as

ci =

lk∑j=1

exp(eij)∑lkz=1 exp(eiz)

kj , i ∈ {1, ..., lc}, (2)

where the contents in {kj}lkj=1 that are relevant to ciare selected to form ci, and we define C = {ci}lci=1.

To further enhance the collected information,the element-wise difference and multiplicationbetween {C, C} are computed, and are then con-catenated with the original vectors to obtain theenhanced context representations as follows,

C = [C; C; C− C; C� C], (3)

Page 5: arXiv:2004.14550v1 [cs.CL] 30 Apr 2020 · gence of personal assistants such as Apple Siri, Google Now and Microsoft Cortana. One approach is to building retrieval-based chatbots,

where C = {ci}lci=1 and ci ∈ R4d. So far wehave collected the relevant information from theknowledge for the context. Finally, we compressthe collected and original information, in order toobtain the knowledge-aware context representationas

c0i = ReLU(ci ·Wc + bc) + ci, (4)

where C0= {c0i }

lci=1, Wc ∈ R4d×d and bc ∈ Rd

are parameters updated during training.Generally speaking, the operation of context

referring to knowledge mentioned above can beconsidered as employing C as query, and K as keyand value. For brevity, we define this referringoperation as

C0= REFER(C, K, K). (5)

The filtered context representation C0 is thenutilized to match with the response.

Knowledge Filter Similarly, the knowledgerefers to the context in order to derive the context-aware knowledge representation K0. However,different from the context filter, we adopt aselection strategy to directly filter out irrelevantknowledge entries, as the entries are independentto each other and filtering out irrelevant ones doesnot affect the whole.

First, the knowledge refers to the context byperforming the same referring operation in order tocollect the matching information from the contextas follows,

K0′= REFER(K, C, C). (6)

where K0′= {E0′

n }nkn=1.

Furthermore, we need to compute the relevancebetween each entry and the whole conversation inorder to determine whether to filter out this entry.We first perform the last-hidden-state pooling overthe representations of the utterances and entries outof the sentence encoder. The utterance embedding{um}nc

m=1 and the entry embedding {en}nkn=1 are

obtained. Next, we compute the relevance scorefor each utterance-entry pair as follows,

smn = u>m ·M · en, (7)

where M ∈ Rd×d is the matching similarityupdated during training.

In order to obtain the overall relevance scorebetween each entry and the whole conversation,

additional aggregation operation is required. Here,we make an assumption that one entry is mentionedonly once in the conversation. Thus, for a givenentry, its relevance score with the conversation isdefined as the maximum relevance score betweenit and all utterances. Mathematically, we have

sn = maxm

smn. (8)

A threshold γ is introduced here. Those entrieswhose scores are below γ will be considered asuninformative for this conversation and directlyfiltered out. Mathematically, we have

s′n = σ(sn) > γ, s′n ∈ {0, 1}, (9)

E0n = s′n · E

0′

n , n ∈ {1, ..., nk}, (10)

where σ is sigmoid function and � is element-wise multiplication. We define the final filteredknowledge representation K0

= {E0n}

nkn=1.

4.4 Iteratively ReferringGu et al. (2019b) shows that the interactionsbetween the context and the response and thosebetween the knowledge and the response can bothprovide useful matching information for decidingthe matching degree between them. However,the matching information collected there are veryshallow and limited, as the response refers to thecontext and the knowledge only once. In this paper,we design an iteratively referring network whichlet the response refer to the filtered context andknowledge iteratively. Each time of iteration iscapable of capturing additional matching informa-tion based on previous iterations. Accumulatingthese iterations can help to derive the deep and widematching features.

Take the context-response matching as an exam-ple. The matching strategy adopted here considersthe global and bidirectional interactions betweentwo sequences. Let Cl

= {cli}lci=1 and Rl

={rlk}

lrk=1 be the outputs of the l-th iteration, and

the inputs of the l+1-th iteration, where l ∈{0, 1, ..., L− 1} and L is the number of iterations.We define R0

= R.First, the context refers to the response by

performing the same referring operation as follows,

Cl+1= REFER(Cl

, Rl, Rl

). (11)

After that, we can obtain the response-awarecontext representation Cl+1.

Page 6: arXiv:2004.14550v1 [cs.CL] 30 Apr 2020 · gence of personal assistants such as Apple Siri, Google Now and Microsoft Cortana. One approach is to building retrieval-based chatbots,

Bidirectionally, the response refers to the contextas follows,

Rl+1= REFER(Rl

, Cl, Cl

). (12)

After that, we can obtain the context-aware re-sponse representation Rl+1.

After finishing one time of iteration, we canderive Cl+1 and Rl+1, which are utilized as theinput of next iteration. After L times of iterations,we can obtain {Cl}Ll=1 and {Rl}Ll=1.

On the other hand, the knowledge-responsematching is conducted identically to the context-response matching as introduced above. Therepresentations of response-aware knowledge Kl

and knowledge-aware response Rl∗ are used asfollows,

Kl+1= REFER(Kl

, Rl∗, Rl∗

), (13)

Rl+1∗= REFER(Rl∗

, Kl, Kl

), (14)

where R0∗= R. Similarly, we can obtain {Kl}Ll=1

and {Rl∗}Ll=1 after L times of knowledge-responsereferring.

4.5 Aggregation

Given these sets of matching matrices {Cl}Ll=1,{Rl}Ll=1, {Kl}Ll=1, and {Rl∗}Ll=1, they are aggre-gated into the final matching features. Note thatwe perform the same aggregation operation foreach iteration. Here, we take Cl

, Rl, Kl and Rl∗

for example. As aggregation is not the focus of thispaper, we adopt the same strategy as that used inDIM (Gu et al., 2019b). We will introduce brieflyand readers can refer to Gu et al. (2019b) for moredetails.

First, Cl and Kl are converted back to separatedmatching matrices as {Ul

m}ncm=1 and {El

n}nkn=1.

Then, each matching matrix Ulm, R

l, El

n, and Rl∗

are aggregated by max pooling and mean poolingoperations to derive their embeddings ul

m, rl,eln and rl∗ respectively. Next, the sequences of{ul

m}ncm=1 and {eln}

nkn=1 are further aggregated to

get the embedding vectors for the context and theknowledge respectively.

As the utterances in a context are chronologicallyordered, the utterance embeddings {ul

m}ncm=1 are

sent into another BiLSTM following the chrono-logical order of utterances in the context. Com-bined max pooling and last-hidden-state poolingoperations are then performed to derive the contextembeddings cl.

On the other hand, as the entries in a knowl-edge description are independent to each other,an attention-based aggregation is designed over{eln}

nkn=1 to derive the knowledge embeddings kl.

The matching feature vector of this iterationis the concatenation of context, knowledge andresponse embeddings as

ml = [cl; rl; kl; rl∗], (15)

where the first two features describe the context-response matching, and the last two describe theknowledge-response matching.

Last, we could obtain the set of matchingfeatures for each iteration {ml}Ll=1.

4.6 Prediction

For each matching feature vector ml, it is sent intoa multi-layer perceptron (MLP) classifier. Here,the MLP is designed to predict whether a (c, k, r)triple match appropriately based on the derivedmatching feature vector and return a score denotingthe matching degree. A softmax output layeris adopted in this model to return a probabilitydistribution over all response candidates. Theprobability distributions for each matching featurevector ml are averaged to derive the final matchingscore for ranking.

4.7 Learning Method

Inspired by Tao et al. (2019), we learn a modelby minimizing the summation of the loss of eachiteration. By this means, each feature can bedirectly supervised by the labels in D duringlearning. Furthermore, inspired by Szegedy et al.(2016), we employ the strategy of label smoothingin order to prevent the model from being over-confident. Let Θ denote the parameters of thematching model. The learning objective L(D,Θ)is formulated as

L(D,Θ) =−L∑l=1

∑(c,k,r,y)∈D

[ylog(gl(c, k, r))

+ (1− y)log(1− gl(c, k, r))].(16)

5 Experiments

5.1 Datasets

We tested our proposed method on the PERSONA-CHAT (Zhang et al., 2018) and CMU DoG datasets

Page 7: arXiv:2004.14550v1 [cs.CL] 30 Apr 2020 · gence of personal assistants such as Apple Siri, Google Now and Microsoft Cortana. One approach is to building retrieval-based chatbots,

ModelPERSONA-CHAT

CMU DoGOriginal Revised

R@1 R@2 R@5 R@1 R@2 R@5 R@1 R@2 R@5

Starspace (Wu et al., 2018) 49.1 60.2 76.5 32.2 48.3 66.7 50.7 64.5 80.3Profile Memory (Zhang et al., 2018) 50.9 60.7 75.7 35.4 48.3 67.5 51.6 65.8 81.4KV Profile Memory (Zhang et al., 2018) 51.1 61.8 77.4 35.1 45.7 66.3 56.1 69.9 82.4Transformer (Mazare et al., 2018) 54.2 68.3 83.8 42.1 56.5 75.0 60.3 74.4 87.4DGMN (Zhao et al., 2019) 67.6 80.2 92.9 58.8 62.5 87.7 65.6 78.3 91.2DIM (Gu et al., 2019b) 78.8 89.5 97.0 70.7 84.2 95.0 78.7 89.0 97.1FIRE (Ours) 81.6 91.2 97.8 74.8 86.9 95.9 81.8 90.8 97.4

Table 1: Performance of the proposed and previous methods on the test sets of the PERSONA-CHAT andCMU DoG datasets. The meanings of “Original”, and “Revised” can be found in Section 5.1.

(Zhou et al., 2018a) which both contain multi-turndialogues grounded on the background knowledge.

The PERSONA-CHAT dataset consists of 8939complete dialogues for training, 1000 for valida-tion, and 968 for testing. Response selection isperformed at every turn of a complete dialogue,which results in 65719 dialogues for training, 7801for validation, and 7512 for testing in total. Positiveresponses are true responses from humans andnegative ones are randomly sampled by the datasetpublishers. The ratio between positive and negativeresponses is 1:19 in the training, validation, andtesting sets. There are 955 possible personas fortraining, 100 for validation, and 100 for testing,each consisting of 3 to 5 profile sentences. Tomake this task more challenging, a version ofrevised persona descriptions are also providedby rephrasing, generalizing, or specializing theoriginal ones.

The CMU DoG dataset consists of 2881 com-plete dialogues for training, 196 for validation,and 537 for testing. Response selection is alsoperformed at every turn of a complete dialogue,which results in 36159 dialogues for training,2425 for validation, and 6637 for testing in total.This dataset was built in two scenarios. In thefirst scenario, only one worker has access to theprovided knowledge, and he/she is responsiblefor introducing the movie to the other worker;while in the second scenario, both workers knowthe knowledge and they are asked to discuss thecontent. Since the data size for an individualscenario is small, we followed the setting used inZhao et al. (2019) which merged the data of thetwo scenarios in the experiments and filtered outconversations less than 4 turns to avoid noise. Sincethis dataset did not contain negative examples, we

adopted the version shared in Zhao et al. (2019),in which 19 negative candidates were randomlysampled for each utterance from the same set.

5.2 Evaluation Metrics

We used the same evaluation metrics as in theprevious work (Zhang et al., 2018; Zhao et al.,2019). Each model aimed to select k best-matchedresponse from available candidates for the givencontext and knowledge. We calculated the recall ofthe true positive replies, denoted as R@k.

5.3 Training Details

Due to limit space, readers can refer to Ap-pendix A.1 for more details.

5.4 Experimental Results

Table 1 presents the evaluation results of ourproposed and previous methods on the PERSONA-CHAT dataset under the configurations of originaland revised personas, as well as the results on theCMU DoG dataset. As the DIM model was nottested on the CMU DoG dataset, we used the codereleased by the original authors (Gu et al., 2019b)to test its performance on the CMU DoG dataset.Results show that the FIRE model outperformsprevious methods by margins larger than 2.8% onoriginal personas and 4.1% on revised personas onthe PERSONA-CHAT dataset, as well as 3.1% onthe CMU DoG dataset in terms of top-1 accuracyR@1, achieving a new state-of-the-art performancefor knowledge-grounded response selection inretrieval-based chatbots.

5.5 Analysis

Ablations We conducted the ablation tests asfollows. First, we ablate the iteratively referring

Page 8: arXiv:2004.14550v1 [cs.CL] 30 Apr 2020 · gence of personal assistants such as Apple Siri, Google Now and Microsoft Cortana. One approach is to building retrieval-based chatbots,

ModelPERSONA-CHAT

CMU DoGOriginal Revised

R@1 R@1 R@1

FIRE 82.3 75.2 83.4- Iterative refer 81.3 73.8 81.6- Pre-filter 78.9 71.1 78.8

C-R 65.6 66.2 79.7C-R→ Fusion 67.0 66.4 80.9Filter→ C-R 78.8 70.2 81.4K-R 51.6 34.3 57.8K-R→ Fusion 54.2 39.4 63.1Filter→ K-R 63.6 51.0 73.5

Table 2: Ablation tests of the FIRE model on thevalidation sets. C-R denotes the context-responsematching and K-R denotes the knowledge-responsematching. → denotes the operation order.

by setting the number of iterations L to one. Thenwe removed the pre-filter. The evaluation resultson the validation sets were shown in Table 2. Theperformances of these ablation models were worsethan before, leading to a drop in terms of selectionaccuracy, which demonstrated the effectiveness ofthese components in the FIRE model.

Furthermore, we discussed the single context-response or knowledge-response matching in orderto show the effectiveness of the context filter andthe knowledge filter separately. Three experimentswere designed as follows: (1) single context-response matching without knowledge; (2) context-response matching first and then knowledge fusionat a fine-grained utterance-level, as the IMNutr

model in Gu et al. (2019b) where readers canrefer to for more details; (3) context filtering firstand then the context-response matching. Theevaluation results on the validation set were shownin Table 2. It shows that the fusion after matchingand the filtering before matching can both improvethe performance with the help of knowledge.Meanwhile, the filtering before matching outper-formed the fusion after matching by a large margin,which demonstrated the effectiveness of the contextfilter. Also, we designed similar experimentsfor the knowledge-response matching and we canobserve the same trend, which demonstrated theeffectiveness of the knowledge filter.

Context-Knowledge Co-Filtering Figure 3 il-lustrates the performance of FIRE with respect todifferent hyper-parameter γ on the validation sets.Here, the number of iterationsLwas set to 1 to save

0.0 0.1 0.2 0.3 0.4 0.5gamma

72

74

76

78

80

82

R@1

80.9 81.1

79.6

73.1 73.373.8

73.2 73.1

72.2

80.9

81.1

81.3 81.6 81.3

81.2

81.1

81.080.9

PERSONA-CHAT-OriginalPERSONA-CHAT-RevisedCMU_DoG

Figure 3: Performance of FIRE with respect todifferent γ on the validation sets.

1 2 3 4Number of iterations

74

76

78

80

82

R@1

81.381.8

82.3 82.1

73.874.6

75.274.6

81.6

82.783.4

82.1

PERSONA-CHAT-OriginalPERSONA-CHAT-RevisedCMU_DoG

Figure 4: Performance of FIRE with respect todifferent numbers of iterations on the validation sets.

computation. It is notable that the selection strategywill be ablated when γ = 0. From the figure, wecan observe a consistent trend that there was animprovement when increasing γ at the beginning,which indicates that filtering out irrelevant entriesindeed improves the selection accuracy. Then theperformance started to drop when γ was too largesince some indeed relevant entries were also filteredout by mistake.

A case study is further conducted inAppendix A.2 by visualizations.

Iteratively Referring Figure 4 illustrates howthe performance of FIRE changes with respectto the number of iterations on the validation sets.From the figure, we can observe a consistent trendthat a significant improvement was achieved duringthe first few iterations, and then the performanceof the model becomes stable. The results indicatethat iteratively referring indeed improves accuracyof response selection.

Page 9: arXiv:2004.14550v1 [cs.CL] 30 Apr 2020 · gence of personal assistants such as Apple Siri, Google Now and Microsoft Cortana. One approach is to building retrieval-based chatbots,

Complexity We analysed the time and spacecomplexity difference between FIRE and DIM,which shows that FIRE is more time-efficient.Readers can refer to Appendix A.3 for more details.

6 Conclusion

In this paper, we propose a method named Filteringbefore Iteratively REferring (FIRE) for presentingthe background knowledge of dialogue agentsin retrieval-based chatbots. FIRE first pre-filtersthe context and the knowledge and then usesthe filtered context and knowledge to performthe deep and wide matching with the response.Experimental results show that the FIRE modeloutperforms previous methods by large marginson the PERSONA-CHAT and CMU DoG datasets,achieving a new state-of-the-art performancefor knowledge-grounded response selection inretrieval-based chatbots. In the future, we willexplore to employ pre-training methods to selectrelevant knowledge and incorporate it for responseselection.

ReferencesMartın Abadi, Paul Barham, Jianmin Chen, Zhifeng

Chen, Andy Davis, Jeffrey Dean, Matthieu Devin,Sanjay Ghemawat, Geoffrey Irving, Michael Isard,Manjunath Kudlur, Josh Levenberg, Rajat Monga,Sherry Moore, Derek Gordon Murray, BenoitSteiner, Paul A. Tucker, Vijay Vasudevan, PeteWarden, Martin Wicke, Yuan Yu, and XiaoqiangZheng. 2016. Tensorflow: A system for large-scalemachine learning. In 12th USENIX Symposiumon Operating Systems Design and Implementation,OSDI 2016, Savannah, GA, USA, November 2-4,2016., pages 265–283.

Yiming Cui, Zhipeng Chen, Si Wei, Shijin Wang,Ting Liu, and Guoping Hu. 2017. Attention-over-attention neural networks for reading comprehen-sion. In Proceedings of the 55th Annual Meetingof the Association for Computational Linguistics,ACL 2017, Vancouver, Canada, July 30 - August 4,Volume 1: Long Papers, pages 593–602. Associationfor Computational Linguistics.

Jia-Chen Gu, Zhen-Hua Ling, and Quan Liu. 2019a. In-teractive matching network for multi-turn responseselection in retrieval-based chatbots. In Proceedingsof the 28th ACM International Conference onInformation and Knowledge Management, CIKM2019, Beijing, China, November 3-7, 2019, pages2321–2324.

Jia-Chen Gu, Zhen-Hua Ling, Xiaodan Zhu, and QuanLiu. 2019b. Dually interactive matching network forpersonalized response selection in retrieval-based

chatbots. In Proceedings of the 2019 Conference onEmpirical Methods in Natural Language Processingand the 9th International Joint Conference onNatural Language Processing, EMNLP-IJCNLP2019, Hong Kong, China, November 3-7, 2019,pages 1845–1854.

Sepp Hochreiter and Jurgen Schmidhuber. 1997.Long short-term memory. Neural Computation,9(8):1735–1780.

Diederik P. Kingma and Jimmy Ba. 2015. Adam: Amethod for stochastic optimization. In 3rd Inter-national Conference on Learning Representations,ICLR 2015, San Diego, CA, USA, May 7-9, 2015,Conference Track Proceedings.

Ryan Lowe, Nissan Pow, Iulian Serban, and JoellePineau. 2015. The ubuntu dialogue corpus: Alarge dataset for research in unstructured multi-turndialogue systems. In Proceedings of the SIGDIAL2015 Conference, The 16th Annual Meeting of theSpecial Interest Group on Discourse and Dialogue,2-4 September 2015, Prague, Czech Republic, pages285–294.

Pierre-Emmanuel Mazare, Samuel Humeau, MartinRaison, and Antoine Bordes. 2018. Trainingmillions of personalized dialogue agents. InProceedings of the 2018 Conference on EmpiricalMethods in Natural Language Processing, Brussels,Belgium, October 31 - November 4, 2018, pages2775–2779.

Tomas Mikolov, Ilya Sutskever, Kai Chen, Gregory S.Corrado, and Jeffrey Dean. 2013. Distributedrepresentations of words and phrases and their com-positionality. In Advances in Neural InformationProcessing Systems 26: 27th Annual Conferenceon Neural Information Processing Systems 2013.Proceedings of a meeting held December 5-8, 2013,Lake Tahoe, Nevada, United States., pages 3111–3119.

Vinod Nair and Geoffrey E. Hinton. 2010. Rectifiedlinear units improve restricted boltzmann machines.In Proceedings of the 27th International Conferenceon Machine Learning (ICML-10), June 21-24, 2010,Haifa, Israel, pages 807–814.

Jeffrey Pennington, Richard Socher, and Christopher D.Manning. 2014. Glove: Global vectors forword representation. In Proceedings of the2014 Conference on Empirical Methods in NaturalLanguage Processing, EMNLP 2014, October 25-29,2014, Doha, Qatar, A meeting of SIGDAT, a SpecialInterest Group of the ACL, pages 1532–1543.

Nitish Srivastava, Geoffrey E. Hinton, AlexKrizhevsky, Ilya Sutskever, and RuslanSalakhutdinov. 2014. Dropout: a simple wayto prevent neural networks from overfitting. Journalof Machine Learning Research, 15(1):1929–1958.

Page 10: arXiv:2004.14550v1 [cs.CL] 30 Apr 2020 · gence of personal assistants such as Apple Siri, Google Now and Microsoft Cortana. One approach is to building retrieval-based chatbots,

Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe,Jonathon Shlens, and Zbigniew Wojna. 2016.Rethinking the inception architecture for computervision. In 2016 IEEE Conference on ComputerVision and Pattern Recognition, CVPR 2016, LasVegas, NV, USA, June 27-30, 2016, pages 2818–2826. IEEE Computer Society.

Chongyang Tao, Wei Wu, Can Xu, Wenpeng Hu,Dongyan Zhao, and Rui Yan. 2019. One timeof interaction may not be enough: Go deep withan interaction-over-interaction network for responseselection in dialogues. In Proceedings of the 57thConference of the Association for ComputationalLinguistics, ACL 2019, Florence, Italy, July 28-August 2, 2019, Volume 1: Long Papers, pages 1–11.

Hao Wang, Zhengdong Lu, Hang Li, and EnhongChen. 2013. A dataset for research on short-text conversations. In Proceedings of the 2013Conference on Empirical Methods in NaturalLanguage Processing, EMNLP 2013, 18-21 October2013, Grand Hyatt Seattle, Seattle, Washington,USA, A meeting of SIGDAT, a Special Interest Groupof the ACL, pages 935–945.

Ledell Yu Wu, Adam Fisch, Sumit Chopra, KeithAdams, Antoine Bordes, and Jason Weston. 2018.Starspace: Embed all the things! In Proceedingsof the Thirty-Second AAAI Conference on Artifi-cial Intelligence, (AAAI-18), the 30th innovativeApplications of Artificial Intelligence (IAAI-18), andthe 8th AAAI Symposium on Educational Advancesin Artificial Intelligence (EAAI-18), New Orleans,Louisiana, USA, February 2-7, 2018, pages 5569–5577.

Yu Wu, Wei Wu, Chen Xing, Ming Zhou, andZhoujun Li. 2017. Sequential matching network:A new architecture for multi-turn response selectionin retrieval-based chatbots. In Proceedings ofthe 55th Annual Meeting of the Association forComputational Linguistics, ACL 2017, Vancouver,Canada, July 30 - August 4, Volume 1: Long Papers,pages 496–505.

Saizheng Zhang, Emily Dinan, Jack Urbanek, ArthurSzlam, Douwe Kiela, and Jason Weston. 2018.Personalizing dialogue agents: I have a dog, do youhave pets too? In Proceedings of the 56th AnnualMeeting of the Association for ComputationalLinguistics, ACL 2018, Melbourne, Australia, July15-20, 2018, Volume 1: Long Papers, pages 2204–2213.

Xueliang Zhao, Chongyang Tao, Wei Wu, Can Xu,Dongyan Zhao, and Rui Yan. 2019. A document-grounded matching network for response selectionin retrieval-based chatbots. In Proceedings of theTwenty-Eighth International Joint Conference onArtificial Intelligence, IJCAI 2019, Macao, China,August 10-16, 2019, pages 5443–5449.

Kangyan Zhou, Shrimai Prabhumoye, and Alan W.Black. 2018a. A dataset for document groundedconversations. In Proceedings of the 2018Conference on Empirical Methods in NaturalLanguage Processing, Brussels, Belgium, October31 - November 4, 2018, pages 708–713.

Xiangyang Zhou, Lu Li, Daxiang Dong, Yi Liu,Ying Chen, Wayne Xin Zhao, Dianhai Yu, andHua Wu. 2018b. Multi-turn response selectionfor chatbots with deep attention matching network.In Proceedings of the 56th Annual Meeting ofthe Association for Computational Linguistics, ACL2018, Melbourne, Australia, July 15-20, 2018,Volume 1: Long Papers, pages 1118–1127.

Page 11: arXiv:2004.14550v1 [cs.CL] 30 Apr 2020 · gence of personal assistants such as Apple Siri, Google Now and Microsoft Cortana. One approach is to building retrieval-based chatbots,

A Appendices

A.1 Training Details

For training the FIRE model on both thePERSONA-CHAT and CMU DoG datasets, somecommon configurations were set as follows.The Adam method (Kingma and Ba, 2015) wasemployed for optimization. The initial learningrate was 0.00025 and was exponentially decayedby 0.96 every 5000 steps. Dropout (Srivastavaet al., 2014) with a rate of 0.2 was applied tothe word embeddings and all hidden layers. Aword representation is a concatenation of a 300-dimensional GloVe embedding (Pennington et al.,2014), a 100-dimensional embedding estimatedon the training set using the Word2Vec algorithm(Mikolov et al., 2013), and 150-dimensionalcharacter-level embeddings with window sizes{3, 4, 5}, each consisting of 50 filters. Theword embeddings were not updated duringtraining. All hidden states of the LSTM have 200dimensions. The MLP at the prediction layer have256 hidden units with ReLU (Nair and Hinton,2010) activation. The validation set was used toselect the best model for testing.

Some parameters were different according tothe characteristics of the two datasets. For thePERSONA-CHAT dataset, the maximum numberof characters in a word, that of words in a contextutterance, of utterances in a context, of words ina response, of words in a knowledge entry, andof entries in a knowledge description were set tobe 18, 20, 15, 20, 15, and 5 respectively. Forthe CMU DoG dataset, these parameters were setto 18, 40, 15, 40, 40 and 20 respectively. Wepadded with zeros if the number of utterances ina context and the number of knowledge entriesin a knowledge description were less than themaximum; otherwise, we kept the last contextutterances or the last knowledge entries. Batchsize was set to 16 for the PERSONA-CHAT and4 for the CMU DoG. The hyper-parameter γ wasset to 0.3 on original personas and 0.2 on revisedpersonas on the PERSONA-CHAT dataset, as wellas 0.2 on the CMU DoG dataset, which were tunedon the validation sets as shown in Figure 3.

All code was implemented in the TensorFlowframework (Abadi et al., 2016) and will be pub-lished to help replicate our results after the paperacceptance.

A.2 Case StudyA case study was conducted for further illustration.Specifically, the context utterances of this case areU1: hey , are you a student , i traveled a lot , ieven studied abroad. U2: no , i work full time at anursing home . i am a nurses aide . U3: nice , i justgot a advertising job myself . do you like your job ?U4: nice . yes i do . caring for people is the joy ofmy life . U5: nice my best friend is a nurse , i knewhim since kindergarten. The knowledge entries ofthis case are E1: i have two dogs and one cat . E2:i work as a nurses aide in a nursing home . E3: ilove to ride my bike . E4: i love caring for people .

The context-to-knowledge attention weightsused in Eq. (2) of the context filter are visualized inFigure 5 (a). Meanwhile, the knowledge-to-contextattention weights of the knowledge filter arealso visualized in Figure 5 (b). Furthermore,the similarity scores smn in Eq. (7) for eachutterance-entry pair are visualized in Figure 6 (a).The final scores sn in Eq. (8) for each entry arevisualized in Figure 6 (b).

We can see that the utterances U2 and U4obtained large attention weights with the entries E2and E4 respectively. Meanwhile, some irrelevantentries E1 and E3 obtained small similarity scoreswith the conversation, which were going to befiltered out. This experimental results verified theeffectiveness of the pre-filter.

A.3 Complexity

Model Time (s) ParametersDIM 160.4 6.5MFIRE 109.5 13.1M

Table 3: The inference time over the validation set ofPERSONA-CHAT under the configuration of originalpersonas using different models, together with theirnumbers of parameters.

We analysed the time and space complexity bycomparing our proposed FIRE model and the state-of-the-art DIM model (Gu et al., 2019b) on thistask.

In order to explore the efficiency differencebetween FIRE and DIM, we analysed their timecomplexity by comparing their run-time compu-tation speed. We recorded the inference timeover the validation set of PERSONA-CHAT underthe configuration of original personas using aGeForce GTX 1080 Ti GPU. Furthermore, the

Page 12: arXiv:2004.14550v1 [cs.CL] 30 Apr 2020 · gence of personal assistants such as Apple Siri, Google Now and Microsoft Cortana. One approach is to building retrieval-based chatbots,

i have

two

dogs

and

one

cat

. i work

as a nurs

esai

dein a nu

rsin

gho

me

. i love

to ride

my

bike

. i love

carin

gfo

rpe

ople

.

knowledge

hey,areyouastudent,itraveledalot,ievenstudiedabroad_eos_no,iworkfulltimeatanursinghome.iamanursesaide._eos_nice,ijustgotaadvertisingjobmyself.doyoulikeyourjob?_eos_nice.yesido.caringforpeopleisthejoyofmylife._eos_nicemybestfriendisanurse,iknewhimsincekindergarten_eos_

cont

ext

0.2

0.4

0.6

0.8

(a) Context filter

i have

two

dogs

and

one

cat

. i work

as a nurs

esai

dein a nu

rsin

gho

me

. i love

to ride

my

bike

. i love

carin

gfo

rpe

ople

.

knowledge

hey,areyouastudent,itraveledalot,ievenstudiedabroad_eos_no,iworkfulltimeatanursinghome.iamanursesaide._eos_nice,ijustgotaadvertisingjobmyself.doyoulikeyourjob?_eos_nice.yesido.caringforpeopleisthejoyofmylife._eos_nicemybestfriendisanurse,iknewhimsincekindergarten_eos_

cont

ext

0.2

0.4

0.6

0.8

(b) Knowledge filter

Figure 5: Visualizations of attention weights of (a) context filter (the sum of weights for each row equals to 1)and (b) knowledge filter (the sum of weights for each column equals to 1) for a test sample. The darker unitscorrespond to larger values.

E1 E2 E3 E4

knowledge

U1

U2

U3

U4

U5

cont

ext

1.2

1.0

0.8

0.6

0.4

0.2

0.0

0.2

(a) smn in Eq. (7)

E1 E2 E3 E4

knowledge

0.05

0.00

0.05

0.10

0.15

0.20

0.25

0.30

0.35

(b) sn in Eq. (8)

Figure 6: Visualizations of similarity scores of (a) smn in Eq. (7) and (b) sn in Eq. (8) for a test sample. The darkerunits correspond to larger values.

Page 13: arXiv:2004.14550v1 [cs.CL] 30 Apr 2020 · gence of personal assistants such as Apple Siri, Google Now and Microsoft Cortana. One approach is to building retrieval-based chatbots,

number of parameters was used to evaluate thespace complexity of these two models. The resultsare shown in Table 3. We can see that, FIRErequires more parameters than DIM as FIRE addsan additional pre-filter and deepens the matchingnetwork. However, FIRE is more time-efficient asit requires less inference time. The reason is thatwe design a lighter aggregation method in FIREby replacing the recurrent neural network in theaggregation part of DIM with a single-layer non-linear transformation.