Gated Self-Matching Networks for Reading Comprehension and Question Answering
In this paper, we present the gated selfmatching networks for reading comprehension style question answering, which aims to answer questions from a given passage. We first match the question and passage with gated attention-based recurrent networks to obtain the question-aware passage representation. Then we propose a self-matching attention mechanism to refine the representation by matching the passage against itself, which effectively encodes information from the whole passage. We finally employ the pointer networks to locate the positions of answers from the passages. We conduct extensive experiments on the SQuAD dataset. The single model achieves 71.3% on the evaluation metrics of exact match on the hidden test set, while the ensemble model further boosts the results to 75.9%. At the time1 of submission of the paper, our model holds the first place on the SQuAD leaderboard for both single and ensemble model.
1 Introduction
In this paper, we focus on reading comprehension style question answering which aims to answer questions given a passage or document. We specifically focus on the Stanford Question Answering Dataset (SQuAD) (Rajpurkar et al., 2016), a largescale dataset for reading comprehension and question answering which is manually created through crowdsourcing. SQuAD constrains answers to the space of all possible spans within the reference passage, which is different from cloze-style reading comprehension datasets (Hermann et al.,
1On Feb. 6, 2017
2015; Hill et al., 2016) in which answers are single words or entities. Moreover, SQuAD requires different forms of logical reasoning to infer the answer (Rajpurkar et al., 2016).
Rapid progress has been made since the release of the SQuAD dataset. Wang and Jiang (2016b) build question-aware passage representation with match-LSTM (Wang and Jiang, 2016a), and predict answer boundaries in the passage with pointer networks (Vinyals et al., 2015). Seo et al. (2016) introduce bi-directional attention flow networks to model question-passage pairs at multiple levels of granularity. Xiong et al. (2016) propose dynamic co-attention networks which attend the question and passage simultaneously and iteratively refine answer predictions. Lee et al. (2016) and Yu et al. (2016) predict answers by ranking continuous text spans within passages.
Inspired by Wang and Jiang (2016b), we introduce a gated self-matching network, illustrated in Figure 1, an end-to-end neural network model for reading comprehension and question answering. Our model consists of four parts: 1) the recurrent network encoder to build representation for questions and passages separately, 2) the gated matching layer to match the question and passage, 3) the self-matching layer to aggregate information from the whole passage, and 4) the pointernetwork based answer boundary prediction layer. The key contributions of this work are three-fold.
First, we propose a gated attention-based recurrent network, which adds an additional gate to the attention-based recurrent networks (Bahdanau et al., 2014; Rocktäschel et al., 2015; Wang and Jiang, 2016a), to account for the fact that words in the passage are of different importance to answer a particular question for reading comprehension and question answering. In Wang and Jiang (2016a), words in a passage with their corresponding attention-weighted question context are en-
2
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
coded together to produce question-aware passage representation. By introducing a gating mechanism, our gated attention-based recurrent network assigns different levels of importance to passage parts depending on their relevance to the question, masking out irrelevant passage parts and emphasizing the important ones.
Second, we introduce a self-matching mechanism, which can effectively aggregate evidence from the whole passage to infer the answer. Through a gated matching layer, the resulting question-aware passage representation effectively encodes question information for each passage word. However, recurrent networks can only memorize limited passage context in practice despite its theoretical capability. One answer candidate is often unaware of the clues in other parts of the passage. To address this problem, we propose a self-matching layer to dynamically refine passage representation with information from the whole passage. Based on question-aware passage representation, we employ gated attention-based recurrent networks on passage against passage itself, aggregating evidence relevant to the current passage word from every word in the passage. A gated attention-based recurrent network layer and self-matching layer dynamically enrich each passage representation with information aggregated from both question and passage, enabling subsequent network to better predict answers.
Lastly, the proposed method yields state-of-theart results against strong baselines. Our single model achieves 71.3% exact match accuracy on the hidden SQuAD test set, while the ensemble model further boosts the result to 75.9%. At the time of submission of this paper, our model holds the first place on the SQuAD leader board.
2 Task Description
For reading comprehension style question answering, a passage P and question Q are given, our task is to predict an answer A to question Q based on information found in P. The SQuAD dataset further constrains answer A to be a continuous subspan of passage P. Answer A often includes nonentities and can be much longer phrases. This setup challenges us to understand and reason about both the question and passage in order to infer the answer. Table 1 shows a simple example from the SQuAD dataset.
Passage: Tesla later approached Morgan to ask for more funds to build a more powerful transmitter. When asked where all the money had gone, Tesla responded by saying that he was affected by the Panic of 1901, which he (Morgan) had caused. Morgan was shocked by the reminder of his part in the stock market crash and by Tesla’s breach of contract by asking for more funds. Tesla wrote another plea to Morgan, but it was also fruitless. Morgan still owed Tesla money on the original agreement, and Tesla had been facing foreclosure even before construction of the tower began. Question: On what did Tesla blame for the loss of the initial money? Answer: Panic of 1901
Table 1: An example from the SQuAD dataset.
3 Gated Self-Matching Networks
Figure 1 gives an overview of the gated selfmatching networks. First, the question and passage are processed by a bi-directional recurrent network (Mikolov et al., 2010) separately. We then match the question and passage with gated attention-based recurrent networks, obtaining question-aware representation for the passage. On top of that, we apply self-matching attention to aggregate evidence from the whole passage and refine the passage representation, which is then fed into the output layer to predict the boundary of the answer span.
3.1 Question and Passage Encoder
Consider a question Q = {wQt }mt=1 and a passage P = {wPt }nt=1. We first convert the words to their respective word-level embeddings ({eQt }mt=1 and {ePt }nt=1) and character-level embeddings ({cQt }mt=1 and {cPt }nt=1). The character-level embeddings are generated by taking the final hidden states of a bi-directional recurrent neural network (RNN) applied to embeddings of characters in the token. Such character-level embeddings have been shown to be helpful to deal with out-ofvocab (OOV) tokens. We then use a bi-directional RNN to produce new representation uQ1 , . . . , u Q m and uP1 , . . . , u P n of all words in the question and passage respectively:
uQt = BiRNNQ(u Q t−1, [e Q t , c Q t ]) (1) uPt = BiRNNP (u P t−1, [e P t , c P t ]) (2)
We choose to use Gated Recurrent Unit (GRU) (Cho et al., 2014) in our experiment since it performs similarly to LSTM (Hochreiter and Schmidhuber, 1997) but is computationally cheaper.
3
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
𝑢1 𝑄 𝑢2 𝑄 𝑢𝑚 𝑄
Question
Attention Question
Vector
𝑣1 𝑃 𝑣2 𝑃 𝑣3 𝑃
𝑢1 𝑃 𝑢2 𝑃 𝑢3 𝑃
Passage
𝑣1 𝑃 𝑣2 𝑃 𝑣3 𝑃 𝑣𝑛 𝑃
ℎ1 𝑃 ℎ2 𝑃 ℎ3 𝑃
Attention
ℎ1 𝑎 ℎ2 𝑎
Question and Passage GRU Layer
Question and Passage Matching Layer
Passage Self-Matching Layer
Output Layer Start End
𝑢𝑛 𝑃…
…𝑣𝑛 𝑃…
ℎ𝑛 𝑃…
When was tested The delay in
…
test……
𝑟𝑄
Figure 1: Gated Self-Matching Networks structure overview.
3.2 Gated Attention-based Recurrent Networks
We propose a gated attention-based recurrent network to incorporate question information into passage representation. It is a variant of attentionbased recurrent networks, with an additional gate to determine the importance of information in the passage regarding a question. Given question and passage representation {uQt }mt=1 and {uPt }nt=1, Rocktäschel et al. (2015) propose generating sentence-pair representation {vPt }nt=1 via soft-alignment of words in the question and passage as follows:
vPt = RNN(v P t−1, ct) (3)
where ct = att(uQ, [uPt , v P t−1]) is an attentionpooling vector of the whole question (uQ):
stj = v Ttanh(WQu u Q j + W P u u P t + W P v v P t−1)
ati = exp(s t i)/Σ m j=1exp(s t j)
ct = Σ m i=1a t iu Q i (4)
Each passage representation vPt dynamically incorporates aggregated matching information from the whole question.
Wang and Jiang (2016a) introduce matchLSTM, which takes uPt as an additional input into the recurrent network:
vPt = RNN(v P t−1, [u P t , ct]) (5)
To determine the importance of passage parts and attend to the ones relevant to the question, we add another gate to the input ([uPt , ct]) of RNN:
gt = sigmoid(Wg[u P t , ct])
[uPt , ct] ∗ = gt [uPt , ct] (6)
Different from the gates in LSTM or GRU, the additional gate is based on the current passage word and its attention-pooling vector of the question, which focuses on the relation between the question and current passage word. The gate effectively model the phenomenon that only parts of the passage are relevant to the question in reading comprehension and question answering. [uPt , ct] ∗ is utilized in subsequent calculations instead of [uPt , ct]. We call this gated attention-based recurrent networks. It can be applied to variants of RNN, such as GRU and LSTM. We also conduct experiments to show the effectiveness of the additional gate on both GRU and LSTM.
3.3 Self-Matching Attention
Through gated attention-based recurrent networks, question-aware passage representation {vPt }nt=1 is generated to pinpoint important parts in the passage. One problem with such representation is that it has very limited knowledge of context. One answer candidate is often oblivious to important
4
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
cues in the passage outside its surrounding window. Moreover, there exists some sort of lexical or syntactic divergence between the question and passage in the majority of SQuAD dataset (Rajpurkar et al., 2016). Passage context is necessary to infer the answer. To address this problem, we propose directly matching the question-aware passage representation against itself. It dynamically collects evidence from the whole passage for words in passage and encodes the evidence relevant to the current passage word and its matching question information into the passage representation hPt :
hPt = BiRNN(h P t−1, [v P t , ct]) (7)
where ct = att(vP , vPt ) is an attention-pooling vector of the whole passage (vP ):
stj = v Ttanh(WPv v P j + W P̃ v v P t )
ati = exp(s t i)/Σ n j=1exp(s t j)
ct = Σ n i=1a t iv P i (8)
An additional gate as in gated attention-based recurrent networks is applied to [vPt , ct] to adaptively control the input of RNN.
Self-matching extracts evidence from the whole passage according to the current passage word and question information.
3.4 Output Layer
We follow Wang and Jiang (2016b) and use pointer networks (Vinyals et al., 2015) to predict the start and end position of the answer. In addition, we use an attention-pooling over the question representation to generate the initial hidden vector for the pointer network. Given the passage representation {hPt }nt=1, the attention mechanism is utilized as a pointer to select the start position (p1) and end position (p2) from the passage, which can be formulated as follows:
stj = v Ttanh(WPh h P j + W a hh a t−1)
ati = exp(s t i)/Σ n j=1exp(s t j)
pt = arg max(at1, . . . , a t n) (9)
Here hat−1 represents the last hidden state of the answer recurrent network (pointer network). The input of the answer recurrent network is the attention-pooling vector based on current predicted probability at:
ct = Σ n i=1a t ih P i
hat = RNN(h a t−1, ct) (10)
When predicting the start position, hat−1 represents the initial hidden state of the answer recurrent network. We utilize the question vector rQ as the initial state of the answer recurrent network. rQ = att(uQ, V Qr ) is an attention-pooling vector of the question based on the parameter V Qr :
sj = v Ttanh(WQu u Q j + W Q v V Q r )
ai = exp(si)/Σ m j=1exp(sj)
rQ = Σmi=1aiu Q i (11)
To train the network, we minimize the sum of the negative log probabilities of the ground truth start and end position by the predicted distributions.
4 Experiment
4.1 Implementation Details
We specially focus on the SQuAD dataset to train and evaluate our model, which has garnered a huge attention over the past few months. SQuAD is composed of 100,000+ questions posed by crowd workers on 536 Wikipedia articles. The dataset is randomly partitioned into a training set (80%), a development set (10%), and a test set (10%). The answer to every question is a segment of the corresponding passage.
We use the tokenizer from Stanford CoreNLP (Manning et al., 2014) to preprocess each passage and question. The Gated Recurrent Unit (Cho et al., 2014) variant of LSTM is used throughout our model. For word embedding, we use pretrained case-sensitive GloVe embeddings2 (Pennington et al., 2014) for both questions and passages, and it is fixed during training; We use zero vectors to represent all out-of-vocab words. We utilize 1 layer of bi-directional GRU to compute character-level embeddings and 3 layers of bi-directional GRU to encode questions and passages, the gated attention-based recurrent network for question and passage matching is also encoded bidirectionally in our experiment. The hidden vector length is set to 75 for all layers. We also apply dropout (Srivastava et al., 2014) between layers with a dropout rate of 0.2. The model is optimized with AdaDelta (Zeiler, 2012) with an initial learning rate of 1.
2Downloaded from http://nlp.stanford.edu/ data/glove.840B.300d.zip.
5
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
Dev Set Test Set Single model EM / F1 EM / F1 LR Baseline (Rajpurkar et al., 2016) 40.0 / 51.0 40.4 / 51.0 Dynamic Chunk Reader (Yu et al., 2016) 62.5 / 71.2 62.5 / 71.0 Match-LSTM with Ans-Ptr (Wang and Jiang, 2016b) 64.1 / 73.9 64.7 / 73.7 Dynamic Coattention Networks (Xiong et al., 2016) 65.4 / 75.6 66.2 / 75.9 RaSoR (Lee et al., 2016) 66.4 / 74.9 - / - BiDAF (Seo et al., 2016) 68.0 / 77.3 68.0 / 77.3 jNet (USTC&National Research Council Canada&York University) - / - 68.7 / 77.4 Multi-Perspective Matching (Wang et al., 2016) - / - 68.9 / 77.8 Gated Self-Matching Networks 71.1 / 79.5 71.3 / 79.7 Ensemble model Fine-Grained Gating (Yang et al., 2016) 62.4 / 73.4 62.5 / 73.3 Match-LSTM with Ans-Ptr (Wang and Jiang, 2016b) 67.6 / 76.8 67.9 / 77.0 RaSoR (Lee et al., 2016) 68.2 / 76.7 - / - Dynamic Coattention Networks (Xiong et al., 2016) 70.3 / 79.4 71.6 / 80.4 BiDAF (Seo et al., 2016) 73.3 / 81.1 73.3 / 81.1 Multi-Perspective Matching (Wang et al., 2016) - / - 73.8 / 81.3 Gated Self-Matching Networks 75.6 / 82.8 75.9 / 82.9 Human Performance (Rajpurkar et al., 2016) 80.3 / 90.5 77.0 / 86.8 FastQA* (German Research Center for Artificial Intelligence) - / - 68.4 / 77.1 FastQAExt* (German Research Center for Artificial Intelligence) - / - 70.8 / 78.9
Table 2: The performance of our gated self-matching networks and competing approaches. * indicates that there is no explicit label to suggest whether the model is a single or ensemble model.
Single Model EM / F1 Gated Self-Matching (GRU) 71.1 / 79.5 -Character embedding 70.3 / 78.9 -Gating 67.9 / 77.1 -Self-Matching 66.9 / 76.4 -Gating, -Self-Matching 65.2 / 74.7
Table 3: Ablation tests of single model on the SQuAD dev set.
4.2 Main Results
Two metrics are utilized to evaluate model performance: Exact Match (EM) and F1 score. EM measures the percentage of the prediction that matches one of the ground truth answers exactly. F1 measures the overlap between the prediction and ground truth answers which takes the maximum F1 over all of the ground truth answers. The scores on dev set are evaluated by the official script3. Since the test set is hidden, we are required to submit the model to Stanford NLP group to obtain the test scores.
Table 2 shows exact match and F1 scores on the 3Downloaded from http://stanford-qa.com
dev and test set4 of our model and competing approaches. As we can see, our method clearly outperforms the baseline and several strong state-ofthe-art systems for both single model and ensembles.
4.3 Ablation Study
We do ablation tests on the dev set to analyze the contribution of components of gated self-matching networks. As illustrated in Table 3, the gated attention-based recurrent network (GARNN) and self-matching attention mechanism positively contribute to the final results of gated self-matching
4Extracted from SQuAD leaderboard http: //stanford-qa.com on Feb. 6, 2017.
6
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
Figure 2: Part of the attention matrices for self-matching. Each row is the attention weights of the whole passage for the current passage word. The darker the color is the higher the weight is. Some key evidence relevant to the question-passage tuple is more encoded into answer candidates.
networks. Removing self-matching results in 4.2 point EM drop, which reveals that information in the passage plays an important role. Characterlevel embeddings contribute towards the model’s performance since it can better handle out-ofvocab or rare words. To show the effectiveness of GARNN for variant RNNs, we conduct experiments on the base model (Wang and Jiang, 2016b) of different variant RNNs. The base model match the question and passage via a variant of attentionbased recurrent network (Wang and Jiang, 2016a), and employ pointer networks to predict the answer. Character-level embeddings are not utilized. As shown in Table 4, the gate introduced in question and passage matching layer is helpful for both GRU and LSTM on the SQuAD dataset.
5 Discussion
5.1 Encoding Evidence from Passage
To show the ability of the model for encoding evidence from the passage, we draw the alignment of the passage against itself in self-matching. The attention weights are shown in Figure 2, in which the darker the color is the higher the
weight is. We can see that key evidence aggregated from the whole passage is more encoded into the answer candidates. For example, the answer “Egg of Columbus” pays more attention to the key information “Tesla”, “device” and the lexical variation word “known” that are relevant to the question-passage tuple. The answer “world classic of epoch-making oratory” mainly focuses on the evidence “Michael Mullet”, “speech” and lexical variation word “considers”. For other words, the attention weights are more evenly distributed between evidence and some irrelevant parts. Selfmatching do adaptively aggregate evidence for words in passage.
5.2 Result Analysis
To further analyse the model’s performance, we show the exact match and F1 score for different question types (Figure 3(a)), different answer lengths (Figure 3(b)), different passage lengths (Figure 3(c)) and different question lengths (Figure 3(d)). As we can see, the type of “what” takes up a majority of questions. Our model is better at “when” and “who” questions, but poorly on “why”
7
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
(a) (b)
(c) (d)
Figure 3: Model performance on different question types (a), different answer lengths (b), different passage lengths (c), different question lengths (d). The point on the x-axis of figure (c) and (d) represent the datas whose passages length or questions length are between the value of current point and last point.
questions. From the Graph 3(b), the majority of answers are in short length. With the increase of answer length, the performance of our model obviously drops. Besides, the gap between exact match and F1 widens as answer length increases, which indicates our model could locate the core of the answer to some extent. From Graph 3(c) and 3(d), the majority of passages and questions are not too long. Moreover, we discover that the performance remains stable with the increase in length, the obvious drop in longer passage is mainly because the proportion is too small. Our model is largely agnostic to long passages and focuses on important part of the passage.
6 Related Work
Reading Comprehension and Question Answering Dataset Benchmark datasets play an important role in recent progress in reading comprehension and question answering research. Existing datasets can be classified into two categories according to whether they are manually labeled. Those that are labeled by humans are always in high quality (Richardson et al., 2013; Berant et al., 2014; Yang et al., 2015), but are too small for training modern data-intensive models. Those that
are automatically generated from natural occurring data can be very large (Hill et al., 2016; Hermann et al., 2015), which allow the training of more expressive models. However, they are in cloze style, in which the goal is to predict the missing word (often a named entity) in a passage. Moreover, Chen et al. (2016) have shown that the CNN / Daily News dataset (Hermann et al., 2015) requires less reasoning than previously thought, and conclude that performance is almost saturated.
Different from above datasets, the SQuAD provides a large and high-quality dataset. The answers in SQuAD often include non-entities and can be much longer phrase, which is more challenging than cloze-style datasets. Moreover, Rajpurkar et al. (2016) show that the dataset retains a diverse set of answers and requires different forms of logical reasoning, including multi-sentence reasoning. MS MARCO (Nguyen et al., 2016) is also a large-scale dataset. The questions in the dataset are real anonymized queries issued through Bing or Cortana and the passages are related web pages. For each question in the dataset, several related passages are provided. However, the answers are human generated, which is different from SQuAD where answers must be a span of the passage.
8
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
End-to-end Neural Networks for Reading Comprehension Along with cloze-style datasets, several powerful deep learning models (Hermann et al., 2015; Hill et al., 2016; Chen et al., 2016; Kadlec et al., 2016; Sordoni et al., 2016; Cui et al., 2016; Trischler et al., 2016; Dhingra et al., 2016; Shen et al., 2016) have been introduced to solve this problem. Hermann et al. (2015) first introduce attention mechanism into reading comprehension. Hill et al. (2016) propose a windowbased memory network for CBT dataset. Kadlec et al. (2016) introduce pointer networks with one attention step to predict the blanking out entities. Sordoni et al. (2016) propose an iterative alternating attention mechanism to better model the links between question and passage. Trischler et al. (2016) solve cloze-style question answering task by combining an attentive model with a reranking model. Dhingra et al. (2016) propose iteratively selecting important parts of the passage by a multiplying gating function with the question representation. Cui et al. (2016) propose a two-way attention mechanism to encode the passage and question mutually. Shen et al. (2016) propose iteratively inferring the answer with a dynamic number of reasoning steps and is trained with reinforcement learning.
Neural network-based models demonstrate the effectiveness on the SQuAD dataset. Wang and Jiang (2016b) combine match-LSTM and pointer networks to produce the boundary of the answer. Xiong et al. (2016) and Seo et al. (2016) employ variant coattention mechanism to match the question and passage mutually. Xiong et al. (2016) propose a dynamic pointer network to iteratively infer the answer. Yu et al. (2016) and Lee et al. (2016) solve SQuAD by ranking continuous text spans within passage. Yang et al. (2016) present a fine-grained gating mechanism to dynamically combine word-level and character-level representation and model the interaction between questions and passages. Wang et al. (2016) propose matching the context of passage with the question from multiple perspectives.
Different from the above models, we introduce self-matching attention in our model. It dynamically refines the passage representation by looking over the whole passage and aggregating evidence relevant to the current passage word and question, allowing our model make full use of passage information. Weightedly attending to word context
has been proposed in several works. Ling et al. (2015) propose considering window-based contextual words differently depending on the word and its relative position. Cheng et al. (2016) propose a novel LSTM network to encode words in a sentence which considers the relation between the current token being processed and its past tokens in the memory. Parikh et al. (2016) apply this method to encode words in a sentence according to word form and its distance. Since passage information relevant to question is more helpful to infer the answer in reading comprehension, we apply self-matching based on question-aware representation and gated attention-based recurrent networks. It helps our model mainly focus on question-relevant evidence in the passage and dynamically look over the whole passage to aggregate evidence.
Another key component of our model is the attention-based recurrent network, which has demonstrated success in a wide range of tasks. Bahdanau et al. (2014) first propose attentionbased recurrent networks to infer word-level alignment when generating the target word. Hermann et al. (2015) introduce word-level attention into reading comprehension to model the interaction between questions and passages. Rocktäschel et al. (2015) and Wang and Jiang (2016a) propose determining entailment via word-by-word matching. The gated attention-based recurrent network is a variant of attention-based recurrent network with an additional gate to model the fact that passage parts are of different importance to the particular question for reading comprehension and question answering.
7 Conclusion
In this paper, we present gated self-matching networks for reading comprehension and question answering. We introduce the gated attentionbased recurrent networks and self-matching attention mechanism to obtain representation for the question and passage, and then use the pointernetworks to locate answer boundaries. Our model achieves state-of-the-art results on the SQuAD dataset, outperforming several strong competing systems. As for future work, we are applying the gated self-matching networks to other reading comprehension and question answering datasets, such as the MS MARCO dataset (Nguyen et al., 2016).
9
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
This paper presents the gated self-matching network for reading comprehension style question answering. There are three key components in the solution:   (a) The paper introduces the gated attention-based recurrent network to obtain the question-aware representation for the passage. Here, the paper adds an additional gate to attention-based recurrent networks to determine the importance of passage parts and attend to the ones relevant to the question. Here they use word as well as character embeddings to handle OOV words. Overall, this component is inspired from Wang and Jiang 2016.  (b) Then the paper proposes a self-matching attention mechanism to improve the representation for the question and passage by looking at wider passage context necessary to infer the answer. This component is completely novel in the paper.  (c) At the output layer, the paper uses pointer networks to locate answer boundaries. This is also inspired from Wang and Jiang 2016  Overall, I like the paper and think that it makes a nice contribution.  - Strengths:  The paper clearly breaks the network into three component for descriptive purposes, relates each of them to prior work and mentions its novelties with respect to them. It does a sound empirical analysis by describing the impact of each component by doing an ablation study. This is appreciated.  The results are impressive!  - Weaknesses:  The paper describes the results on a single model and an ensemble model. I could not find any details of the ensemble and how was it created. I believe it might be the ensemble of the character based and word based model. Can the authors please describe this in the rebuttal and the paper.  - General Discussion:  Along with the ablation study, it would be nice if we can have a qualitative analysis describing some example cases where the components of gating, character embedding, self embedding, etc. become crucial ... where a simple model doesn't get the question right but adding one or more of these components helps. This can go in some form of appendix or supplementary.