id
stringlengths
12
15
title
stringlengths
8
162
content
stringlengths
1
17.6k
prechunk_id
stringlengths
0
15
postchunk_id
stringlengths
0
15
arxiv_id
stringlengths
10
10
references
listlengths
1
1
1609.08675#38
YouTube-8M: A Large-Scale Video Classification Benchmark
where â ¨ is logical OR. Precision at equal recall rate (PERR): We measure the video- level annotation precision when we retrieve the same number of entities per video as there are in the ground-truth. With the same notation as for Hit@k, PERR can be written as: 1 1 , WGa>0. S Ga S I(ranky,c < |Go|) | - vEV:|Gy|>0 eâ ¬Gy # 5.2 Results on YouTube-8M Table 3 shows results for all approaches on the YouTube-8M dataset. Frame-level models (row 1), trained on the strong Incep- tion features and logistic regression, followed by simple averaging of predictions across all frames, perform poorly on this dataset. This shows that the video-level prediction task cannot be reduced to simple frame-level classiï¬
1609.08675#37
1609.08675#39
1609.08675
[ "1502.07209" ]
1609.08675#39
YouTube-8M: A Large-Scale Video Classification Benchmark
cation. Aggregating the frame-level features at the video-level using sim- ple mean pooling of frame-level features, followed by a hinge loss or logistic regression model, provides a non-trivial improvement in video level accuracies over naive averaging of the frame-level predictions. Further improvements are observed by using mixture- of-experts models and by adding other statistics, like the standard deviation and ordinal features, computed over the frame-level fea- tures. Note that the standard deviation and ordinal statistics are more meaningful in the original RELU activation space so we re- construct the RELU features from the PCA-ed and quantized fea- tures by inverting the quantization and the PCA using the provided PCA matrix, computing the collection statistics over the recon- structed frame-level RELU features, and then re-applying PCA, whitening, and L2 normalization as described in Section 4.2.2. This simple task-independent feature pooling and normalization strategy yields some of the most competitive results on this dataset. Finally, we also evaluate two deep network architectures that have produced state-of-art results on previous benchmarks [26]. The DBoF architecture ignores sequence information and treats the input video as a bag of frames whereas LSTMs use state informa- tion to preserve the video sequence. The DBoF approach with a logistic classiï¬ cation layer produces 2% (absolute) gains in Hit@1 and PERR metrics over using simple mean feature pooling and a single-layer logistic model, which shows the beneï¬ ts of discrim- intatively training a projection layer to obtain a task-speciï¬ c video- level representation. The mAP results for DBoF are slightly worse than mean pooling + logistic model, which we attribute to slower training and convergence of DBoF on rare classes (mAP is strongly affected by results on rare classes and the joint class training of DBoF is a disadvantage for those classes). The LSTM network generally performs best, except for mAP, where the 1-vs-all binary MoE classiï¬ ers perform better, likely for the same reasons of slower convergence on rare classes. LSTM does improve on Hit@1 and PERR metrics, as expected given its ability to learn long-term correlations in the time domain. Also, in [26], the authors used data augmentation by sampling multi- ple snippets of ï¬
1609.08675#38
1609.08675#40
1609.08675
[ "1502.07209" ]
1609.08675#40
YouTube-8M: A Large-Scale Video Classification Benchmark
xed length from a video and averaged the results, which could produce even better accuracies than our current results. We also considered Fisher vectors and VLAD given their recent success in aggregating CNN features at the video-level in [39]. However, for the same dimensionality as the video-level represen- tations of the LSTM, DBoF and mean features, they did not pro- duce competitive results. # 5.2.1 Human Rated Test Set We also report results on the human rated test set of over 8000 videos (see Section 3.5) in Table 4 for the top three approaches. We report PERR, Hit@1, and Hit@5, since the mAP is not reliable given the size of the test set. The Hit@1 numbers are uniformly higher for all approaches when compared to the incomplete valida- tion set in Table 3 whereas the PERR numbers are uniformly lower. This is largely attributable to the missing labels in the validation set (recall of the Validation set labels is around 15% compared to ex- haustive human ratings). However, the relative ordering of the var- ious approaches is fairly consistent between the two sets, showing that the validation set results are still reliable enough to compare different approaches.
1609.08675#39
1609.08675#41
1609.08675
[ "1502.07209" ]
1609.08675#41
YouTube-8M: A Large-Scale Video Classification Benchmark
# 5.3 Results on Sports-1M Next, we investigate generalization of the video-level features learned using the YouTube-8M dataset and perform transfer learn- ing experiments on the Sports-1M dataset. The Sports-1M dataset [19] consists of 487 sports activities with 1.2 million YouTube videos and is one of the largest benchmarks available for sports/activity recognition. We use the ï¬ rst 360 seconds of a video sampled at 1 frame per second for all experiments. To evaluate transfer learning on this dataset, in one experiment we simply use the aggregated video-level descriptors, based on the PCA matrix learned on the YouTube-8M dataset, and train MoE or Approach Logistic Regression (µ) (4.3) Mixture-of-2-Experts (µ) (4.3) Mixture-of-2-Experts ([µ; Ï ; Top5]) (4.2.1) LSTM (4.1.3) +Pretrained on YT-8M (4.1.3) Hierarchical 3D Convolutions [19] Stacked 3D Convolutions [35] LSTM with Optical Flow and Pixels [26] mAP Hit@1 Hit@5 79.6 60.1 58.0 80.4 61.5 59.1 82.6 63.2 61.3 85.6 64.9 66.7 86.2 65.7 67.6 80.0 61.0 - 85.0 61.0 - 91.0 73.0 - Approach Mixture-of-2-Experts (µ) (4.3) +Pretrained PCA on YT-8M Mixture-of-2-Experts ([µ; Ï
1609.08675#40
1609.08675#42
1609.08675
[ "1502.07209" ]
1609.08675#42
YouTube-8M: A Large-Scale Video Classification Benchmark
; Top5]) (4.2.1) +Pretrained PCA on YT-8M LSTM (4.1.3) +Pretrained on YT-8M (4.1.3) Ma, Bargal et al.[24] Heilbron et al.[12] mAP Hit@1 Hit@5 85.4 68.7 69.1 89.3 72.5 74.1 72.3 74.2 NO 91.6 74.9 77.6 81.0 63.4 57.9 92.4 74.2 75.6 - - 53.8 - - 43.0 89.6 (a) Sports-1M: Our learned features are competitive on this dataset beating all but the approach of [26], which learned directly from the video pixels. Both [26] and [35] included motion features.
1609.08675#41
1609.08675#43
1609.08675
[ "1502.07209" ]
1609.08675#43
YouTube-8M: A Large-Scale Video Classification Benchmark
(b) ActivityNet: Since the dataset is small, we see a substantial boost in performance by pre-training on YouTube-8M or using the transfer learnt PCA versus the one learnt from scratch on ActivityNet. Table 5: Results of transferring video representations learned on the YouTube-8M dataset to the (a) Sports-1M and (b) ActivityNet. logistic models on top using target domain training data. For the LSTM networks, we have two scenarios: 1) we use the PCA transformed features and learn a LSTM model from scratch using these features; or 2) we use the LSTM layers pre-trained on the YouTube-8M task, and ï¬ ne-tune them on the Sports-1M dataset (along with a new softmax classiï¬
1609.08675#42
1609.08675#44
1609.08675
[ "1502.07209" ]
1609.08675#44
YouTube-8M: A Large-Scale Video Classification Benchmark
er). Table 5a shows the evaluation metrics for the various video-level representations on the Sports-1M dataset. Our learned features are competitive on this dataset, with the best approach beating all but the approach of [26], which learned directly from the pixels of the videos in the Sports-1M dataset, including optical ï¬ ow, and made use of data augmentation strategies and multiple inferences over several video segments. We also show that even on such a large dataset (1M videos), pre-training on YouTube-8M still helps, and improves the LSTM performance by â ¼1% on all metrics (vs. no pre-training). # 5.4 Results on ActivityNet
1609.08675#43
1609.08675#45
1609.08675
[ "1502.07209" ]
1609.08675#45
YouTube-8M: A Large-Scale Video Classification Benchmark
Our ï¬ nal set of experiments demonstrate the generality of our learned features for the ActivityNet untrimmed video classiï¬ cation task. Similar to Sports-1M experiments, we compare directly train- ing on the ActivityNet dataset against pre-training on YouTube-8M for aggregation based and LSTM approaches. As seen in Table 5b, all of the transferred features are much better in terms of all metrics than training on ActivityNet alone. Notably, without the use of mo- tion information, our best feature is better by up to 80% than the HOG, HOF, MBH, FC-6, FC-7 features used in [12]. This result shows that features learned on YouTube-8M generalize very well to other datasets/tasks. We believe this is because of the diversity and scale of the videos present in YouTube-8M. will prove to be a test bed for developing novel video representation learning algorithms, and especially approaches that deal effectively with noisy or incomplete labels. As a side effect, we also provide one of the largest and most diverse public visual annotation vocabularies (consisting of 4800 visual Knowledge Graph entities), constructed from popularity sig- nals on YouTube as well as manual curation, and organized into 24 top-level categories. We provide extensive experiments comparing several strong base- lines for video representation learning, including Deep Networks and LSTMs, on this dataset.
1609.08675#44
1609.08675#46
1609.08675
[ "1502.07209" ]
1609.08675#46
YouTube-8M: A Large-Scale Video Classification Benchmark
We demonstrate the efï¬ cacy of using a fairly unexplored class of models (mixture-of-experts) and show that they can outperform popular classiï¬ ers like logistic regression and SVMs. This is particularly true for our large dataset where many classes can be multi-modal. We explore various video-level representations using simple statistics extracted from the frame- level features and model the probability of an entity given the ag- gregated vector as an MoE. We show that this yields competitive performance compared to more complex approaches (that directly use frame-level information) such as LSTM and DBoF. This also demonstrates that if the underlying frame-level features are strong, the need for more sophisticated video-level modeling techniques is reduced. Finally, we illustrate the usefulness of the dataset by perform- ing transfer learning experiments on existing video benchmarksâ
1609.08675#45
1609.08675#47
1609.08675
[ "1502.07209" ]
1609.08675#47
YouTube-8M: A Large-Scale Video Classification Benchmark
Sports-1M and ActivityNet. Our experiments show that features learned on this dataset generalize well on these benchmarks, in- cluding setting a new state-of-the-art on ActivityNet. # 6. CONCLUSIONS In this paper, we introduce YouTube-8M, a large-scale video benchmark for video classiï¬ cation and representation learning. With YouTube-8M, our goal is to advance the ï¬ eld of video understand- ing, similarly to what large-scale image datasets have done for im- age understanding. Speciï¬ cally, we address the two main chal- lenges with large-scale video understandingâ (1) collecting a large labeled video dataset, with reasonable quality labels, and (2) re- moving computational barriers by pre-processing the dataset and providing state-of-the-art frame-level features to build from. We process over 50 years worth of video, and provide features for nearly 2 billion frames from more than 8 million videos, which enables training a reasonable model at this scale within 1 day, us- ing an open source framework on a single machine! We expect this dataset to level the playing ï¬ eld for academia researchers, bridge the gap with large-scale labeled video datasets, and signiï¬ cantly accelerate research on video understanding. We hope this dataset
1609.08675#46
1609.08675#48
1609.08675
[ "1502.07209" ]
1609.08675#48
YouTube-8M: A Large-Scale Video Classification Benchmark
7. REFERENCES [1] Freebase: A community-curated database of well-known people, places, and things. https://www.freebase.com. [2] Google I/O 2013 - semantic video annotations in the Youtube Topics API: Theory and applications. https://www.youtube.com/watch?v=wf_77z1H-vQ. [3] Knowledge Graph Search API. https://developers.google.com/knowledge-graph/. [4] Tensorï¬ ow: Image recognition. https://www.tensorï¬ ow.org/tutorials/image_recognition. [5] M.
1609.08675#47
1609.08675#49
1609.08675
[ "1502.07209" ]
1609.08675#49
YouTube-8M: A Large-Scale Video Classification Benchmark
Blank, L. Gorelick, E. Shechtman, M. Irani, and R. Basri. 5] M. Blank, L. Gorelick, E. Shechtman, M. Irani, and R. Basri. Actions as space-time shapes. In Proceedings of the International Conference on Computer Vision (ICCV), 2005. Actions as space-time shapes. In Proceedings of the International Conference on Computer Vision (ICCV), 2005. [6] J.
1609.08675#48
1609.08675#50
1609.08675
[ "1502.07209" ]
1609.08675#50
YouTube-8M: A Large-Scale Video Classification Benchmark
Deng, W. Dong, R. Socher, L. jia Li, K. Li, and L. Fei-fei. Imagenet: A large-scale hierarchical image database. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2009. [7] M. Everingham, L. V. Gool, C. K. I. Williams, J. Winn, and A. Zisserman. The pascal visual object classes (voc) challenge, 2009. [8] L. Fei-fei, R. Fergus, and P. Perona.
1609.08675#49
1609.08675#51
1609.08675
[ "1502.07209" ]
1609.08675#51
YouTube-8M: A Large-Scale Video Classification Benchmark
One-shot learning of object categories. IEEE Transactions on Pattern Analysis and Machine Intelligence, 28, 2006. [9] R. Girshick. Fast R-CNN. In Proceedings of the International Conference on Computer Vision (ICCV), 2015. [10] G. Grifï¬ n, A. Holub, and P. Perona. Caltech-256 object category dataset. Technical Report 7694, California Institute of Technology, 2007. [11] K. He, X. Zhang, S. Ren, and J. Sun.
1609.08675#50
1609.08675#52
1609.08675
[ "1502.07209" ]
1609.08675#52
YouTube-8M: A Large-Scale Video Classification Benchmark
Deep residual learning for image recognition. CoRR, abs/1512.03385, 2015. [12] F. C. Heilbron, V. Escorcia, B. Ghanem, and J. C. Niebles. Activitynet: A large-scale video benchmark for human activity understanding. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 961â 970, 2015. [13] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural Computing, 9(8), Nov. 1997. [14] S. Ioffe and C. Szegedy.
1609.08675#51
1609.08675#53
1609.08675
[ "1502.07209" ]
1609.08675#53
YouTube-8M: A Large-Scale Video Classification Benchmark
Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of the International Conference on Machine Learning (ICML), pages 448â 456, 2015. [15] H. Jegou, F. Perronnin, M. Douze, J. Sanchez, P. Perez, and C. Schmid. Aggregating local image descriptors into compact codes. IEEE Trans. Pattern Anal. Mach. Intell., 34(9), Sept. 2012. [16] Y. Jiang, J. Liu, A. Roshan Zamir, G. Toderici, I. Laptev, M. Shah, and R. Sukthankar.
1609.08675#52
1609.08675#54
1609.08675
[ "1502.07209" ]
1609.08675#54
YouTube-8M: A Large-Scale Video Classification Benchmark
THUMOS challenge: Action recognition with a large number of classes. http://crcv.ucf.edu/THUMOS14, 2014. [17] Y.-G. Jiang, Z. Wu, J. Wang, X. Xue, and S.-F. Chang. Exploiting feature and class relationships in video categorization with regularized deep neural networks. arXiv preprint arXiv:1502.07209, 2015. [18] M. I. Jordan.
1609.08675#53
1609.08675#55
1609.08675
[ "1502.07209" ]
1609.08675#55
YouTube-8M: A Large-Scale Video Classification Benchmark
Hierarchical mixtures of experts and the em algorithm. Neural Computation, 6, 1994. [19] A. Karpathy, G. Toderici, S. Shetty, T. Leung, R. Sukthankar, and L. Fei-Fei. Large-scale video classiï¬ cation with convolutional neural networks. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1725â 1732, Columbus, Ohio, USA, 2014.
1609.08675#54
1609.08675#56
1609.08675
[ "1502.07209" ]
1609.08675#56
YouTube-8M: A Large-Scale Video Classification Benchmark
[20] A. Krizhevsky, I. Sutskever, and G. E. Hinton. ImageNet classiï¬ cation with deep convolutional neural networks. In Advances in Neural Information Processing Systems (NIPS), pages 1097â 1105, 2012. [21] H. Kuehne, H. Jhuang, E. Garrote, T. Poggio, and T. Serre. Hmdb: a large video database for human motion recognition. In Proceedings of the International Conference on Computer Vision (ICCV), 2011. [22] I. Laptev and T. Lindeberg. Space-time interest points. In Proceedings of the International Conference on Computer Vision (ICCV), 2003. [23] I. Laptev, M. Marszalek, C. Schmid, and B. Rozenfeld.
1609.08675#55
1609.08675#57
1609.08675
[ "1502.07209" ]
1609.08675#57
YouTube-8M: A Large-Scale Video Classification Benchmark
Learning realistic human actions from movies. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2008. [24] S. Ma, S. A. Bargal, J. Zhang, L. Sigal, and S. Sclaroff. Do less and achieve more: Training cnns for action recognition utilizing action images from the web. CoRR, abs/1512.07155, 2015. [25] V. Mnih and G. Hinton.
1609.08675#56
1609.08675#58
1609.08675
[ "1502.07209" ]
1609.08675#58
YouTube-8M: A Large-Scale Video Classification Benchmark
Learning to label aerial images from noisy data. In Proceedings of the 29th Annual International Conference on Machine Learning (ICML), June 2012. [26] J. Y.-H. Ng, M. J. Hausknecht, S. Vijayanarasimhan, O. Vinyals, R. Monga, and G. Toderici. Beyond short snippets: Deep networks for video classiï¬ cation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 4694â 4702, 2015. [27] F. Perronnin and C.
1609.08675#57
1609.08675#59
1609.08675
[ "1502.07209" ]
1609.08675#59
YouTube-8M: A Large-Scale Video Classification Benchmark
Dance. Fisher kernels on visual vocabularies for image categorization. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2007. [28] A. Quattoni and A. Torralba. Recognizing indoor scenes. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2009. [29] S. Reed, H. Lee, D. Anguelov, C. Szegedy, D. Erhan, and A. Rabinovich.
1609.08675#58
1609.08675#60
1609.08675
[ "1502.07209" ]
1609.08675#60
YouTube-8M: A Large-Scale Video Classification Benchmark
Training deep neural networks on noisy labels with bootstrapping. ArXiv e-prints, Dec. 2014. [30] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. C. Berg, and L. Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115(3):211â 252, 2015. [31] P. Sermanet, D. Eigen, X. Zhang, M. Mathieu, R. Fergus, and Y. LeCun.
1609.08675#59
1609.08675#61
1609.08675
[ "1502.07209" ]
1609.08675#61
YouTube-8M: A Large-Scale Video Classification Benchmark
Overfeat: Integrated recognition, localization and detection using convolutional networks. In International Conference on Learning Representations (ICLR). [32] J. Shotton, J. Winn, C. Rother, and A. Criminisi. Textonboost: Joint appearance, shape and context modeling for multi-class object. In Proceedings of the European Conference on Computer Vision (ECCV), 2006. [33] K. Soomro, A. R. Zamir, and M. Shah.
1609.08675#60
1609.08675#62
1609.08675
[ "1502.07209" ]
1609.08675#62
YouTube-8M: A Large-Scale Video Classification Benchmark
UCF101: A dataset of 101 human actions classes from videos in the wild. In CRCV-TR-12-01, 2012. [34] B. Thomee, D. A. Shamma, G. Friedland, B. Elizalde, K. Ni, D. Poland, D. Borth, and L. Li. The new data and new challenges in multimedia research. CoRR, abs/1503.01817, 2015. [35] D. Tran, L. D. Bourdev, R. Fergus, L. Torresani, and M.
1609.08675#61
1609.08675#63
1609.08675
[ "1502.07209" ]
1609.08675#63
YouTube-8M: A Large-Scale Video Classification Benchmark
Paluri. C3D: generic features for video analysis. CoRR, abs/1412.0767, 2014. [36] H. Wang, M. M. Ullah, A. Kläser, I. Laptev, and C. Schmid. Evaluation of local spatio-temporal features for action recognition. In Proc. BMVC, 2009. [37] S. Wiesler, A. Richard, R. Schlüter, and H.
1609.08675#62
1609.08675#64
1609.08675
[ "1502.07209" ]
1609.08675#64
YouTube-8M: A Large-Scale Video Classification Benchmark
Ney. Mean-normalized stochastic gradient for large-scale deep learning. In IEEE International Conference on Acoustics, Speech and Signal Processing, ICASSP 2014, Florence, Italy, May 4-9, 2014, pages 180â 184. IEEE, 2014. [38] J. Xiao, K. A. Ehinger, J. Hays, A. Torralba, A. Oliva, and J. Xiao. Sun database:
1609.08675#63
1609.08675#65
1609.08675
[ "1502.07209" ]
1609.08675#65
YouTube-8M: A Large-Scale Video Classification Benchmark
Exploring a large collection of scene categories, 2013. [39] Z. Xu, Y. Yang, and A. G. Hauptmann. A discriminative cnn video representation for event detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015. [40] H.-F. Yu, P. Jain, P. Kar, and I. Dhillon. Large-scale multi-label learning with missing labels. In Proceedings of The 31st International Conference on Machine Learning (ICML), pages 593â
1609.08675#64
1609.08675#66
1609.08675
[ "1502.07209" ]
1609.08675#66
YouTube-8M: A Large-Scale Video Classification Benchmark
601, 2014. [41] M. D. Zeiler and R. Fergus. Visualizing and understanding convolutional networks. CoRR, abs/1311.2901, 2013.
1609.08675#65
1609.08675
[ "1502.07209" ]
1609.07843#0
Pointer Sentinel Mixture Models
6 1 0 2 p e S 6 2 ] L C . s c [ 1 v 3 4 8 7 0 . 9 0 6 1 : v i X r a # Pointer Sentinel Mixture Models Stephen Merity Caiming Xiong James Bradbury Richard Socher MetaMind - A Salesforce Company, Palo Alto, CA, USA [email protected] [email protected] [email protected] [email protected]
1609.07843#1
1609.07843
[ "1607.03474" ]
1609.07843#1
Pointer Sentinel Mixture Models
Abstract Recent neural network sequence models with softmax classiï¬ ers have achieved their best lan- guage modeling performance only with very large hidden states and large vocabularies. Even then they struggle to predict rare or unseen words even if the context makes the prediction un- ambiguous. We introduce the pointer sentinel mixture architecture for neural sequence models which has the ability to either reproduce a word from the recent context or produce a word from a standard softmax classiï¬ er. Our pointer sentinel- LSTM model achieves state of the art language modeling performance on the Penn Treebank (70.9 perplexity) while using far fewer parame- ters than a standard softmax LSTM. In order to evaluate how well language models can exploit longer contexts and deal with more realistic vo- cabularies and larger corpora we also introduce the freely available WikiText corpus.1
1609.07843#0
1609.07843#2
1609.07843
[ "1607.03474" ]
1609.07843#2
Pointer Sentinel Mixture Models
QO 0 0 we {}â >+(}>- 10> 0-0 Fed Chair Janet Yellen... raised rates. Ms. [ 29? : . : A : r i (ee 5 : : z ' é H . ' ' Sentinel Pptr( Yellen) g % >| 2arqvark Bernanke Rosenthal Yellen zebra &2] + t 4 t . Zz] ' : ' 8 : [I : o a anll feooaoello r Pvocab( Yellen) p(Yellen) = g Pvocab(Yellen) + (1 â g) ppte(Yellen) Figure 1. Illustration of the pointer sentinel-RNN mixture model. g is the mixture gate which uses the sentinel to dictate how much probability mass to give to the vocabulary. states, in effect increasing hidden state capacity and pro- viding a path for gradients not tied to timesteps. Even with attention, the standard softmax classiï¬ er that is being used in these models often struggles to correctly predict rare or previously unknown words. # 1. Introduction A major difï¬ culty in language modeling is learning when to predict speciï¬ c words from the immediate context. For instance, imagine a new person is introduced and two para- graphs later the context would allow one to very accurately predict this personâ s name as the next word. For standard neural sequence models to predict this name, they would have to encode the name, store it for many time steps in their hidden state, and then decode it when appropriate. As the hidden state is limited in capacity and the optimization of such models suffer from the vanishing gradient prob- lem, this is a lossy operation when performed over many timesteps. This is especially true for rare words. Models with soft attention or memory components have been proposed to help deal with this challenge, aiming to allow for the retrieval and use of relevant previous hidden Pointer networks (Vinyals et al., 2015) provide one poten- tial solution for rare and out of vocabulary (OoV) words as a pointer network uses attention to select an element from the input as output. This allows it to produce previously unseen input tokens. While pointer networks improve per- formance on rare words and long-term dependencies they are unable to select words that do not exist in the input.
1609.07843#1
1609.07843#3
1609.07843
[ "1607.03474" ]
1609.07843#3
Pointer Sentinel Mixture Models
We introduce a mixture model, illustrated in Fig. 1, that combines the advantages of standard softmax classiï¬ ers with those of a pointer component for effective and efï¬ - cient language modeling. Rather than relying on the RNN hidden state to decide when to use the pointer, as in the re- cent work of G¨ulc¸ehre et al. (2016), we allow the pointer component itself to decide when to use the softmax vocab- ulary through a sentinel. The model improves the state of the art perplexity on the Penn Treebank. Since this com- monly used dataset is small and no other freely available alternative exists that allows for learning long range depen- dencies, we also introduce a new benchmark dataset for language modeling called WikiText. 1Available for download at the WikiText dataset site Pointer Sentinel Mixture Models # Output Distribution P(yn|wi,...,wWn-1) Pointer Distribution Pptr(yn|w1, ..+,WN-1) Softmax ; & ' 1 1 ' \------- â Query 1! Softmax >| = RNN Distribution Pvocab(Yn|W1,---;Wn-1) Figure 2. Visualization of the pointer sentinel-RNN mixture model. T RNN, is used and the RNN y the pointer network to identify likely matching wor idden states. If the pointer component is not confident, probability m: [he query, produced from applying an MLP to the last output of the s from the past. The © nodes are inner products between the query can be directed to the RNN by increasing the value of the mixture gate g via the sentinel, seen in grey. If g = 1 then only the RNN is used. If g = 0 then only the pointer is used. # 2. The Pointer Sentinel for Language Modeling Given a sequence of words w1, . . . , wN predict the next word wN . â 1, our task is to # 2.1.
1609.07843#2
1609.07843#4
1609.07843
[ "1607.03474" ]
1609.07843#4
Pointer Sentinel Mixture Models
The softmax-RNN Component # 2.2. The Pointer Network Component In this section, we propose a modiï¬ cation to pointer net- works for language modeling. To predict the next word in the sequence, a pointer network would select the member of the input sequence p(w1, . . . , wN 1) with the maximal attention score as the output. Recurrent neural networks (RNNs) have seen widespread use for language modeling (Mikolov et al., 2010) due to their ability to, at least in theory, retain long term depen- dencies. RNNs employ the chain rule to factorize the joint probabilities over a sequence of tokens: p(wi,..., wn) = TI, p(w: ..,Wi-1). More precisely, at each time step 7, we compute the RNN hidden state h; according to the previous hidden state h;_; and the input x; such that hy = RNN(a;,hi-1). When all the N â 1 words have been processed by the RNN, the final state hy_ is fed into a softmax layer which computes the probability over a vocabulary of possible words: W1,- The simplest way to compute an attention score for a spe- ciï¬ c hidden state is an inner product with all the past hid- RH . However, if den states h, with each hidden state hi â we want to compute such a score for the most recent word (since this word may be repeated), we need to include the last hidden state itself in this inner product. Taking the in- ner product of a vector with itself results in the vectorâ s magnitude squared, meaning the attention scores would be strongly biased towards the most recent word. Hence we project the current hidden state to a query vector q ï¬ rst. To produce the query q we compute pvocab(w) = softmax(U hN 1), (1) â H , H is the hidden size, and where pvocab à V the vocabulary size.
1609.07843#3
1609.07843#5
1609.07843
[ "1607.03474" ]
1609.07843#5
Pointer Sentinel Mixture Models
RNNs can suffer from the vanishing gradient problem. The LSTM (Hochreiter & Schmidhuber, 1997) architecture has been proposed to deal with this by updating the hidden state according to a set of gates. Our work focuses on the LSTM but can be applied to any RNN architecture that ends in a vocabulary softmax. q = tanh(W hN 1 + b), (2) â RH . To generate the RH , and q where W pointer attention scores, we compute the match between the previous RNN output states hi and the query q by taking the inner product, followed by a softmax activation function to obtain a probability distribution: zi = qT hi, a = softmax(z), (3) (4) where z RL, a RL, and L is the total number of hidden â â
1609.07843#4
1609.07843#6
1609.07843
[ "1607.03474" ]
1609.07843#6
Pointer Sentinel Mixture Models
Pointer Sentinel Mixture Models states. The probability mass assigned to a given word is the sum of the probability mass given to all token positions where the given word appears: is used and 1 means only the softmax-RNN is used. xi) + (1 xi). (6) # p(yi| xi) = g pvocab(yi| # g) pptr(yi| â > ai, (5) tel (w,x) Dptr(w) = â While the models could be entirely separate, we re-use many of the parameters for the softmax-RNN and pointer components. This sharing minimizes the total number of parameters in the model and capitalizes on the pointer net- workâ s supervision for the RNN component. where I(w, x) results in all positions of the word w in the RV . This technique, referred to as input x and pptr pointer sum attention, has been used for question answer- ing (Kadlec et al., 2016). Given the length of the documents used in language mod- eling, it may not be feasible for the pointer network to eval- uate an attention score for all the words back to the begin- ning of the dataset. Instead, we may elect to maintain only a window of the L most recent words for the pointer to match against. The length L of the window is a hyperparameter that can be tuned on a held out dataset or by empirically an- alyzing how frequently a word at position t appears within the last L words. To illustrate the advantages of this approach, consider a long article featuring two sentences President Obama dis- cussed the economy and President Obama then ï¬ ew to If the query was Which President is the article Prague. about?, probability mass could be applied to Obama in If the question was instead Who ï¬ ew to either sentence. Prague?, only the latter occurrence of Obama provides the proper context. The attention sum model ensures that, as long as the entire attention probability mass is distributed on the occurrences of Obama, the pointer network can achieve zero loss.
1609.07843#5
1609.07843#7
1609.07843
[ "1607.03474" ]
1609.07843#7
Pointer Sentinel Mixture Models
This ï¬ exibility provides supervision without forcing the model to put mass on supervision sig- nals that may be incorrect or lack proper context. This fea- ture becomes an important component in the pointer sen- tinel mixture model. # 2.4. Details of the Gating Function To compute the new pointer sentinel gate g, we modify the pointer component. In particular, we add an additional ele- ment to z, the vector of attention scores as deï¬ ned in Eq. 3. This element is computed using an inner product between RH . This change the query and the sentinel2 vector s can be summarized by changing Eq. 4 to: a = softmax ( [z; q's) . (7) RV +1 to be the attention distribution over We deï¬ ne a both the words in the pointer window as well as the sentinel state. We interpret the last element of this vector to be the gate value: g = a[V + 1]. Any probability mass assigned to g is given to the stan- dard softmax vocabulary of the RNN.
1609.07843#6
1609.07843#8
1609.07843
[ "1607.03474" ]
1609.07843#8
Pointer Sentinel Mixture Models
The ï¬ nal updated, normalized pointer probability over the vocabulary in the window then becomes: pptr(yi| xi) = 1 1 g a[1 : V ], (8) â where we denoted [1 : V ] to mean the ï¬ rst V elements of the vector. The ï¬ nal mixture model is the same as Eq. 6 but with the updated Eq. 8 for the pointer probability. # 2.3. The Pointer Sentinel Mixture Model While pointer networks have proven to be effective, they cannot predict output words that are not present in the in- put, a common scenario in language modeling. We propose to resolve this by using a mixture model that combines a standard softmax with a pointer. This setup encourages the model to have both components compete: use pointers whenever possible and back-off to the standard softmax otherwise. This competition, in par- ticular, was crucial to obtain our best model. By integrating the gating function directly into the pointer computation, it is inï¬ uenced by both the RNN hidden state and the pointer windowâ s hidden states. # 2.5. Motivation for the Sentinel as Gating Function Our mixture model has two base distributions: the softmax vocabulary of the RNN output and the positional vocabu- lary of the pointer model. We refer to these as the RNN component and the pointer component respectively. To combine the two base distributions, we use a gating func- xi) where zi is the latent variable stating tion g = p(zi = k which base distribution the data point belongs to. As we only have two base distributions, g can produce a scalar in the range [0, 1]. A value of 0 implies that only the pointer To make the best decision possible regarding which compo- nent to use the gating function must have as much context as possible. As we increase both the number of timesteps and the window of words for the pointer component to con- sider, the RNN hidden state by itself isnâ
1609.07843#7
1609.07843#9
1609.07843
[ "1607.03474" ]
1609.07843#9
Pointer Sentinel Mixture Models
t guaranteed to 2A sentinel value is inserted at the end of a search space in or- der to ensure a search algorithm terminates if no matching item is found. Our sentinel value terminates the pointer search space and distributes the rest of the probability mass to the RNN vocabulary. Pointer Sentinel Mixture Models accurately recall the identity or order of words it has re- cently seen (Adi et al., 2016). This is an obvious limitation of encoding a variable length sequence into a ï¬ xed dimen- sionality vector. no penalty and the loss is entirely determined by the loss of the softmax-RNN component. # 2.7. Parameters and Computation Time In our task, where we may want a pointer window where the length L is in the hundreds, accurately modeling all of this information within the RNN hidden state is impracti- cal. The position of speciï¬ c words is also a vital feature as relevant words eventually fall out of the pointer compo- nentâ s window. To correctly model this would require the RNN hidden state to store both the identity and position of each word in the pointer window. This is far beyond what the ï¬ xed dimensionality hidden state of an RNN is able to accurately capture. For this reason, we integrate the gating function directly into the pointer network by use of the sentinel. The deci- sion to back-off to the softmax vocabulary is then informed by both the query q, generated using the RNN hidden state 1, and from the contents of the hidden states in the hN pointer window itself. This allows the model to accurately query what hidden states are contained in the pointer win- dow and avoid having to maintain state for when a word may have fallen out of the pointer window. The pointer sentinel-LSTM mixture model results in a relatively minor increase in parameters and computation time, especially when compared to the size of the mod- els required to achieve similar performance using standard LSTM models. The only two additional parameters required by the model are those required for computing q, speciï¬
1609.07843#8
1609.07843#10
1609.07843
[ "1607.03474" ]
1609.07843#10
Pointer Sentinel Mixture Models
cally W â RH RH , and the sentinel vector embedding, H and b à RH . This is independent of the depth of the RNN as s the the pointer component only interacts with the output of the ï¬ nal RNN layer. The additional H 2 + 2H parameters are minor compared to a single LSTM layerâ s 8H 2 + 4H parameters. Most state of the art models also require mul- tiple LSTM layers. In terms of additional computation, a pointer sentinel- LSTM of window size L only requires computing the query q (a linear layer with tanh activation), a total of L parallelizable inner product calculations, and the attention scores for the L resulting scalars via the softmax function.
1609.07843#9
1609.07843#11
1609.07843
[ "1607.03474" ]
1609.07843#11
Pointer Sentinel Mixture Models
# 2.6. Pointer Sentinel Loss Function of is a one hot encod- â ing of the correct output. During training, as Ë yi is one hot, only a single mixed probability p(yij) must be computed for calculating the loss. This can result in a far more efï¬ cient GPU implementation. At prediction time, when xi), a maximum of L word we want all values for p(yi| probabilities must be mixed, as there is a maximum of L unique words in the pointer window of length L. This mixing can occur on the CPU where random access indexing is more efï¬ cient than the GPU. Following the pointer sum attention network, the aim is to place probability mass from the attention mechanism on the correct output Ë yi if it exists in the input. In the case of our mixture model the pointer loss instead becomes:
1609.07843#10
1609.07843#12
1609.07843
[ "1607.03474" ]
1609.07843#12
Pointer Sentinel Mixture Models
â log | g+ > a; |, (9) iâ ¬I(y,a) i â where I(y, x) results in all positions of the correct output y in the input x. The gate g may be assigned all probabil- ity mass if, for instance, the correct output Ë yi exists only in the softmax-RNN vocabulary. Furthermore, there is no penalty if the model places the entire probability mass, on any of the instances of the correct word in the input win- dow. If the pointer component places the entirety of the probability mass on the gate g, the pointer network incurs # 3. Related Work
1609.07843#11
1609.07843#13
1609.07843
[ "1607.03474" ]
1609.07843#13
Pointer Sentinel Mixture Models
Considerable research has been dedicated to the task of lan- guage modeling, from traditional machine learning tech- niques such as n-grams to neural sequence models in deep learning. Mixture models composed of various knowledge sources have been proposed in the past for language modeling. Rosenfeld (1996) uses a maximum entropy model to com- bine a variety of information sources to improve language modeling on news text and speech. These information sources include complex overlapping n-gram distributions and n-gram caches that aim to capture rare words. The n- gram cache could be considered similar in some ways to our modelâ s pointer network, where rare or contextually relevant words are stored for later use. Beyond n-grams, neural sequence models such as recurrent neural networks have been shown to achieve state of the art results (Mikolov et al., 2010). A variety of RNN regular- ization methods have been explored, including a number of dropout variations (Zaremba et al., 2014; Gal, 2015) which prevent overï¬ tting of complex LSTM language models. Other work has improved language modeling performance by modifying the RNN architecture to better handle in- creased recurrence depth (Zilly et al., 2016). In order to increase capacity and minimize the impact of vanishing gradients, some language and translation mod- Pointer Sentinel Mixture Models Penn Treebank Valid Train Test Train WikiText-2 Valid Test Train WikiText-103 Valid Test Articles Tokens - 929,590 - 73,761 - 82,431 600 2,088,628 60 217,646 60 245,569 28,475 103,227,021 60 217,646 60 245,569 Vocab size OoV rate 10,000 4.8% 33,278 2.6% 267,735 0.4% Table 1. Statistics of the Penn Treebank, WikiText-2, and WikiText-103. The out of vocabulary (OoV) rate notes what percentage of tokens have been replaced by an (unk) token. The token count includes newlines which add to the structure of the WikiText datasets.
1609.07843#12
1609.07843#14
1609.07843
[ "1607.03474" ]
1609.07843#14
Pointer Sentinel Mixture Models
els have also added a soft attention or memory compo- nent (Bahdanau et al., 2015; Sukhbaatar et al., 2015; Cheng et al., 2016; Kumar et al., 2016; Xiong et al., 2016; Ahn et al., 2016). These mechanisms allow for the retrieval and use of relevant previous hidden states. Soft attention mech- anisms need to ï¬ rst encode the relevant word into a state vector and then decode it again, even if the output word is identical to the input word used to compute that hid- den state or memory. A drawback to soft attention is that if, for instance, January and March are both equally at- tended candidates, the attention mechanism may blend the two vectors, resulting in a context vector closest to Febru- ary (Kadlec et al., 2016). Even with attention, the standard softmax classiï¬ er being used in these models often strug- gles to correctly predict rare or previously unknown words. Attention-based pointer mechanisms were introduced in Vinyals et al. (2015) where the pointer network is able to select elements from the input as output. In the above example, only January or March would be available as options, as February does not appear in the input. The use of pointer networks have been shown to help with geometric problems (Vinyals et al., 2015), code genera- tion (Ling et al., 2016), summarization (Gu et al., 2016; G¨ulc¸ehre et al., 2016), question answering (Kadlec et al., 2016). While pointer networks improve performance on rare words and long-term dependencies they are unable to select words that do not exist in the input. according to the switching network and the word or loca- tion with the highest ï¬ nal attention score is selected for out- put. Although this approach uses both a pointer and RNN component, it is not a mixture model and does not combine the probabilities for a word if it occurs in both the pointer location softmax and the RNN vocabulary softmax. In our model the word probability is a mix of both the RNN and pointer components, allowing for better predictions when the context may be ambiguous.
1609.07843#13
1609.07843#15
1609.07843
[ "1607.03474" ]
1609.07843#15
Pointer Sentinel Mixture Models
Extending this concept further, the latent predictor network (Ling et al., 2016) generates an output sequence condi- tioned on an arbitrary number of base models where each base model may have differing granularity. In their task of code generation, the output could be produced one charac- ter at a time using a standard softmax or instead copy entire words from referenced text ï¬ elds using a pointer network. As opposed to G¨ulc¸ehre et al. (2016), all states which pro- duce the same output are merged by summing their prob- abilities. Their model however requires a more complex training process involving the forward-backward algorithm for Semi-Markov models to prevent an exponential explo- sion in potential paths.
1609.07843#14
1609.07843#16
1609.07843
[ "1607.03474" ]
1609.07843#16
Pointer Sentinel Mixture Models
# 4. WikiText - A Benchmark for Language Modeling G¨ulc¸ehre et al. (2016) introduce a pointer softmax model that can generate output the vocabulary softmax of an RNN or the location softmax of the pointer network. Not only does this allow for producing OoV words which are not in the input, the pointer softmax model is able to better deal with rare and unknown words than a model only featuring an RNN softmax. Rather than constructing a mixture model as in our work, they use a switching network to decide which component to use. For neural machine translation, the switching network is condi- tioned on the representation of the context of the source text and the hidden state of the decoder. The pointer network is not used as a source of information for switching network as in our model. The pointer and RNN softmax are scaled
1609.07843#15
1609.07843#17
1609.07843
[ "1607.03474" ]
1609.07843#17
Pointer Sentinel Mixture Models
We ï¬ rst describe the most commonly used language model- ing dataset and its pre-processing in order to then motivate the need for a new benchmark dataset. # 4.1. Penn Treebank In order to compare our model to the many recent neural language models, we conduct word-level prediction exper- iments on the Penn Treebank (PTB) dataset (Marcus et al., 1993), pre-processed by Mikolov et al. (2010). The dataset consists of 929k training words, 73k validation words, and 82k test words. As part of the pre-processing performed by Mikolov et al. (2010), words were lower-cased, numbers were replaced with N, newlines were replaced with (eos), and all other punctuation was removed. The vocabulary is the most frequent 10k words with the rest of the tokens be- Pointer Sentinel Mixture Models ing replaced by an (unk) token.
1609.07843#16
1609.07843#18
1609.07843
[ "1607.03474" ]
1609.07843#18
Pointer Sentinel Mixture Models
For full statistics, refer to Table 1. Algorithm 1 Calculate truncated BPTT where every k1 timesteps we run back propagation for k2 timesteps for t = 1 to t = T do # 4.2. Reasons for a New Dataset Run the RNN for one step, computing ht and zt While the processed version of the PTB above has been frequently used for language modeling, it has many limi- tations. The tokens in PTB are all lower case, stripped of any punctuation, and limited to a vocabulary of only 10k words. These limitations mean that the PTB is unrealistic for real language use, especially when far larger vocabu- laries with many rare words are involved.
1609.07843#17
1609.07843#19
1609.07843
[ "1607.03474" ]
1609.07843#19
Pointer Sentinel Mixture Models
Fig. 3 illustrates this using a Zipï¬ an plot over the training partition of the PTB. The curve stops abruptly when hitting the 10k vocab- ulary. Given that accurately predicting rare words, such as named entities, is an important task for many applications, the lack of a long tail for the vocabulary is problematic. # if t divides k1 then Run BPTT from t down to t â # end if end for same format and following the same conventions as that of the PTB dataset above. # 4.4. Statistics Other larger scale language modeling datasets exist. Un- fortunately, they either have restrictive licensing which pre- vents widespread use or have randomized sentence order- ing (Chelba et al., 2013) which is unrealistic for most lan- guage use and prevents the effective learning and evalua- tion of longer term dependencies. Hence, we constructed a language modeling dataset using text extracted from Wikipedia and will make this available to the community.
1609.07843#18
1609.07843#20
1609.07843
[ "1607.03474" ]
1609.07843#20
Pointer Sentinel Mixture Models
# 4.3. Construction and Pre-processing We selected articles only ï¬ tting the Good or Featured ar- ticle criteria speciï¬ ed by editors on Wikipedia. These ar- ticles have been reviewed by humans and are considered well written, factually accurate, broad in coverage, neutral in point of view, and stable. This resulted in 23,805 Good articles and 4,790 Featured articles. The text for each arti- cle was extracted using the Wikipedia API. Extracting the raw text from Wikipedia mark-up is nontrivial due to the large number of macros in use. These macros are used extensively and include metric conversion, abbreviations, language notation, and date handling.
1609.07843#19
1609.07843#21
1609.07843
[ "1607.03474" ]
1609.07843#21
Pointer Sentinel Mixture Models
Once extracted, speciï¬ c sections which primarily featured lists were removed by default. Other minor bugs, such as sort keys and Edit buttons that leaked in from the HTML, were also removed. Mathematical formulae and LATEX code, were replaced with tokens. Normaliza- tion and tokenization were performed using the Moses to- kenizer (Koehn et al., 2007), slightly augmented to further 8 @,@ 600) and with some addi- split numbers (8,600 tional minor ï¬ xes. Following Chelba et al. (2013) a vocab- ulary was constructed by discarding all words with a count below 3. Words outside of the vocabulary were mapped to token, also a part of the vocabulary. the # (unk) The full WikiText dataset is over 103 million words in size, a hundred times larger than the PTB. It is also a tenth the size of the One Billion Word Benchmark (Chelba et al., 2013), one of the largest publicly available language mod- eling benchmarks, whilst consisting of articles that allow for the capture and usage of longer term dependencies as might be found in many real world tasks. The dataset is available in two different sizes: WikiText-2 and WikiText-103. Both feature punctuation, original cas- ing, a larger vocabulary, and numbers. WikiText-2 is two times the size of the Penn Treebank dataset. WikiText-103 features all extracted articles. Both datasets use the same articles for validation and testing with the only difference being the vocabularies. For full statistics, refer to Table 1.
1609.07843#20
1609.07843#22
1609.07843
[ "1607.03474" ]
1609.07843#22
Pointer Sentinel Mixture Models
# 5. Experiments # 5.1. Training Details As the pointer sentinel mixture model uses the outputs of the RNN from up to L timesteps back, this presents a chal- lenge for training. If we do not regenerate the stale his- torical outputs of the RNN when we update the gradients, backpropagation through these stale outputs may result in incorrect gradient updates. If we do regenerate all stale out- puts of the RNN, the training process is far slower. As we can make no theoretical guarantees on the impact of stale outputs on gradient updates, we opt to regenerate the win- dow of RNN outputs used by the pointer component after each gradient update. We also use truncated backpropagation through time (BPTT) in a different manner to many other RNN language models. Truncated BPTT allows for practical time-efï¬ cient training of RNN models but has fundamental trade-offs that are rarely discussed. To ensure the dataset is immediately usable by existing lan- guage modeling tools, we have provided the dataset in the For running truncated BPTT, BPTT is run for k2 timesteps every k1 timesteps, as seen in Algorithm 1. For many RNN Pointer Sentinel Mixture Models Zipf plot for Penn Treebank 10° 105 the <unk> N g Absolute frequency of token 8 8 10% 10° 5 10° 10° 102 103 104 105 Frequency rank of token Zipf plot for WikiText-2 10° g Absolute frequency of token 8 8 10% 10° 5 10° 10° 102 103 104 105 Frequency rank of token Zipf plot for Penn Treebank 10° 105 the <unk> N g Absolute frequency of token 8 8 10% 10° 5 10° 10° 102 103 104 105 Frequency rank of token Zipf plot for WikiText-2 10° g Absolute frequency of token 8 8 10% 10° 5 10° 10° 102 103 104 105 Frequency rank of token Figure 3. Zipï¬ an plot over the training partition in Penn Treebank and WikiText-2 datasets.
1609.07843#21
1609.07843#23
1609.07843
[ "1607.03474" ]
1609.07843#23
Pointer Sentinel Mixture Models
Notice the severe drop on the Penn Treebank when the vocabulary hits 104. Two thirds of the vocabulary in WikiText-2 are past the vocabulary cut-off of the Penn Treebank. language modeling training schemes, k1 = k2, meaning that every k timesteps truncated BPTT is performed for the k previous timesteps. This results in only a single RNN output receiving backpropagation for k timesteps, with the other extreme being that the ï¬ rst token receives backprop- agation for 0 timesteps. This issue is compounded by the fact that most language modeling code split the data tem- porally such that the boundaries are always the same. As such, most words in the training data will never experience a full backpropagation for k timesteps. the pointer component always looks L In our task, timesteps into the past if L past timesteps are available. We select k1 = 1 and k2 = L such that for each timestep we perform backpropagation for L timesteps and advance one timestep at a time.
1609.07843#22
1609.07843#24
1609.07843
[ "1607.03474" ]
1609.07843#24
Pointer Sentinel Mixture Models
Only the loss for the ï¬ nal predicted word is used for backpropagation through the window. ration which features a hidden size of 1500 and a two layer LSTM. We produce results for two model types, an LSTM model that uses dropout regularization and the pointer sentinel- LSTM model. The variants of dropout used were zone- out (Krueger et al., 2016) and variational inference based dropout (Gal, 2015). Zoneout, which stochastically forces some recurrent units to maintain their previous values, was used for the recurrent connections within the LSTM. Varia- tional inference based dropout, where the dropout mask for a layer is locked across timesteps, was used on the input to each RNN layer and also on the output of the ï¬ nal RNN layer. We used a value of 0.5 for both dropout connections. # 5.3. Comparison over Penn Treebank # 5.2. Model Details Our experimental setup reï¬ ects that of Zaremba et al. (2014) and Gal (2015). We increased the number of timesteps used during training from 35 to 100, matching the length of the window L. Batch size was increased to 32 from 20. We also halve the learning rate when valida- tion perplexity is worse than the previous iteration, stop- ping training when validation perplexity fails to improve for three epochs or when 64 epochs are reached. The gra- dients are rescaled if their global norm exceeds 1 (Pascanu et al., 2013b).3 We evaluate the medium model conï¬ gura- tion which features a hidden size of H = 650 and a two layer LSTM. We compare against the large model conï¬ gu- Table 2 compares the pointer sentinel-LSTM to a vari- ety of other models on the Penn Treebank dataset. The pointer sentinel-LSTM achieves the lowest perplexity, fol- lowed by the recent Recurrent Highway Networks (Zilly et al., 2016). The medium pointer sentinel-LSTM model also achieves lower perplexity than the large LSTM mod- els. Note that the best performing large variational LSTM model uses computationally intensive Monte Carlo (MC) dropout averaging. Monte Carlo dropout averaging is a general improvement for any sequence model that uses dropout but comes at a greatly increased test time cost.
1609.07843#23
1609.07843#25
1609.07843
[ "1607.03474" ]
1609.07843#25
Pointer Sentinel Mixture Models
In Gal (2015) it requires rerunning the test model with 1000 different dropout masks. The pointer sentinel-LSTM is able to achieve these results with far fewer parameters than other models with comparable performance, speciï¬ - cally with less than a third the parameters used in the large variational LSTM models. 3The highly aggressive clipping is likely due to the increased BPTT length. Even with such clipping early batches may experi- ence excessively high perplexity, though this settles rapidly. We also test a variational LSTM that uses zoneout, which Pointer Sentinel Mixture Models serves as the RNN component of our pointer sentinel- LSTM mixture. This variational LSTM model performs BPTT for the same length L as the pointer sentinel-LSTM, where L = 100 timesteps. The results for this model abla- tion are worse than that of Gal (2015)â s variational LSTM without Monte Carlo dropout averaging. # 5.4. Comparison over WikiText-2 As WikiText-2 is being introduced in this dataset, there are no existing baselines. We provide two baselines to compare the pointer sentinel-LSTM against: our variational LSTM using zoneout and the medium variational LSTM used in Gal (2015).4 Attempts to run the Gal (2015) large model variant, a two layer LSTM with hidden size 1500, resulted in out of memory errors on a 12GB K80 GPU, likely due to the increased vocabulary size. We chose the best hyper- parameters from PTB experiments for all models. better) Sy a nN ° 0.5 Mean difference in log perplexity (higher 0.0, 2 3 4 5 6 7 8 9 10 Word buckets of equal size (frequent words on left) Figure 4. Mean difference in log perplexity on PTB when using the pointer sentinel-LSTM compared to the LSTM model. Words were sorted by frequency and split into equal sized buckets. Table 3 shows a similar gain made by the pointer sentinel- LSTM over the variational LSTM models. The variational LSTM from Gal (2015) again beats out the variational LSTM used as a base for our experiments.
1609.07843#24
1609.07843#26
1609.07843
[ "1607.03474" ]
1609.07843#26
Pointer Sentinel Mixture Models
# 6. Analysis # 6.1. Impact on Rare Words # 6.2. Qualitative Analysis of Pointer Usage In a qualitative analysis, we visualized the gate use and pointer attention for a variety of examples in the validation set, focusing on predictions where the gate primarily used the pointer component. These visualizations are available in the supplementary material. A hypothesis as to why the pointer sentinel-LSTM can out- perform an LSTM is that the pointer component allows the model to effectively reproduce rare words. An RNN may be able to better use the hidden state capacity by deferring to the pointer component. The pointer component may also allow for a sharper selection of a single word than may be possible using only the softmax. Figure 4 shows the improvement of perplexity when com- paring the LSTM to the pointer sentinel-LSTM with words split across buckets according to frequency. It shows that the pointer sentinel-LSTM has stronger improvements as words become rarer. Even on the Penn Treebank, where there is a relative absence of rare words due to only select- ing the most frequent 10k words, we can see the pointer sentinel-LSTM mixture model provides a direct beneï¬
1609.07843#25
1609.07843#27
1609.07843
[ "1607.03474" ]
1609.07843#27
Pointer Sentinel Mixture Models
t. While the improvements are largest on rare words, we can see that the pointer sentinel-LSTM is still helpful on rela- tively frequent words. This may be the pointer component directly selecting the word or through the pointer supervi- sion signal improving the RNN by allowing gradients to ï¬ ow directly to other occurrences of the word in that win- dow. 4https://github.com/yaringal/BayesianRNN As expected, the pointer component is heavily used for rare names such as Seidman (23 times in training), Iverson (7 times in training), and Rosenthal (3 times in training). The pointer component was also heavily used when it came to other named entity names such as companies like Honey- well (8 times in training) and Integrated (41 times in train- ing, though due to lowercasing of words this includes inte- grated circuits, fully integrated, and other generic usage). Surprisingly, the pointer component was also used for many frequent tokens. For selecting the unit of measure- ment (tons, kilograms, . . . ) or the short scale of numbers (thousands, millions, billions, . . . ), the pointer would refer to previous recent usage. This is to be expected, especially when phrases are of the form increased from N tons to N tons. The model can even be found relying on a mixture of the softmax and the pointer for predicting certain frequent verbs such as said. Finally, the pointer component can be seen pointing to words at the very end of the 100 word window (position 97), a far longer horizon than the 35 steps that most lan- guage models truncate their backpropagation training to. This illustrates why the gating function must be integrated into the pointer component. If the gating function could only use the RNN hidden state, it would need to be wary of words that were near the tail of the pointer, especially if it was not able to accurately track exactly how long it Pointer Sentinel Mixture Models
1609.07843#26
1609.07843#28
1609.07843
[ "1607.03474" ]
1609.07843#28
Pointer Sentinel Mixture Models
Model Parameters Validation Test Mikolov & Zweig (2012) - KN-5 Mikolov & Zweig (2012) - KN5 + cache Mikolov & Zweig (2012) - RNN Mikolov & Zweig (2012) - RNN-LDA Mikolov & Zweig (2012) - RNN-LDA + KN-5 + cache Pascanu et al. (2013a) - Deep RNN Cheng et al. (2014) - Sum-Prod Net Zaremba et al. (2014) - LSTM (medium) Zaremba et al. (2014) - LSTM (large) Gal (2015) - Variational LSTM (medium, untied) Gal (2015) - Variational LSTM (medium, untied, MC) Gal (2015) - Variational LSTM (large, untied) Gal (2015) - Variational LSTM (large, untied, MC) Kim et al. (2016) - CharCNN Zilly et al. (2016) - Variational RHN 2Mâ ¡ 2Mâ ¡ 6Mâ ¡ 7Mâ ¡ 9Mâ ¡ 6M 5Mâ ¡ 20M 66M 20M 20M 66M 66M 19M 32M â â â â â â â 86.2 82.2 81.9 ± â ± â â 72.8 77.9 0.2 0.3 141.2 125.7 124.7 113.7 92.0 107.5 100.0 82.7 78.4 79.7 78.6 75.2 73.4 ± ± ± ± 78.9 71.3 0.1 0.1 0.2 0.0 Zoneout + Variational LSTM (medium) Pointer Sentinel-LSTM (medium) 20M 21M 84.4 72.4 80.6 70.9 Table 2. Single model perplexity on validation and test sets for the Penn Treebank language modeling task.
1609.07843#27
1609.07843#29
1609.07843
[ "1607.03474" ]
1609.07843#29
Pointer Sentinel Mixture Models
For our models and the models of Zaremba et al. (2014) and Gal (2015), medium and large refer to a 650 and 1500 units two layer LSTM respectively. The medium pointer sentinel-LSTM model achieves lower perplexity than the large LSTM model of Gal (2015) while using a third of the parameters and without using the computationally expensive Monte Carlo (MC) dropout averaging at test time. Parameter numbers with â ¡ are estimates based upon our understanding of the model and with reference to Kim et al. (2016). Model Parameters Validation Test Variational LSTM implementation from Gal (2015) 20M 101.7 96.3 Zoneout + Variational LSTM Pointer Sentinel-LSTM 20M 21M 108.7 84.8 100.9 80.8 Table 3. Single model perplexity on validation and test sets for the WikiText-2 language modeling task. All compared models use a two layer LSTM with a hidden size of 650 and the same hyperparameters as the best performing Penn Treebank model.
1609.07843#28
1609.07843#30
1609.07843
[ "1607.03474" ]
1609.07843#30
Pointer Sentinel Mixture Models
was since seeing a word. By integrating the gating func- tion into the pointer component, we avoid the RNN hidden state having to maintain this intensive bookkeeping. # 7. Conclusion # References Adi, Yossi, Kermany, Einat, Belinkov, Yonatan, Lavi, Ofer, and Goldberg, Yoav. Fine-grained Analysis of Sentence Embeddings Using Auxiliary Prediction Tasks. arXiv preprint arXiv:1608.04207, 2016. We introduced the pointer sentinel mixture model and the WikiText language modeling dataset. This model achieves state of the art results in language modeling over the Penn Treebank while using few additional parameters and little additional computational complexity at prediction time. We have also motivated the need to move from Penn Tree- bank to a new language modeling dataset for long range dependencies, providing WikiText-2 and WikiText-103 as potential options. We hope this new dataset can serve as a platform to improve handling of rare words and the usage of long term dependencies in language modeling.
1609.07843#29
1609.07843#31
1609.07843
[ "1607.03474" ]
1609.07843#31
Pointer Sentinel Mixture Models
Ahn, Sungjin, Choi, Heeyoul, P¨arnamaa, Tanel, and Ben- gio, Yoshua. A Neural Knowledge Language Model. CoRR, abs/1608.00318, 2016. Bahdanau, Dzmitry, Cho, Kyunghyun, and Bengio, Yoshua. Neural Machine Translation by Jointly Learning to Align and Translate. In ICLR, 2015. Chelba, Ciprian, Mikolov, Tomas, Schuster, Mike, Ge, Qi, Brants, Thorsten, Koehn, Phillipp, and Robin- son, Tony. One Billion Word Benchmark for Measur- ing Progress in Statistical Language Modeling. arXiv preprint arXiv:1312.3005, 2013. Cheng, Jianpeng, Dong, Li, and Lapata, Mirella. Long
1609.07843#30
1609.07843#32
1609.07843
[ "1607.03474" ]
1609.07843#32
Pointer Sentinel Mixture Models
Pointer Sentinel Mixture Models Short-Term Memory-Networks for Machine Reading. CoRR, abs/1601.06733, 2016. Cheng, Wei-Chen, Kok, Stanley, Pham, Hoai Vu, Chieu, Hai Leong, and Chai, Kian Ming Adam. Language Mod- eling with Sum-Product Networks. In INTERSPEECH, 2014. Marcus, Mitchell P., Santorini, and Beatrice, Building a Large An- The Penn Treebank. Marcinkiewicz, Mary Ann. notated Corpus of English: Computational Linguistics, 19:313â 330, 1993. Mikolov, Tomas and Zweig, Geoffrey.
1609.07843#31
1609.07843#33
1609.07843
[ "1607.03474" ]
1609.07843#33
Pointer Sentinel Mixture Models
Context dependent recurrent neural network language model. In SLT, 2012. Gal, Yarin. A Theoretically Grounded Application of Dropout in Recurrent Neural Networks. arXiv preprint arXiv:1512.05287, 2015. Mikolov, Tomas, Karaï¬ Â´at, Martin, Burget, Luk´as, Cer- nock´y, Jan, and Khudanpur, Sanjeev. Recurrent neu- ral network based language model. In INTERSPEECH, 2010. Gu, Jiatao, Lu, Zhengdong, Li, Hang, and Li, Victor O. K.
1609.07843#32
1609.07843#34
1609.07843
[ "1607.03474" ]
1609.07843#34
Pointer Sentinel Mixture Models
Incorporating Copying Mechanism in Sequence- to-Sequence Learning. CoRR, abs/1603.06393, 2016. Pascanu, Razvan, C¸ aglar G¨ulc¸ehre, Cho, Kyunghyun, and Bengio, Yoshua. How to Construct Deep Recurrent Neu- ral Networks. CoRR, abs/1312.6026, 2013a. G¨ulc¸ehre, C¸ aglar, Ahn, Sungjin, Nallapati, Ramesh, Zhou, Bowen, and Bengio, Yoshua. Pointing the Unknown Words. arXiv preprint arXiv:1603.08148, 2016. Pascanu, Razvan, Mikolov, Tomas, and Bengio, Yoshua.
1609.07843#33
1609.07843#35
1609.07843
[ "1607.03474" ]
1609.07843#35
Pointer Sentinel Mixture Models
On the difï¬ culty of training recurrent neural networks. In ICML, 2013b. Hochreiter, Sepp and Schmidhuber, J¨urgen. Long Short- Term Memory. Neural Computation, 9(8):1735â 1780, Nov 1997. ISSN 0899-7667. Rosenfeld, Roni. A Maximum Entropy Approach to Adap- tive Statistical Language Modeling. 1996.
1609.07843#34
1609.07843#36
1609.07843
[ "1607.03474" ]
1609.07843#36
Pointer Sentinel Mixture Models
Kadlec, Rudolf, Schmid, Martin, Bajgar, Ondrej, and Kleindienst, Jan. Text Understanding with the Attention Sum Reader Network. arXiv preprint arXiv:1603.01547, 2016. Kim, Yoon, Jernite, Yacine, Sontag, David, and Rush, Alexander M. Character-aware neural language models. CoRR, abs/1508.06615, 2016. Koehn, Philipp, Hoang, Hieu, Birch, Alexandra, Callison- Burch, Chris, Federico, Marcello, Bertoldi, Nicola, Cowan, Brooke, Shen, Wade, Moran, Christine, Zens, Richard, Dyer, Chris, Bojar, Ondej, Constantin, Alexan- dra, and Herbst, Evan.
1609.07843#35
1609.07843#37
1609.07843
[ "1607.03474" ]
1609.07843#37
Pointer Sentinel Mixture Models
Moses: Open Source Toolkit for Statistical Machine Translation. In ACL, 2007. Sukhbaatar, Sainbayar, Szlam, Arthur, Weston, Jason, and Fergus, Rob. End-To-End Memory Networks. In NIPS, 2015. Vinyals, Oriol, Fortunato, Meire, and Jaitly, Navdeep. In Advances in Neural Information Pointer networks. Processing Systems, pp. 2692â 2700, 2015.
1609.07843#36
1609.07843#38
1609.07843
[ "1607.03474" ]
1609.07843#38
Pointer Sentinel Mixture Models
Xiong, Caiming, Merity, Stephen, and Socher, Richard. Dynamic Memory Networks for Visual and Textual Question Answering. In ICML, 2016. Zaremba, Wojciech, Sutskever, Ilya, and Vinyals, Oriol. Recurrent neural network regularization. arXiv preprint arXiv:1409.2329, 2014. Krueger, David, Maharaj, Tegan, Kram´ar, J´anos, Pezeshki, Mohammad, Ballas, Nicolas, Ke, Nan Rosemary, Goyal, Anirudh, Bengio, Yoshua, Larochelle, Hugo, Courville, Aaron, et al.
1609.07843#37
1609.07843#39
1609.07843
[ "1607.03474" ]
1609.07843#39
Pointer Sentinel Mixture Models
Zoneout: Regularizing RNNs by Ran- domly Preserving Hidden Activations. arXiv preprint arXiv:1606.01305, 2016. Zilly, Julian Georg, Srivastava, Rupesh Kumar, Koutn´ık, Jan, and Schmidhuber, J¨urgen. Recurrent Highway Net- works. arXiv preprint arXiv:1607.03474, 2016. Kumar, Ankit, Irsoy, Ozan, Ondruska, Peter, Iyyer, Mo- hit, Bradbury, James, Gulrajani, Ishaan, Zhong, Victor, Paulus, Romain, and Socher, Richard.
1609.07843#38
1609.07843#40
1609.07843
[ "1607.03474" ]
1609.07843#40
Pointer Sentinel Mixture Models
Ask me any- thing: Dynamic memory networks for natural language processing. In ICML, 2016. Ling, Wang, Grefenstette, Edward, Hermann, Karl Moritz, Kocisk´y, Tom´as, Senior, Andrew, Wang, Fumin, and Blunsom, Phil. Latent Predictor Networks for Code Gen- eration. CoRR, abs/1603.06744, 2016. Pointer Sentinel Mixture Models # Supplementary material # Pointer usage on the Penn Treebank For a qualitative analysis, we visualize how the pointer component is used within the pointer sentinel mixture model. The gate refers to the result of the gating function, with 1 indicating the RNN component is exclusively used whilst 0 indicates the pointer component is exclusively used. We begin with predictions that are using the RNN component primarily and move to ones that use the pointer component primarily. Figure 5. In predicting the fall season has been a good one especially for those retailers, the pointer component suggests many words from the historical window that would ï¬ t - retailers, investments, chains, and institutions.
1609.07843#39
1609.07843#41
1609.07843
[ "1607.03474" ]
1609.07843#41
Pointer Sentinel Mixture Models
The gate is still primarily weighted towards the RNN component however. Figure 6. In predicting the national cancer institute also projected that overall u.s. mortality, the pointer component is focused on mortality and rates, both of which would ï¬ t. The gate is still primarily weighted towards the RNN component. Figure 7. In predicting people do nâ t seem to be unhappy with it he said, the pointer component correctly selects said and is almost equally weighted with the RNN component. This is surprising given how frequent the word said is used within the Penn Treebank. Pointer Sentinel Mixture Models Predicting billion using 100 words of history (gate = 0.44) Figure 8. For predicting the federal government has had to pump in $ N billion, the pointer component focuses on the recent usage of billion with highly similar context. The pointer component is also relied upon more heavily than the RNN component - surprising given the frequency of billion within the Penn Treebank and that the usage was quite recent. Predicting noriega using 100 words of history (gate = 0.12) entity gen. douglas would have fallen out of the window in only four more timesteps, a fact that the RNN hidden state would not be able guessed the same word. This additionally illustrates why the gating function must be integrated into the pointer component. The named to accurately retain for almost 100 timesteps. Figure 9. For predicting (unk) â s ghost sometimes runs through the e ring dressed like gen. noriega, the pointer component reaches 97 timesteps back to retrieve gen. douglas. Unfortunately this prediction is incorrect but without additional context a human would have Predicting iverson using 100 words of history (gate = 0.03)
1609.07843#40
1609.07843#42
1609.07843
[ "1607.03474" ]
1609.07843#42
Pointer Sentinel Mixture Models
Figure 10. For predicting mr. iverson, the pointer component has learned the ability to point to the last name of the most recent named entity. The named entity also occurs 45 timesteps ago, which is longer than the 35 steps that most language models truncate their backpropagation to. Predicting rosenthal using 100 words of history (gate = 0.00) Figure 11. For predicting mr. rosenthal, the pointer is almost exclusively used and reaches back 65 timesteps to identify bruce rosenthal as the person speaking, correctly only selecting the last name. Predicting integrated using 100 words of history (gate = 0.00) Figure 12. For predicting in composite trading on the new york stock exchange yesterday integrated, the company Integrated and the (unk) token are primarily attended to by the pointer component, with nearly the full prediction being determined by the pointer component. Pointer Sentinel Mixture Models
1609.07843#41
1609.07843#43
1609.07843
[ "1607.03474" ]
1609.07843#43
Pointer Sentinel Mixture Models
# Zipï¬ an plot over WikiText-103 Zipf plot for WikiText 7 10 the 106 ry Oo a ry fo} rg ry fo} o servitude Absolute frequency of token 102 Schmerber 101 Goddet 10° 10° 101 102 103 104 105 106 Frequency rank of token Figure 13. Zipï¬ an plot over the training partition in the WikiText-103 dataset. With the dataset containing over 100 million tokens, there is reasonable coverage of the long tail of the vocabulary.
1609.07843#42
1609.07843
[ "1607.03474" ]
1609.08144#0
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
6 1 0 2 t c O 8 ] L C . s c [ 2 v 4 4 1 8 0 . 9 0 6 1 : v i X r a # Googleâ s Neural Machine Translation System: Bridging the Gap between Human and Machine Translation Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V. Le, Mohammad Norouzi yonghui,schuster,zhifengc,qvl,[email protected] Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, Jeï¬ Klingner, Apurva Shah, Melvin Johnson, Xiaobing Liu, Å ukasz Kaiser, Stephan Gouws, Yoshikiyo Kato, Taku Kudo, Hideto Kazawa, Keith Stevens, George Kurian, Nishant Patil, Wei Wang, Cliï¬ Young, Jason Smith, Jason Riesa, Alex Rudnick, Oriol Vinyals, Greg Corrado, Macduï¬ Hughes, Jeï¬ rey Dean
1609.08144#1
1609.08144
[ "1603.06147" ]
1609.08144#1
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
# Abstract Neural Machine Translation (NMT) is an end-to-end learning approach for automated translation, with the potential to overcome many of the weaknesses of conventional phrase-based translation systems. Unfortunately, NMT systems are known to be computationally expensive both in training and in translation inference â sometimes prohibitively so in the case of very large data sets and large models. Several authors have also charged that NMT systems lack robustness, particularly when input sentences contain rare words. These issues have hindered NMTâ s use in practical deployments and services, where both accuracy and speed are essential. In this work, we present GNMT, Googleâ s Neural Machine Translation system, which attempts to address many of these issues. Our model consists of a deep LSTM network with 8 encoder and 8 decoder layers using residual connections as well as attention connections from the decoder network to the encoder. To improve parallelism and therefore decrease training time, our attention mechanism connects the bottom layer of the decoder to the top layer of the encoder.
1609.08144#0
1609.08144#2
1609.08144
[ "1603.06147" ]
1609.08144#2
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
To accelerate the ï¬ nal translation speed, we employ low-precision arithmetic during inference computations. To improve handling of rare words, we divide words into a limited set of common sub-word units (â wordpiecesâ ) for both input and output. This method provides a good balance between the ï¬ exibility of â characterâ -delimited models and the eï¬ ciency of â wordâ -delimited models, naturally handles translation of rare words, and ultimately improves the overall accuracy of the system. Our beam search technique employs a length-normalization procedure and uses a coverage penalty, which encourages generation of an output sentence that is most likely to cover all the words in the source sentence. To directly optimize the translation BLEU scores, we consider reï¬ ning the models by using reinforcement learning, but we found that the improvement in the BLEU scores did not reï¬ ect in the human evaluation. On the WMTâ 14 English-to-French and English-to-German benchmarks, GNMT achieves competitive results to state-of-the-art. Using a human side-by-side evaluation on a set of isolated simple sentences, it reduces translation errors by an average of 60% compared to Googleâ s phrase-based production system.
1609.08144#1
1609.08144#3
1609.08144
[ "1603.06147" ]
1609.08144#3
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
1 # 1 Introduction Neural Machine Translation (NMT) [41, 2] has recently been introduced as a promising approach with the potential of addressing many shortcomings of traditional machine translation systems. The strength of NMT lies in its ability to learn directly, in an end-to-end fashion, the mapping from input text to associated output text. Its architecture typically consists of two recurrent neural networks (RNNs), one to consume the input text sequence and one to generate translated output text. NMT is often accompanied by an attention mechanism [2] which helps it cope eï¬ ectively with long input sequences. An advantage of Neural Machine Translation is that it sidesteps many brittle design choices in traditional phrase-based machine translation [26]. In practice, however, NMT systems used to be worse in accuracy than phrase-based translation systems, especially when training on very large-scale datasets as used for the very best publicly available translation systems. Three inherent weaknesses of Neural Machine Translation are
1609.08144#2
1609.08144#4
1609.08144
[ "1603.06147" ]
1609.08144#4
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
1 responsible for this gap: its slower training and inference speed, ineï¬ ectiveness in dealing with rare words, and sometimes failure to translate all words in the source sentence. Firstly, it generally takes a considerable amount of time and computational resources to train an NMT system on a large-scale translation dataset, thus slowing the rate of experimental turnaround time and innovation. For inference they are generally much slower than phrase-based systems due to the large number of parameters used. Secondly, NMT lacks robustness in translating rare words. Though this can be addressed in principle by training a â copy modelâ to mimic a traditional alignment model [31], or by using the attention mechanism to copy rare words [37], these approaches are both unreliable at scale, since the quality of the alignments varies across languages, and the latent alignments produced by the attention mechanism are unstable when the network is deep. Also, simple copying may not always be the best strategy to cope with rare words, for example when a transliteration is more appropriate. Finally, NMT systems sometimes produce output sentences that do not translate all parts of the input sentence â in other words, they fail to completely â coverâ
1609.08144#3
1609.08144#5
1609.08144
[ "1603.06147" ]
1609.08144#5
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
the input, which can result in surprising translations. This work presents the design and implementation of GNMT, a production NMT system at Google, that aims to provide solutions to the above problems. In our implementation, the recurrent networks are Long Short-Term Memory (LSTM) RNNs [23, 17]. Our LSTM RNNs have 8 layers, with residual connections between layers to encourage gradient ï¬ ow [21]. For parallelism, we connect the attention from the bottom layer of the decoder network to the top layer of the encoder network. To improve inference time, we employ low-precision arithmetic for inference, which is further accelerated by special hardware (Googleâ s Tensor Processing Unit, or TPU).
1609.08144#4
1609.08144#6
1609.08144
[ "1603.06147" ]
1609.08144#6
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
To eï¬ ectively deal with rare words, we use sub-word units (also known as â wordpiecesâ ) [35] for inputs and outputs in our system. Using wordpieces gives a good balance between the ï¬ exibility of single characters and the eï¬ ciency of full words for decoding, and also sidesteps the need for special treatment of unknown words. Our beam search technique includes a length normalization procedure to deal eï¬ ciently with the problem of comparing hypotheses of diï¬ erent lengths during decoding, and a coverage penalty to encourage the model to translate all of the provided input. Our implementation is robust, and performs well on a range of datasets across many pairs of languages without the need for language-speciï¬ c adjustments. Using the same implementation, we are able to achieve results comparable to or better than previous state-of-the-art systems on standard benchmarks, while delivering great improvements over Googleâ s phrase-based production translation system.
1609.08144#5
1609.08144#7
1609.08144
[ "1603.06147" ]
1609.08144#7
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
Speciï¬ cally, on WMTâ 14 English-to-French, our single model scores 38.95 BLEU, an improvement of 7.5 BLEU from a single model without an external alignment model reported in [31] and an improvement of 1.2 BLEU from a single model without an external alignment model reported in [45]. Our single model is also comparable to a single model in [45], while not making use of any alignment model as being used in [45].
1609.08144#6
1609.08144#8
1609.08144
[ "1603.06147" ]
1609.08144#8
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
Likewise on WMTâ 14 English-to-German, our single model scores 24.17 BLEU, which is 3.4 BLEU better than a previous competitive baseline [6]. On production data, our implementation is even more eï¬ ective. Human evaluations show that GNMT has reduced translation errors by 60% compared to our previous phrase-based system on many pairs of languages: English â French, English â Spanish, and English â Chinese. Additional experiments suggest the quality of the resulting translation system gets closer to that of average human translators. # 2 Related Work Statistical Machine Translation (SMT) has been the dominant translation paradigm for decades [3, 4, 5]. Practical implementations of SMT are generally phrase-based systems (PBMT) which translate sequences of words or phrases where the lengths may diï¬
1609.08144#7
1609.08144#9
1609.08144
[ "1603.06147" ]
1609.08144#9
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
er [26]. Even prior to the advent of direct Neural Machine Translation, neural networks have been used as a component within SMT systems with some success. Perhaps one of the most notable attempts involved the use of a joint language model to learn phrase representations [13] which yielded an impressive improvement when combined with phrase-based translation. This approach, however, still makes use of phrase-based translation systems at its core, and therefore inherits their shortcomings. Other proposed approaches for learning phrase representations [7] or learning end-to-end translation with neural networks [24] oï¬ ered encouraging hints, but ultimately delivered worse overall accuracy compared to standard phrase-based systems. The concept of end-to-end learning for machine translation has been attempted in the past (e.g., [8]) with
1609.08144#8
1609.08144#10
1609.08144
[ "1603.06147" ]
1609.08144#10
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
2 limited success. Following seminal papers in the area [41, 2], NMT translation quality has crept closer to the level of phrase-based translation systems for common research benchmarks. Perhaps the ï¬ rst successful attempt at surpassing phrase-based translation was described in [31]. On WMTâ 14 English-to-French, this system achieved a 0.5 BLEU improvement compared to a state-of-the-art phrase-based system. Since then, many novel techniques have been proposed to further improve NMT: using an attention mechanism to deal with rare words [37], a mechanism to model translation coverage [42], multi-task and semi-supervised training to incorporate more data [14, 29], a character decoder [9], a character encoder [11], subword units [38] also to deal with rare word outputs, diï¬ erent kinds of attention mechanisms [30], and sentence-level loss minimization [39, 34]. While the translation accuracy of these systems has been encouraging, systematic comparison with large scale, production quality phrase-based translation systems has been lacking.
1609.08144#9
1609.08144#11
1609.08144
[ "1603.06147" ]
1609.08144#11
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
# 3 Model Architecture Our model (see Figure 1) follows the common sequence-to-sequence learning framework [41] with attention [2]. It has three components: an encoder network, a decoder network, and an attention network. The encoder transforms a source sentence into a list of vectors, one vector per input symbol. Given this list of vectors, the decoder produces one symbol at a time, until the special end-of-sentence symbol (EOS) is produced. The encoder and decoder are connected through an attention module which allows the decoder to focus on diï¬ erent regions of the source sentence during the course of decoding. For notation, we use bold lower case to denote vectors (e.g., v, oi), bold upper case to represent matrices (e.g., U, W), cursive upper case to represent sets (e.g., V , T ), capital letters to represent sequences (e.g. X, Y ), and lower case to represent individual symbols in a sequence, (e.g., x1, x2). Let (X, Y ) be a source and target sentence pair. Let X = x1, x2, x3, ..., xM be the sequence of M symbols in the source sentence and let Y = y1, y2, y3, ..., yN be the sequence of N symbols in the target sentence. The encoder is simply a function of the following form: x1, x2, ..., xM = EncoderRN N (x1, x2, x3, ..., xM ) (1) In this equation, x1, x2, ..., xM is a list of ï¬ xed size vectors. The number of members in the list is the same as the number of symbols in the source sentence (M in this example). Using the chain rule the conditional probability of the sequence P (Y |X) can be decomposed as: P (Y |X) = P (Y |x1, x2, x3, ..., xM) = N Y P (yi|y0, y1, y2, ..., yiâ 1; x1, x2, x3, ..., xM) i=1 (2) where y0 is a special â beginning of sentenceâ symbol that is prepended to every target sentence. During inference we calculate the probability of the next symbol given the source sentence encoding and the decoded target sequence so far:
1609.08144#10
1609.08144#12
1609.08144
[ "1603.06147" ]
1609.08144#12
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
P (yi|y0, y1, y2, y3, ..., yiâ 1; x1, x2, x3, ..., xM) (3) Our decoder is implemented as a combination of an RNN network and a softmax layer. The decoder RNN network produces a hidden state yi for the next symbol to be predicted, which then goes through the softmax layer to generate a probability distribution over candidate output symbols. In our experiments we found that for NMT systems to achieve good accuracy, both the encoder and decoder RNNs have to be deep enough to capture subtle irregularities in the source and target languages. This observation is similar to previous observations that deep LSTMs signiï¬ cantly outperform shallow LSTMs [41]. In that work, each additional layer reduced perplexity by nearly 10%. Similar to [31], we use a deep stacked Long Short Term Memory (LSTM) [23] network for both the encoder RNN and the decoder RNN. Our attention module is similar to [2].
1609.08144#11
1609.08144#13
1609.08144
[ "1603.06147" ]
1609.08144#13
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
More speciï¬ cally, let yiâ 1 be the decoder-RNN output from the past decoding time step (in our implementation, we use the output from the bottom decoder layer). Attention 3 i Encoder LSTMs pus cpus : 8 ayers GPU3 * GPU2 i f GPUS | iâ > Attention H GPU2 i GPU2 } GPul } GPUL : Figure 1: The model architecture of GNMT, Googleâ s Neural Machine Translation system. On the left is the encoder network, on the right is the decoder network, in the middle is the attention module. The bottom encoder layer is bi-directional: the pink nodes gather information from left to right while the green nodes gather information from right to left. The other layers of the encoder are uni-directional. Residual connections start from the layer third from the bottom in the encoder and decoder. The model is partitioned into multiple GPUs to speed up training. In our setup, we have 8 encoder LSTM layers (1 bi-directional layer and 7 uni-directional layers), and 8 decoder layers. With this setting, one model replica is partitioned 8-ways and is placed on 8 diï¬ erent GPUs typically belonging to one host machine. During training, the bottom bi-directional encoder layers compute in parallel ï¬
1609.08144#12
1609.08144#14
1609.08144
[ "1603.06147" ]
1609.08144#14
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
rst. Once both ï¬ nish, the uni-directional encoder layers can start computing, each on a separate GPU. To retain as much parallelism as possible during running the decoder layers, we use the bottom decoder layer output only for obtaining recurrent attention context, which is sent directly to all the remaining decoder layers. The softmax layer is also partitioned and placed on multiple GPUs. Depending on the output vocabulary size we either have them run on the same GPUs as the encoder and decoder networks, or have them run on a separate set of dedicated GPUs.
1609.08144#13
1609.08144#15
1609.08144
[ "1603.06147" ]
1609.08144#15
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
context ai for the current time step is computed according to the following formulas: st = AttentionF unction(yiâ 1, xt) â t, 1 â ¤ t â ¤ M pt = exp(st)/ M X exp(st) â t, 1 â ¤ t â ¤ M t=1 ai = M X pt.xt t=1 (4) where AttentionF unction in our implementation is a feed forward network with one hidden layer. # 3.1 Residual Connections As mentioned above, deep stacked LSTMs often give better accuracy over shallower models. However, simply stacking more layers of LSTM works only to a certain number of layers, beyond which the network becomes
1609.08144#14
1609.08144#16
1609.08144
[ "1603.06147" ]
1609.08144#16
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
4 too slow and diï¬ cult to train, likely due to exploding and vanishing gradient problems [33, 22]. In our experience with large-scale translation tasks, simple stacked LSTM layers work well up to 4 layers, barely with 6 layers, and very poorly beyond 8 layers. © ®@ ® 2 9 ® + A LSTM, } cara oo >â ) fâ ) (stâ ¢,} > Th) â a STN2) »f xt xt x3 (3) â 0 Ly. iN spt = e CO â G apt = i XX (1stm, }>{ Lstm,}â >{ LstM,}>( LSTM, } EN A a » © © © Figure 2: The diï¬
1609.08144#15
1609.08144#17
1609.08144
[ "1603.06147" ]
1609.08144#17
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
erence between normal stacked LSTM and our stacked LSTM with residual connections. On the left: simple stacked LSTM layers [41]. On the right: our implementation of stacked LSTM layers with residual connections. With residual connections, input to the bottom LSTM layer (x0 i â s to LSTM1) is element-wise added to the output from the bottom layer (x1 i â s). This sum is then fed to the top LSTM layer (LSTM2) as the new input. Motivated by the idea of modeling diï¬ erences between an intermediate layerâ s output and the targets, which has shown to work well for many projects in the past [16, 21, 40], we introduce residual connections among the LSTM layers in a stack (see Figure 2). More concretely, let LSTMi and LSTMi+1 be the i-th and (i + 1)-th LSTM layers in a stack, whose parameters are Wi and Wi+1 respectively. At the t-th time step, for the stacked LSTM without residual connections, we have:
1609.08144#16
1609.08144#18
1609.08144
[ "1603.06147" ]
1609.08144#18
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
tâ 1, xiâ 1 t = LSTMi(ci t, mi ci t = mi xi t t = LSTMi+1(ci+1 , mi+1 tâ 1, mi ; Wi) t tâ 1, mi+1 tâ 1, xi t; Wi+1) (5) # ci+1 t where xi LSTMi at time step t, respectively. t is the input to LSTMi at time step t, and mi t and ci t are the hidden states and memory states of With residual connections between LSTMi and LSTMi+1, the above equations become: ci+1 t t = LSTMi(ci t, mi ci t + xiâ 1 xi t = mi t t = LSTMi+1(ci+1 , mi+1 tâ 1, mi tâ 1, xiâ 1 ; Wi) t tâ 1, mi+1 tâ 1, xi t; Wi+1) (6) Residual connections greatly improve the gradient ï¬ ow in the backward pass, which allows us to train very deep encoder and decoder networks. In most of our experiments, we use 8 LSTM layers for the encoder and decoder, though residual connections can allow us to train substantially deeper networks (similar to what was observed in [45]). # 3.2 Bi-directional Encoder for First Layer For translation systems, the information required to translate certain words on the output side can appear anywhere on the source side. Often the source side information is approximately left-to-right, similar to
1609.08144#17
1609.08144#19
1609.08144
[ "1603.06147" ]
1609.08144#19
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
5 # LY the target side, but depending on the language pair the information for a particular output word can be distributed and even be split up in certain regions of the input side. To have the best possible context at each point in the encoder network it makes sense to use a bi-directional RNN [36] for the encoder, which was also used in [2]. To allow for maximum possible parallelization during computation (to be discussed in more detail in section 3.3), bi-directional connections are only used for the bottom encoder layer â all other encoder layers are uni-directional. Figure 3 illustrates our use of bi-directional LSTMs at the bottom encoder layer. The layer LSTMf processes the source sentence from left to right, while the layer LSTMb processes the source sentence from right to left. Outputs from LSTMf ( t) and LSTMb â
1609.08144#18
1609.08144#20
1609.08144
[ "1603.06147" ]
1609.08144#20
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
â xb ( @ @ Bidirectional â ¢, Bottom Layer : Figure 3: The structure of bi-directional connections in the ï¬ rst layer of the encoder. LSTM layer LSTMf processes information from left to right, while LSTM layer LSTMb processes information from right to left. Output from LSTMf and LSTMb are ï¬ rst concatenated and then fed to the next LSTM layer LSTM1. # 3.3 Model Parallelism Due to the complexity of our model, we make use of both model parallelism and data parallelism to speed up training. Data parallelism is straightforward: we train n model replicas concurrently using a Downpour SGD algorithm [12]. The n replicas all share one copy of model parameters, with each replica asynchronously updating the parameters using a combination of Adam [25] and SGD algorithms. In our experiments, n is often around 10. Each replica works on a mini-batch of m sentence pairs at a time, which is often 128 in our experiments. In addition to data parallelism, model parallelism is used to improve the speed of the gradient computation on each replica. The encoder and decoder networks are partitioned along the depth dimension and are placed on multiple GPUs, eï¬ ectively running each layer on a diï¬ erent GPU. Since all but the ï¬ rst encoder layer are uni-directional, layer i + 1 can start its computation before layer i is fully ï¬
1609.08144#19
1609.08144#21
1609.08144
[ "1603.06147" ]
1609.08144#21
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
nished, which improves training speed. The softmax layer is also partitioned, with each partition responsible for a subset of symbols in the output vocabulary. Figure 1 shows more details of how partitioning is done. Model parallelism places certain constraints on the model architectures we can use. For example, we cannot aï¬ ord to have bi-directional LSTM layers for all the encoder layers, since doing so would reduce parallelism among subsequent layers, as each layer would have to wait until both forward and backward directions of the previous layer have ï¬
1609.08144#20
1609.08144#22
1609.08144
[ "1603.06147" ]
1609.08144#22
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
nished. This would eï¬ ectively constrain us to make use of only 2 GPUs 6 in parallel (one for the forward direction and one for the backward direction). For the attention portion of the model, we chose to align the bottom decoder output to the top encoder output to maximize parallelism when running the decoder network. Had we aligned the top decoder layer to the top encoder layer, we would have removed all parallelism in the decoder network and would not beneï¬ t from using more than one GPU for decoding.
1609.08144#21
1609.08144#23
1609.08144
[ "1603.06147" ]
1609.08144#23
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
# 4 Segmentation Approaches Neural Machine Translation models often operate with ï¬ xed word vocabularies even though translation is fundamentally an open vocabulary problem (names, numbers, dates etc.). There are two broad categories of approaches to address the translation of out-of-vocabulary (OOV) words. One approach is to simply copy rare words from source to target (as most rare words are names or numbers where the correct translation is just a copy), either based on the attention model [37], using an external alignment model [31], or even using a more complicated special purpose pointing network [18]. Another broad category of approaches is to use sub-word units, e.g., chararacters [10], mixed word/characters [28], or more intelligent sub-words [38]. # 4.1 Wordpiece Model Our most successful approach falls into the second category (sub-word units), and we adopt the wordpiece model (WPM) implementation initially developed to solve a Japanese/Korean segmentation problem for the Google speech recognition system [35]. This approach is completely data-driven and guaranteed to generate a deterministic segmentation for any possible sequence of characters. It is similar to the method used in [38] to deal with rare words in Neural Machine Translation. For processing arbitrary words, we ï¬ rst break words into wordpieces given a trained wordpiece model. Special word boundary symbols are added before training of the model such that the original word sequence can be recovered from the wordpiece sequence without ambiguity. At decoding time, the model ï¬ rst produces a wordpiece sequence, which is then converted into the corresponding word sequence. Here is an example of a word sequence and the corresponding wordpiece sequence:
1609.08144#22
1609.08144#24
1609.08144
[ "1603.06147" ]
1609.08144#24
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
â ¢ Word: Jet makers feud over seat width with big orders at stake â ¢ wordpieces: _J et _makers _fe ud _over _seat _width _with _big _orders _at _stake In the above example, the word â Jetâ is broken into two wordpieces â _Jâ and â etâ , and the word â feudâ is broken into two wordpieces â _feâ and â udâ . The other words remain as single wordpieces. â _â is a special character added to mark the beginning of a word.
1609.08144#23
1609.08144#25
1609.08144
[ "1603.06147" ]
1609.08144#25
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
The wordpiece model is generated using a data-driven approach to maximize the language-model likelihood of the training data, given an evolving word deï¬ nition. Given a training corpus and a number of desired tokens D, the optimization problem is to select D wordpieces such that the resulting corpus is minimal in the number of wordpieces when segmented according to the chosen wordpiece model. Our greedy algorithm to this optimization problem is similar to [38] and is described in more detail in [35]. Compared to the original implementation used in [35], we use a special symbol only at the beginning of the words and not at both ends. We also cut the number of basic characters to a manageable number depending on the data (roughly 500 for Western languages, more for Asian languages) and map the rest to a special unknown character to avoid polluting the given wordpiece vocabulary with very rare characters.
1609.08144#24
1609.08144#26
1609.08144
[ "1603.06147" ]
1609.08144#26
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
We ï¬ nd that using a total vocabulary of between 8k and 32k wordpieces achieves both good accuracy (BLEU scores) and fast decoding speed across all pairs of language pairs we have tried. As mentioned above, in translation it often makes sense to copy rare entity names or numbers directly from the source to the target. To facilitate this type of direct copying, we always use a shared wordpiece model for both the source language and target language. Using this approach, it is guaranteed that the same string in source and target sentence will be segmented in exactly the same way, making it easier for the system to learn to copy these tokens. Wordpieces achieve a balance between the ï¬ exibility of characters and eï¬ ciency of words. We also ï¬ nd that our models get better overall BLEU scores when using wordpieces â possibly due to the fact that our models now deal eï¬ ciently with an essentially inï¬ nite vocabulary without resorting to characters only. The 7
1609.08144#25
1609.08144#27
1609.08144
[ "1603.06147" ]