56
Question answering and machine comprehension with neural attention Minjoon Seo PhD Student Computer Science & Engineering University of Washington

Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

Questionansweringandmachinecomprehensionwith

neuralattentionMinjoonSeoPhDStudent

ComputerScience&EngineeringUniversityofWashington

Page 2: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

TwoEnd-to-EndQuestionAnsweringSystemswithNeuralAttention

• BidirectionalAttentionFlow(BiDAF)• OnStanfordQuestionAnsweringDatasetandCNN/DailyMail ClozeTest

• Query-ReductionNetworks(QRN)• OnbAbI QAanddialog, DSTC2 datasets

Page 3: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

TwoQuestionAnsweringSystemswithNeuralAttention

• BidirectionalAttentionFlow(BiDAF)• OnStanfordQuestionAnsweringDatasetandCNN/DailyMail ClozeTest

• Query-ReductionNetworks(QRN)• OnbAbI QAanddialogdatasets

Page 4: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

QuestionAnsweringTask(StanfordQuestionAnsweringDataset,2016)

Q:WhichNFLteamrepresentedtheAFCatSuperBowl50?

A:DenverBroncos

Page 5: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

WhyNeuralAttention?

Q:WhichNFLteamrepresentedtheAFCatSuperBowl50?

Allowsadeeplearningarchitecturetofocusonthemostrelevantphraseofthecontexttothequery

inadifferentiablemanner.

Page 6: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

OurModel:Bi-directionalAttentionFlow(BiDAF)

Attention

Modeling

MLP+softmax

𝑖" = 0 𝑖% = 1

BarakObamaisthepresidentoftheU.S. WholeadstheUnitedStates?

Attention

Page 7: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

(Bidirectional)AttentionFlow

Modeling Layer

Output Layer

Attention Flow Layer

Phrase Embed Layer

Word Embed Layer

x1 x2 x3 xT q1 qJ

LSTM

LSTM

LSTM

LSTM

Start End

h1 h2 hT

u1

u2

uJ

Softm

ax

h1 h2 hT

u1

u2

uJ

Max

Softmax

Context2Query

Query2Context

h1 h2 hT u1 uJ

LSTM + SoftmaxDense + Softmax

Context Query

Query2Context and Context2QueryAttention

WordEmbedding

GLOVE Char-CNN

Character Embed Layer

CharacterEmbedding

g1 g2 gT

m1 m2 mT

Page 8: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

Char/WordEmbeddingLayers

Modeling Layer

Output Layer

Attention Flow Layer

Phrase Embed Layer

Word Embed Layer

x1 x2 x3 xT q1 qJ

LSTM

LSTM

LSTM

LSTM

Start End

h1 h2 hT

u1

u2

uJ

Softm

ax

h1 h2 hT

u1

u2

uJ

Max

Softmax

Context2Query

Query2Context

h1 h2 hT u1 uJ

LSTM + SoftmaxDense + Softmax

Context Query

Query2Context and Context2QueryAttention

WordEmbedding

GLOVE Char-CNN

Character Embed Layer

CharacterEmbedding

g1 g2 gT

m1 m2 mT

Page 9: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

CharacterandWordEmbedding

• Wordembeddingisfragileagainstunseenwords• Charembeddingcan’teasilylearnsemanticsofwords• Useboth!

• CharembeddingasproposedbyKim(2015)

Seattle

SeattleCNN

+MaxPooling

concat

Embeddingvector

Page 10: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

PhraseEmbeddingLayer

Modeling Layer

Output Layer

Attention Flow Layer

Phrase Embed Layer

Word Embed Layer

x1 x2 x3 xT q1 qJ

LSTM

LSTM

LSTM

LSTM

Start End

h1 h2 hT

u1

u2

uJ

Softm

ax

h1 h2 hT

u1

u2

uJ

Max

Softmax

Context2Query

Query2Context

h1 h2 hT u1 uJ

LSTM + SoftmaxDense + Softmax

Context Query

Query2Context and Context2QueryAttention

WordEmbedding

GLOVE Char-CNN

Character Embed Layer

CharacterEmbedding

g1 g2 gT

m1 m2 mT

Page 11: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

PhraseEmbeddingLayer• Inputs:thechar/wordembeddingofqueryandcontextwords• Outputs:wordrepresentationsawareoftheirneighbors(phrase-awarewords)

• ApplybidirectionalRNN(LSTM)forbothqueryandcontext

Modeling Layer

Output Layer

Attention Flow Layer

Phrase Embed Layer

Word Embed Layer

x1 x2 x3 xT q1 qJ

LSTM

LSTM

LSTM

LSTM

Start End

h1 h2 hT

u1

u2

uJ

Softm

ax

h1 h2 hT

u1

u2

uJ

Max

Softmax

Context2Query

Query2Context

h1 h2 hT u1 uJ

LSTM + SoftmaxDense + Softmax

Context Query

Query2Context and Context2QueryAttention

WordEmbedding

GLOVE Char-CNN

Character Embed Layer

CharacterEmbedding

g1 g2 gT

m1 m2 mT

Context Query

Page 12: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

AttentionLayer

Modeling Layer

Output Layer

Attention Flow Layer

Phrase Embed Layer

Word Embed Layer

x1 x2 x3 xT q1 qJ

LSTM

LSTM

LSTM

LSTM

Start End

h1 h2 hT

u1

u2

uJ

Softm

ax

h1 h2 hT

u1

u2

uJ

Max

Softmax

Context2Query

Query2Context

h1 h2 hT u1 uJ

LSTM + SoftmaxDense + Softmax

Context Query

Query2Context and Context2QueryAttention

WordEmbedding

GLOVE Char-CNN

Character Embed Layer

CharacterEmbedding

g1 g2 gT

m1 m2 mT

Page 13: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

AttentionLayer

• Inputs:phrase-awarecontextandquerywords• Outputs:query-awarerepresentationsofcontextwords

• Context-to-queryattention:Foreach(phrase-aware)contextword,choosethemostrelevantwordfromthe(phrase-aware)querywords• Query-to-contextattention:Choosethecontextwordthatismostrelevanttoanyofquerywords.

Modeling Layer

Output Layer

Attention Flow Layer

Phrase Embed Layer

Word Embed Layer

x1 x2 x3 xT q1 qJ

LSTM

LSTM

LSTM

LSTM

Start End

h1 h2 hT

u1

u2

uJ

Softm

ax

h1 h2 hT

u1

u2

uJ

Max

Softmax

Context2Query

Query2Context

h1 h2 hT u1 uJ

LSTM + SoftmaxDense + Softmax

Context Query

Query2Context and Context2QueryAttention

WordEmbedding

GLOVE Char-CNN

Character Embed Layer

CharacterEmbedding

g1 g2 gT

m1 m2 mT

Page 14: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

Context-to-QueryAttention(C2Q)

Q:WholeadstheUnitedStates?

C:BarakObamaisthepresidentoftheUSA.

Foreachcontextword,findthemostrelevantqueryword.

Page 15: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

Query-to-ContextAttention(Q2C)

WhileSeattle’sweatherisveryniceinsummer,itsweatherisveryrainyinwinter,makingitoneofthemostgloomycitiesintheU.S.LAis…

Q:Whichcityisgloomyinwinter?

Page 16: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

ModelingLayer

Modeling Layer

Output Layer

Attention Flow Layer

Phrase Embed Layer

Word Embed Layer

x1 x2 x3 xT q1 qJ

LSTM

LSTM

LSTM

LSTM

Start End

h1 h2 hT

u1

u2

uJ

Softm

ax

h1 h2 hT

u1

u2

uJ

Max

Softmax

Context2Query

Query2Context

h1 h2 hT u1 uJ

LSTM + SoftmaxDense + Softmax

Context Query

Query2Context and Context2QueryAttention

WordEmbedding

GLOVE Char-CNN

Character Embed Layer

CharacterEmbedding

g1 g2 gT

m1 m2 mT

Page 17: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

ModelingLayer

• Attentionlayer:modelinginteractionsbetweenqueryandcontext• Modelinglayer:modelinginteractionswithin(query-aware)contextwordsviaRNN(LSTM)

• Divisionoflabor:letattentionandmodelinglayerssolelyfocusontheirowntasks• Weexperimentallyshowthatthisleadstoabetterresultthanintermixingattentionandmodeling

Page 18: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

OutputLayer

Modeling Layer

Output Layer

Attention Flow Layer

Phrase Embed Layer

Word Embed Layer

x1 x2 x3 xT q1 qJ

LSTM

LSTM

LSTM

LSTM

Start End

h1 h2 hT

u1

u2

uJ

Softm

ax

h1 h2 hT

u1

u2

uJ

Max

Softmax

Context2Query

Query2Context

h1 h2 hT u1 uJ

LSTM + SoftmaxDense + Softmax

Context Query

Query2Context and Context2QueryAttention

WordEmbedding

GLOVE Char-CNN

Character Embed Layer

CharacterEmbedding

g1 g2 gT

m1 m2 mT

Page 19: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

Training

• Minimizesthenegativelogprobabilitiesofthetruestartindexandthetrueendindex

𝑦() Trueendindexofexamplei

𝑦(* Truestartindexofexamplei

𝐩) Probabilitydistributionofstopindex

𝐩* Probabilitydistributionofstartindex

Page 20: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

Previouswork

• Usingneuralattentionasacontroller(Xiong etal.,2016)• UsingneuralattentionwithinRNN(Wang&Jiang,2016)• Mostoftheseattentionsareuni-directional

• BiDAF (ourmodel)• usesneuralattentionasalayer,• Isseparatedfrommodelingpart(RNN),• Isbidirectional

Page 21: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

VGG-16

Modeling Layer

Output Layer

Attention Flow Layer

Phrase Embed Layer

Word Embed Layer

x1 x2 x3 xT q1 qJ

LSTM

LSTM

LSTM

LSTM

Start End

h1 h2 hT

u1

u2

uJ

Softm

ax

h1 h2 hT

u1

u2

uJ

Max

Softmax

Context2Query

Query2Context

h1 h2 hT u1 uJ

LSTM + SoftmaxDense + Softmax

Context Query

Query2Context and Context2QueryAttention

WordEmbedding

GLOVE Char-CNN

Character Embed Layer

CharacterEmbedding

g1 g2 gT

m1 m2 mT

BiDAF (ours)

ImageClassifierandBiDAF

Page 22: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

StanfordQuestionAnsweringDataset(SQuAD)(Rajpurkar etal.,2016)

• MostpopulararticlesfromWikipedia• QuestionsandanswersfromTurkers• 90ktrain,10kdev,?test(hidden)• Answermustlieinthecontext• Twometrics:ExactMatch(EM)andF1

Page 23: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

SQuAD Results(http://stanford-qa.com)asof12pmToday

Page 24: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

SQuAD Results

1:Rajpurkar etal.(2016)2:Yuetal.(2016)3:Yangetal.(2016)4:Wang&Jiang(2016)6:Xiong etal.(2016)

EM F1Stanford1 (baseline) 40.4 51.0IBM2 62.5 71.0CMU3 62.5 73.3SingaporeManagement4 (ensemble) 67.9 77.0IBMResearch(ensemble) 68.2 77.2SalesforceResearch6 (ensemble) 71.6 80.4MicrosoftResearchAsia (ensemble) 72.1 79.7Ours (ensemble) 73.3 81.1

Page 25: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

50

55

60

65

70

75

80

NoCharEmbedding NoWordEmbedding NoC2QAttention NoQ2CAttention DynamicAttention FullModel

EM F1

Ablationsondevdata

Page 26: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

InteractiveDemo

http://allenai.github.io/bi-att-flow/demo

Page 27: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

AttentionVisualizations

There%are%13 natural%reserves%in%Warsaw%–among%others%,%Bielany Forest%,%KabatyWoods%,%Czerniaków Lake%.%About%15%kilometres (%9%miles%)%from%Warsaw%,%the%Vistula%river%'s%environment%changes%strikingly%and%features%a%perfectly%preserved%ecosystem%,%with%a%habitat%of%animals%that%includes%the%otter%,%beaver%and%hundreds%of%bird%species%.%There%are%also%several%lakes%in%Warsaw%– mainly%the%oxbow%lakes%,%like%Czerniaków Lake%,%the%lakes%in%the%Łazienkior%Wilanów Parks%,%Kamionek Lake%.%There%are%lot%of%small%lakes%in%the%parks%,%but%only%a%few%are%permanent%– the%majority%are%emptied%before%winter%to%clean%them%of%plants%and%sediments%.

Howmany

naturalreserves

arethere

inWarsaw

?

[]hundreds, few, among, 15, several, only, 13, 9natural, ofreservesare, are, are, are, are, includes[][]Warsaw, Warsaw, Warsawinter species

Where

did

Super

Bowl

50

take

place

?

Super%Bowl%50%was%an%American%football%game%to%determine%the%champion%of%the%National%Football%League%(%NFL%)%for%the%2015%season%.%The%American%Football%Conference%(%AFC%)%champion% Denver%Broncos%defeated%the%National%Football%Conference%(%NFC%)%champion%Carolina%Panthers%24–10%to%earn%their%third%Super%Bowl%title%.%The%game%was%played%on%February%7%,%2016%,%at%Levi%'s%Stadium%in%the%San%Francisco%Bay%Area%at%Santa%Clara%,%California .%As%this%was%the%50th%Super%Bowl%,%the%league%emphasized%the%"%golden%anniversary%"%with%various%goldZthemed%initiatives%,%as%well%as%temporarily%suspending%the%tradition%of%naming%each%Super%Bowl%game%with%Roman%numerals%(%under%which%the%game%would%have%been%known%as%"%Super%Bowl%L%"%)%,%so%that%the%logo%could%prominently%feature%the%Arabic%numerals%50%.

at, the, at, Stadium, Levi, in, Santa, Ana

[]

Super, Super, Super, Super, Super

Bowl, Bowl, Bowl, Bowl, Bowl

50

initiatives

Page 28: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

EmbeddingVisualizationatWordvsPhraseLayers

January

September

August

July

May

may

effect and may result in

the state may not aid

of these may be more

Opening in May 1852 at

debut on May 5 ,

from 28 January to 25

but by September had been

Page 29: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

Howdoesitcomparewithfeature-basedmodels?

Page 30: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

CNN/DailyMail ClozeTest(Hermannetal.,2015)

• ClozeTest(PredictingMissingwords)• ArticlesfromCNN/DailyMail• Human-writtensummaries• Missingwordsarealwaysentities• CNN– 300karticle-querypairs• DailyMail – 1Marticle-querypairs

Page 31: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

CNN/DailyMail ClozeTestResults

Page 32: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

SomelimitationsofSQuAD

Page 33: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

TwoQuestionAnsweringSystemswithNeuralAttention

• BidirectionalAttentionFlow(BiDAF)• OnStanfordQuestionAnsweringDatasetandCNN/DailyMail ClozeTest

• Query-ReductionNetworks(QRN)• OnbAbI QAanddialogdatasets

Page 34: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

ReasoningQuestionAnswering

Page 35: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

DialogSystem

U:CanyoubookatableinRomeinItalianCuisine

S:Howmanypeopleinyourparty?

U:Forfourpeopleplease.

S:Whatpricerangeareyoulookingfor?

Page 36: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

DialogtaskvsQA

• DialogsystemcanbeconsideredasQAsystem:• Lastuser’sutteranceisthequery• Allpreviousconversationsarecontexttothequery• Thesystem’snextresponseistheanswertothequery

• Posesafewuniquechallenges• Dialogsystemrequirestrackingstates• Dialogsystemneedstolookatmultiplesentencesintheconversation• Buildingend-to-enddialogsystemismorechallenging

Page 37: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

Ourapproach:Query-Reduction

<START>Sandragottheapplethere.Sandradroppedtheapple.Danieltooktheapplethere.Sandrawenttothehallway.Danieljourneyedtothegarden.

Q:Whereistheapple?

Reducedquery:

Whereistheapple?WhereisSandra?WhereisSandra?WhereisDaniel?WhereisDaniel?WhereisDaniel?à garden

A:garden

Page 38: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

Query-ReductionNetworks• Reducethequeryintoaneasier-to-answerqueryoverthesequenceofstate-changingtriggers(sentences),invectorspace

Sandragottheapplethere.

!"

!"

#""

#"$

%""

%"$

Where isSandra?

Sandradroppedtheapple

!$

!$

#$"

#$$

%""

%$$

Danieltooktheapplethere.

!&

!&

#&"

#&$

%""

%&$

Where isDaniel?

Sandrawenttothehallway.

!'

!'

#'"

#'$

%""

%'$

Where isDaniel?

Danieljourneyedtothegarden.

!(

!(

#("

#($

%""

%($ → *+

Where isDaniel?

Whereistheapple?

#

garden

Where isSandra?

∅ ∅ ∅ ∅

Page 39: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

QRNCell

𝛼 𝜌

1 − ×

× +

𝐱𝑡 𝐪𝑡

𝐡𝑡−1 𝐡𝑡

𝐳𝑡 𝐡𝑡

sentence query

reducedquery(hiddenstate)

updategatecandidatereducedquery

updatefunc reductionfunc

Page 40: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

CharacteristicsofQRN

• Updategatecanbeconsideredaslocalattention• QRNchoosestoconsider/ignoreeachcandidatereducedquery• Thedecisionismadelocally(asopposedtoglobalsoftmax attention)

• SubclassofRecurrentNeuralNetwork(RNN)• Twoinputs,hiddenstate,gatingmechanism• Abletohandlesequentialdependency(attentioncannot)

• Simplerrecurrentupdateenablesparallelization overtime• Candidatehiddenstate(reducedquery)iscomputedfrominputsonly• Hiddenstatecanbeexplicitlycomputedasafunctionofinputs

Page 41: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

Parallelizationcomputedfrominputsonly,socanbetriviallyparallelized

Canbeexplicitlyexpressedasthegeometricsumofpreviouscandidatehiddenstates

Page 42: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

Parallelization

Page 43: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

CharacteristicsofQRN

• Updategatecanbeconsideredaslocalattention• SubclassofRecurrentNeuralNetwork(RNN)• Simplerrecurrentupdateenablesparallelization overtime

QRNsitsbetweenneuralattentionmechanismandrecurrentneuralnetworks,takingtheadvantageofbothparadigms.

Page 44: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

bAbI QADataset

• 20 differenttasks• 1kstory-questionpairsforeachtask(10kalsoavailable)• Syntheticallygenerated• Manyquestionsrequirelookingatmultiplesentences• Forend-to-endsystemsupervisedbyanswersonly

Page 45: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

What’sdifferentfromSQuAD?

• Synthetic• Morethanlexical/syntacticunderstanding• Differentkindsofinferences• induction,deduction,counting,pathfinding,etc.

• Reasoningovermultiplesentences• InterestingtestbedtowardsdevelopingcomplexQAsystem(anddialogsystem)

Page 46: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

bAbI QAResults(1k)

0

10

20

30

40

50

60

LSTM DMN+ MemN2N GMemN2N QRN(Ours)

AvgError(%)

AvgError(%)

Page 47: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

bAbI QAResults(10k)

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

MemN2N DNC GMemN2N DMN+ QRN(Ours)

AvgError(%)

AvgError(%)

Page 48: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

DialogDatasets

• bAbI DialogDataset• Synthetic• 5differenttasks• 1kdialogsforeachtask

• DSTC2*Dataset• Realdataset• EvaluationmetricisdifferentfromoriginalDSTC2:responsegenerationinsteadof“state-tracking”• Eachdialogis800+utterances• 2407possibleresponses

Page 49: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

bAbI DialogResults(OOV)

0

5

10

15

20

25

30

35

MemN2N GMemN2N QRN(Ours)

AvgError(%)

AvgError(%)

Page 50: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

DSTC2*DialogResults

0

10

20

30

40

50

60

70

MemN2N GMemN2N QRN(Ours)

AvgError(%)

AvgError(%)

Page 51: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

bAbI QAVisualization

𝑧- = Localattention(updategate)atlayerl

Page 52: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

DSTC2(Dialog)Visualization

𝑧- = Localattention(updategate)atlayerl

Page 53: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

Conclusion

• PresentedtwonovelapproachesforQAtasksusingneuralattention

• BidirectionalAttentionFlow:usingattentionasalayer,onbothdirections(contexttoquery,querytocontext)• Query-reductionNetworks:asequentialmodelthattakesadvantageofbothattentionandRNNforreasoningovermultiplesentences

Page 54: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

Thanks!

Page 55: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

Whydoweneedattention?

• RNNhaslong-termdependencyproblem• Vanishinggradients(Pascanu etal.,2013)• Inherentlyunstableoveralongperiodoftime(Westonetal.,2016)

• Attentionprovidesshortcutaccesstorelevantinformation• Directlyretrievesthecontextvectorfromadistantlocation

• Criticaltomostmodernsequencemodels• Machinetranslation• Questionanswering,machinecomprehension

Page 56: Question answering and machine comprehension ... - Minjoon …Minjoon Seo PhD Student Computer Science & Engineering University of Washington. Two End -to-End Question Answering Systems

NeuralAttentioninSequenceModeling

(Bahdanau etal.,2015)

• ApplyRNNoncontextvectors• ApplyRNNonqueryvectors• Ateachtimestep,useneuralattentiontosoft-selectasinglecontextvector• Usetheselectedcontextvector,alongwithcurrentqueryvectorandcurrenthiddenstate,toobtainthenexthiddenstate