SLIDE 1 Multi-Turn Response Selection for Chatbots with Deep Attention Matching Network
ππππππ§πππ πβππ£β , ππ£ ππβ, πΈππ¦ππππ πΈπππ, ππ πππ£, ππππ π·βππ, πππ§ππ πππ πβππ, πΈπππβππ ππ£ and πΌπ£π ππ£
Baidu β Natural Language Processing
SLIDE 2 Background
Chatbots
- Naturally and consistently converse with
human-beings on open-domain topics.
- Data-driven
- Retrieval-based method
- Generation-based method
- System ensemble
SLIDE 3 Context-Response Matching
π(ππ‘_ππππ|π, π )
Cont
xt π
Respons ponse π
SLIDE 4 Cont
xt π
Response π
A
Response π
B
Response π
C
Response π
D
Dialogue Corpus Retrieval System
Retrieval-based Chatbot
input Search Rank
π(ππ‘_ππππ|π, π )
Response π
A
Response π
C
Response π
D
Response π
B
An information retrieval approach to short text conversation. Ji et al., 2014
SLIDE 5 Adversarial Dialogue Generation
Dialogue Corpus
Generator π»(π β|π) Real Conversation Discriminator
π(ππ‘_ππππ|π, π )
Sampled <c, r>
Adversarial Learning for Neural Dialogue Generation. Li et al., EMNLP-2017
SLIDE 6 Challenges
- Detecting truly matched segment pairs across context and
response.
- Segment pairs could be matched at different granularities.
- Segment pairs, across context and response, could be matched
because of textual relevance or semantic dependency. Cha hallenge nges
SLIDE 7
Conversation Context Speaker A: Hi I am looking to see what packages are installed on my system, I donβt see a path, is the list being held somewhere else? Speaker B: Try dpkg - get-selections Speaker A: What is that like? A database for packages instead of a flat file structure? Speaker B: dpkg is the debian package manager - get-selections simply shows you what packages are handed by it Response of Speaker A: No clue what do you need it for, its just reassurance as I donβt know the debian package manager
SLIDE 8 Conversation Context Speaker A: Hi I am looking to see what packages are installed on my system, I donβt see a path, is the list being held somewhere else? Speaker B: Try dpkg - get-selections Speaker A: What is that like? A database for packages instead of a flat file structure? Speaker B: dpkg is the debian package manager - get-selections simply shows you what packages are handed by it Response of Speaker A: No clue what do you need it for, its just reassurance as I donβt know the debian package manager
Matchi hing w ng with s h sur urface t text xt
SLIDE 9 Conversation Context Speaker A: Hi I am looking to see what packages are installed on my system, I donβt see a path, is the list being held somewhere else? Speaker B: Try dpkg - get-selections Speaker A: What is that like? A database for packages instead of a flat file structure? Speaker B: dpkg is the debian package manager - get-selections simply shows you what packages are handed by it Response of Speaker A: No clue what do you need it for, its just reassurance as I donβt know the debian package manager
Matchi hing w ng with de h depe pende ndenc ncy
SLIDE 10
Conversation Context Speaker A: Hi I am looking to see what packages are installed on my system, I donβt see a path, is the list being held somewhere else? Speaker B: Try dpkg - get-selections Speaker A: What is that like? A database for packages instead of a flat file structure? Speaker B: dpkg is the debian package manager - get-selections simply shows you what packages are handed by it Response of Speaker A: No clue what do you need it for, its just reassurance as I donβt know the debian package manager
SLIDE 11 Motivation
Use GRU/LSTM to encode segments and match context with response only considering textual relevance.
Previ vious
wor
ks
Self-Attent ntion
- n: Using intra-attention of utterance/response to
gradually construct multi-grained semantic representations.
ntion
- n: Using attention across context and response to
match with dependency information.
Mot
vation
SLIDE 12
Conversation Context Speaker A: Hi I am looking to see what packages are installed on my system, I donβt see a path, is the list being held somewhere else? Speaker B: Try dpkg - get-selections Speaker A: What is that like? A database for packages instead of a flat file structure? Speaker B: dpkg is the debian package manager - get-selections simply shows you what packages are handed by it Response of Speaker A: No clue what do you need it for, its just reassurance as I donβt know the debian package manager
SLIDE 13
Conversation Context Speaker A: Hi I am looking to see what packages are installed on my system, I donβt see a path, is the list being held somewhere else? Speaker B: Try dpkg - get-selections Speaker A: What is that like? A database for packages instead of a flat file structure? Speaker B: dpkg is the debian package manager - get-selections simply shows you what packages are handed by it Response of Speaker A: No clue what do you need it for, its just reassurance as I donβt know the debian package manager
SLIDE 14
Conversation Context Speaker A: Hi I am looking to see what packages are installed on my system, I donβt see a path, is the list being held somewhere else? Speaker B: Try dpkg - get-selections Speaker A: What is that like? A database for packages instead of a flat file structure? Speaker B: dpkg is the debian package manager - get-selections simply shows you what packages are handed by it Response of Speaker A: No clue what do you need it for, its just reassurance as I donβt know the debian package manager
SLIDE 15
Conversation Context Speaker A: Hi I am looking to see what packages are installed on my system, I donβt see a path, is the list being held somewhere else? Speaker B: Try dpkg - get-selections Speaker A: What is that like? A database for packages instead of a flat file structure? Speaker B: dpkg is the debian package manager - get-selections simply shows you what packages are handed by it Response of Speaker A: No clue what do you need it for, its just reassurance as I donβt know the debian package manager
SLIDE 16
Conversation Context Speaker A: Hi I am looking to see what packages are installed on my system, I donβt see a path, is the list being held somewhere else? Speaker B: Try dpkg - get-selections Speaker A: What is that like? A database for packages instead of a flat file structure? Speaker B: dpkg is the debian package manager - get-selections simply shows you what packages are handed by it Response of Speaker A: No clue what do you need it for, its just reassurance as I donβt know the debian package manager
SLIDE 17
Conversation Context Speaker A: Hi I am looking to see what packages are installed on my system, I donβt see a path, is the list being held somewhere else? Speaker B: Try dpkg - get-selections Speaker A: What is that like? A database for packages instead of a flat file structure? Speaker B: dpkg is the debian package manager - get-selections simply shows you what packages are handed by it Response of Speaker A: No clue what do you need it for, its just reassurance as I donβt know the debian package manager
SLIDE 18 Conversation Context Speaker A: Hi I am looking to see what packages are installed on my system, I donβt see a path, is the list being held somewhere else? Speaker B: Try dpkg - get-selections Speaker A: What is that like? A database for packages instead of a flat file structure? Speaker B: dpkg is the debian package manager - get-selections simply shows you what packages are handed by it Response of Speaker A: No clue what do you need it for, its just reassurance as I donβt know the debian package manager
dkpg dkpg + ` ``itβ it + + ` ``dpkg dpkgβ
SLIDE 19 Conversation Context Speaker A: Hi I am looking to see what packages are installed on my system, I donβt see a path, is the list being held somewhere else? Speaker B: Try dpkg - get-selections Speaker A: What is that like? A database for packages instead of a flat file structure? Speaker B: dpkg is the debian package manager - get-selections simply shows you what packages are handed by it Response of Speaker A: No clue what do you need it for, its just reassurance as I donβt know the debian package manager
dkpg dkpg + ` ``itβ it + + ` ``dpkg dpkgβ
SLIDE 20 Attentive Module
que query Attent ntion
Weight ghted d Sum um ke key va value ue Sum um & Nor
Fe Feed-For
Sum um & Nor
ntive veModul
,K,V ,V)
Vatt = softmax(Q Β· KT βdk )V
Qatt = LayerNorm(Vatt + Q)
FFN(Qatt) =max(0, QattW1 + b1)W2 + b2
LayerNorm(FFN(Qatt) + Qatt)
Input nput
Q = [e0, ..., enQβ1] V = [e0, ..., enVβ1] K = [e0, ..., enKβ1]
- Capture structures across Q and K-V
- Composite semantic representations of captured
structures with input embedding Sum ummary
Attention is All You Need. Vaswani et al., NIPS-2017
SLIDE 21 Wor
Embe beddi dding ng
π ππ ππ ππ
SLIDE 22 Wor
Embe beddi dding ng
Repr present ntation
Modul
π ππ ππ ππ
Ui
R
Mul ulti-gr graine ned Repr present ntations
=            U0
i = ui,
... Ul
i = AttentiveModule(Ulβ1 i
, Ulβ1
i
, Ulβ1
i
), ... UL
i = AttentiveModule(ULβ1 i
, ULβ1
i
, ULβ1
i
)           
phr phrase-leve vel wor
vel sent nt.-leve vel
= ο£±     ο£²     ο£³ R0 = r, ... Rl = AttentiveModule(Rlβ1, Rlβ1, Rlβ1), ... RL = AttentiveModule(RLβ1, RLβ1, RLβ1) ο£Ό     ο£½     ο£Ύ
SLIDE 23 Wor
Embe beddi dding ng
Repr present ntation
Modul
π
Wor
d Matchi hing ng with C h Cros
ntion
ππ ππ ππ
Ui
R
Mul ulti-gr graine ned Repr present ntations
Mui,r
self
Mui,r
cross
SLIDE 24 Wor
Embe beddi dding ng
Repr present ntation
Modul
π
Wor
d Matchi hing ng with C h Cros
ntion
ππ ππ ππ
Ui
R
Mul ulti-gr graine ned Repr present ntations
Mui,r
self
Mui,r
cross Se Self lf-Attent ntion M
Mui,r,l
self = {Ul i[k]T Β· Rl[t]}nuiΓnr
Match w h with h text xtua ual i inf nfor
SLIDE 25 Wor
Embe beddi dding ng
Repr present ntation
Modul
π
Wor
d Matchi hing ng with C h Cros
ntion
ππ ππ ππ
Ui
R
Mul ulti-gr graine ned Repr present ntations
Mui,r
self
Mui,r
cross Se Self lf-Attent ntion M
Cros
ntion M
Mui,r,l
self = {Ul i[k]T Β· Rl[t]}nuiΓnr
Match w h with t h text xtua ual i inf nfor
Match w h with h de depe pende ndenc ncy i y inf nfor
Mui,r,l
cross = { e
U
l i[k]T Β· e
R
l[t]}nuiΓnr
e U
l i = AttentiveModule(Ul i, Rl, Rl)
e R
l = AttentiveModule(Rl, Ul i, Ul i)
SLIDE 26 Wor
Embe beddi dding ng
Repr present ntation
Modul
π
Wor
d Matchi hing ng with C h Cros
ntion
ππ ππ ππ
Matchi hing ng Scor
g(c,r)
3D 3D M Matchi hing ng Image ge Q Q
Ui
R
Mul ulti-gr graine ned Repr present ntations
Mui,r
self
Mui,r
cross
SLIDE 27 Wor
Embe beddi dding ng
Repr present ntation
Modul
π
Wor
d Matchi hing ng with C h Cros
ntion
ππ ππ ππ
Matchi hing ng Scor
g(c,r)
3D 3D M Matchi hing ng Image ge Q Q
Ui
R
Mul ulti-gr graine ned Repr present ntations
Mui,r
self
Mui,r
cross
Mul ulti-gr graine ned matching, including both text xtua ual and de depe pende ndenc ncy information, of a segment pair across context and response
Pixe xel
SLIDE 28 Ubunt buntu Cor
pus V1 Douba
Cor
pus Tr Train De Dev Te Test Tr Train De Dev Te Test # c # cont
xt-respons ponse-pa pairs 1M 1M 50k 50k 50k 50k 1M 1M 50k 50k 10k 10k # c # candi ndida dates pe per c cont
xt 2 10 10 10 10 2 2 10 10 # pos # positive ve c candi ndida dates pe per c cont
xt 1 1 1 1.18 1.18
urns ns pe per c cont
xt 3 3 3 3 Max.
# tur urns ns pe per c cont
xt 19 19 98 98 91 91 45 45
urns ns pe per c cont
xt 7.71 7.71 6.69 6.69 6.75 6.75 6.45 6.45
ds pe per ut utteranc nce 10.34 10.34 18.56 18.56 18.50 18.50 20.74 20.74
Experiment
- Ubuntu Corpus
- One-one multi-turn conversation
- Ubuntu troubleshooting
- Douban Corpus
- One-one multi-turn conversation
- Open domain topics
- Task
- Given multi-turn context and serval
response candidates
- Select the best candidate based on
matching score
SLIDE 29 Experiment
- DAM setup
- Test stacking 3-7 self-attention layers
- Comparison
- Seque
quent ntial M Matchi hing N ng Networ
k (SMN) (Wu et al., ACL-2017), Mul ulti-vi view M Matchi hing ng (Zhou et al., EMNLP-2016), DL2R 2R (Yan et al., SIGIR-2016), Dua ualEnc ncode
- der (Rowe et al., SigDial-2015)
- Ablation
- πΈπ΅π
LMNOP : without stacked self-attention
- πΈπ΅πQROP : only using the last layer of stacked self-attention
- πΈπ΅πOSQL : only using self-attention-match
- πΈπ΅πTNUOO : only using cross-attention-match
L(Β·) = β X
(c,r,y)βD
g(c, r)y + (1 β g(c, r))(1 β y)
SLIDE 30
Evaluation Results
SLIDE 31 no clue what do you need it for. its just reassurance as i dont know the debain package manager hi i am looking to see what packages are installed
my system i.1 dont see.1 a path is the list being held somewhere else
response
selfβattentionβmatch in stack 0
response
no clue what do you need it for. its just reassurance as i dont know the debain package manager hi i am looking to see what packages are installed
my system i.1 dont see.1 a path is the list being held somewhere else
turn 0
selfβattentionβmatch in stack 2
response
no clue what do you need it for. its just reassurance as i dont know the debain package manager hi i am looking to see what packages are installed
my system i.1 dont see.1 a path is the list being held somewhere else
selfβattentionβmatch in stack 4
response
Self-Attention Match Visualization
Stack-0 Stack-2 Stack-4
SLIDE 32 Cross-Attention Match Visualization
no clue what do you need it for. its just reassurance as i dont know the debain package manager hi i am looking to see what packages are installed
my system i.1 dont see.1 a path is the list being held somewhere else
turn 0 response
selfβattentionβmatch in stack 4
response
no clue what do you need it for. its just reassurance as i dont know the debain package manager hi i am looking to see what packages are installed
my system i.1 dont see.1 a path is the list being held somewhere else
turn 0 response
crossβattentionβmatch in stack 4
Self-Attention Match Cross-Attention Match
SLIDE 33 Summary
- We propose a novel deep attention matching network for multi-turn
response selection that entirely based on attention.
- We use stacked self-attention to construct multi-grained semantic
representations.
- We use cross-attention to match context with its candidate response
considering both textual and dependency information
SLIDE 34 Thanks
- Code & Data: https://github.com/baidu/Dialogue/DAM
- Our Authors