Multi-Turn Response Selection for Chatbots with Deep Attention - - PowerPoint PPT Presentation

β–Ά
multi turn response selection for chatbots with deep
SMART_READER_LITE
LIVE PREVIEW

Multi-Turn Response Selection for Chatbots with Deep Attention - - PowerPoint PPT Presentation

Multi-Turn Response Selection for Chatbots with Deep Attention Matching Network , , , ,


slide-1
SLIDE 1

Multi-Turn Response Selection for Chatbots with Deep Attention Matching Network

π‘Œπ‘—π‘π‘œπ‘•π‘§π‘π‘œπ‘• π‘Žβ„Žπ‘π‘£βˆ— , 𝑀𝑣 π‘€π‘—βˆ—, πΈπ‘π‘¦π‘—π‘π‘œπ‘• πΈπ‘π‘œπ‘•, 𝑍𝑗 𝑀𝑗𝑣, π‘π‘—π‘œπ‘• π·β„Žπ‘“π‘œ, π‘‹π‘π‘§π‘œπ‘“ π‘Œπ‘—π‘œ π‘Žβ„Žπ‘π‘, πΈπ‘—π‘π‘œβ„Žπ‘π‘— 𝑍𝑣 and 𝐼𝑣𝑏 𝑋𝑣

Baidu – Natural Language Processing

slide-2
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
SLIDE 3

Context-Response Matching

π‘ž(𝑗𝑑_𝑕𝑝𝑝𝑒|𝑑, 𝑠)

Cont

  • ntext

xt 𝒅 Respons ponse 𝒔

slide-4
SLIDE 4

Cont

  • ntext

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
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
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
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
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
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
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
SLIDE 11

Motivation

Use GRU/LSTM to encode segments and match context with response only considering textual relevance.

Previ vious

  • us w

wor

  • rks

ks

  • Se

Self-Attent ntion

  • n: Using intra-attention of utterance/response to

gradually construct multi-grained semantic representations.

  • Cros
  • ss-Attent

ntion

  • n: Using attention across context and response to

match with dependency information.

Mot

  • tiva

vation

  • n
slide-12
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
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
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
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
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
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
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
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
SLIDE 20

Attentive Module

que query Attent ntion

  • n

Weight ghted d Sum um ke key va value ue Sum um & Nor

  • rm

Fe Feed-For

  • rward

Sum um & Nor

  • rm
  • Attent

ntive veModul

  • dule(Q,K

,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
SLIDE 21

Wor

  • rd

Embe beddi dding ng

𝒔 π’—πŸ 𝒗𝒐 𝒗𝒋

slide-22
SLIDE 22

Wor

  • rd

Embe beddi dding ng

Repr present ntation

  • n

Modul

  • dule

𝒔 π’—πŸ 𝒗𝒐 𝒗𝒋

Ui

R

Mul ulti-gr graine ned Repr present ntations

  • ns

=            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

  • rd-leve

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
SLIDE 23

Wor

  • rd

Embe beddi dding ng

Repr present ntation

  • n

Modul

  • dule

𝒔

Wor

  • rd-wor
  • rd

d Matchi hing ng with C h Cros

  • ss-Attent

ntion

  • n

π’—πŸ 𝒗𝒐 𝒗𝒋

Ui

R

Mul ulti-gr graine ned Repr present ntations

  • ns

Mui,r

self

Mui,r

cross

slide-24
SLIDE 24

Wor

  • rd

Embe beddi dding ng

Repr present ntation

  • n

Modul

  • dule

𝒔

Wor

  • rd-wor
  • rd

d Matchi hing ng with C h Cros

  • ss-Attent

ntion

  • n

π’—πŸ 𝒗𝒐 𝒗𝒋

Ui

R

Mul ulti-gr graine ned Repr present ntations

  • ns

Mui,r

self

Mui,r

cross Se Self lf-Attent ntion M

  • n Match

Mui,r,l

self = {Ul i[k]T Β· Rl[t]}nuiΓ—nr

Match w h with h text xtua ual i inf nfor

  • rmation
  • n
slide-25
SLIDE 25

Wor

  • rd

Embe beddi dding ng

Repr present ntation

  • n

Modul

  • dule

𝒔

Wor

  • rd-wor
  • rd

d Matchi hing ng with C h Cros

  • ss-Attent

ntion

  • n

π’—πŸ 𝒗𝒐 𝒗𝒋

Ui

R

Mul ulti-gr graine ned Repr present ntations

  • ns

Mui,r

self

Mui,r

cross Se Self lf-Attent ntion M

  • n Match

Cros

  • ss-Attent

ntion M

  • n Match

Mui,r,l

self = {Ul i[k]T Β· Rl[t]}nuiΓ—nr

Match w h with t h text xtua ual i inf nfor

  • rmation
  • n

Match w h with h de depe pende ndenc ncy i y inf nfor

  • rmation
  • n

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
SLIDE 26

Wor

  • rd

Embe beddi dding ng

Repr present ntation

  • n

Modul

  • dule

𝒔

Wor

  • rd-wor
  • rd

d Matchi hing ng with C h Cros

  • ss-Attent

ntion

  • n

π’—πŸ 𝒗𝒐 𝒗𝒋

Matchi hing ng Scor

  • re

g(c,r)

3D 3D M Matchi hing ng Image ge Q Q

Ui

R

Mul ulti-gr graine ned Repr present ntations

  • ns

Mui,r

self

Mui,r

cross

slide-27
SLIDE 27

Wor

  • rd

Embe beddi dding ng

Repr present ntation

  • n

Modul

  • dule

𝒔

Wor

  • rd-wor
  • rd

d Matchi hing ng with C h Cros

  • ss-Attent

ntion

  • n

π’—πŸ 𝒗𝒐 𝒗𝒋

Matchi hing ng Scor

  • re

g(c,r)

3D 3D M Matchi hing ng Image ge Q Q

Ui

R

Mul ulti-gr graine ned Repr present ntations

  • ns

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
SLIDE 28

Ubunt buntu Cor

  • rpus

pus V1 Douba

  • uban Conve
  • nversation
  • n

Cor

  • rpus

pus Tr Train De Dev Te Test Tr Train De Dev Te Test # c # cont

  • ntext

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

  • ntext

xt 2 10 10 10 10 2 2 10 10 # pos # positive ve c candi ndida dates pe per c cont

  • ntext

xt 1 1 1 1.18 1.18

  • Min. # t
  • n. # tur

urns ns pe per c cont

  • ntext

xt 3 3 3 3 Max.

  • x. # t

# tur urns ns pe per c cont

  • ntext

xt 19 19 98 98 91 91 45 45

  • Avg. # t
  • vg. # tur

urns ns pe per c cont

  • ntext

xt 7.71 7.71 6.69 6.69 6.75 6.75 6.45 6.45

  • Avg. #w
  • vg. #wor
  • rds

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
SLIDE 29

Experiment

  • DAM setup
  • Test stacking 3-7 self-attention layers
  • Comparison
  • Seque

quent ntial M Matchi hing N ng Networ

  • rk (

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
SLIDE 30

Evaluation Results

slide-31
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

  • n

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

  • n

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

  • n

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
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

  • n

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

  • n

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
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
SLIDE 34

Thanks

  • Code & Data: https://github.com/baidu/Dialogue/DAM
  • Our Authors