Regularizing Recurrent Neural Networks via Sequence Mixup
Abstract
In this paper, we extend a class of celebrated regularization techniques originally proposed for feed-forward neural networks, namely Input Mixup (Zhang et al., 2017) and Manifold Mixup (Verma et al., 2018), to the realm of Recurrent Neural Networks (RNN). Our proposed methods are easy to implement and have a low computational complexity, while leverage the performance of simple neural architectures in a variety of tasks. We have validated our claims through several experiments on real-world datasets, and also provide an asymptotic theoretical analysis to further investigate the properties and potential impacts of our proposed techniques. Applying sequence mixup to BiLSTM-CRF model (Huang et al., 2015) to Named Entity Recognition task on CoNLL-2003 data (Sang and De Meulder, 2003) has improved the F-1 score on the test stage and reduced the loss, considerably. ††Emails: {karamzade,najafy}@ce.sharif.edu, [email protected] ††An implementation of our method is avaiable at https://github.com/ArminKaramzade/SequenceMixup.
Data Analytics Laboratory (DAL),
Computer Engineering Department,
Sharif University of Technology, Tehran, Iran
1 Introduction
Recurrent neural networks are the basis of the state-of-the-art models in natural language processing, including language modeling (Mikolov et al., 2011), machine translation (Cho et al., 2014) and named entity recognition (Lample et al., 2016). It is needless to say that complex learning tasks require relatively large networks with millions of parameters to be accomplished. However, large neural networks need more data and/or strong regularization techniques to be trained successfully and avoid overfitting. Without the means to collect more data, which is the case in the majority of real-world problems, data augmentation and regularization methods are standard alternative practices to overcome this barrier.
Data augmentation in natural language processing is limited, and often task-specific (Kobayashi, 2018; Kafle et al., 2017). On the other hand, adopting the same regularization methods that are originally proposed for feed-forward (non-recurrent) networks needs to be done with extra care to avoid hurting the network’s information flow between consecutive time-steps. To overcome such limitations, we present Sequence Mixup: a set of training methods, regularization techniques, and data augmentation procedures for RNNs. Sequence Mixup can be considered as the RNN-generalization of input mixup (Zhang et al., 2017) and manifold mixup (Verma et al., 2018), which are already introduced for feed-forward neural networks. Generally speaking, the core idea behind mixup strategies is to mix training samples in the network’s input or hidden layers, where by mix, we simply mean to consider random convex combinations of pairs of samples as alternatives for the actual training data points. Mixup in non-recurrent networks has led to smoother decision boundaries, more robustness to adversarial examples, and better generalization compared to many rival regularization methods (Zhang et al., 2017; Verma et al., 2018). Here, we extend input mixup to RNNs and also propose two variants of manifold mixup, namely Pre-Output Mixup (POM) and Through-Time Mixup (TTM), where mixing occurs in the hidden space of the RNN. POM and TTM differ from each other in the way information flow is passed from one time-step to the next.
In order to elucidate the effect of sequence mixup during the learning stage, consider the classification of half-moons data plotted in figure 1(a) with a simple two-timestep RNN. We have also added some levels of noise to the original data points to make the classification task more challenging. Figures 1(b) and 1(c) show the learned decision boundaries from noisy data via regular training and Pre-Output Mixup, respectively. As can be seen, mixup expands the margin between the classes and increases the decision boundary levels, which in turn renders a smoother decision boundary with less certainty about nearby cross-class samples. Intuitively speaking, this type of training creates artificial samples whose labels and hidden states are obtained from intermixing those of the original samples, in a respective manner. Based on our experiments, applying sequence mixup has improved both the test F-1 score and loss of BiLSTM-CRF model (Huang et al., 2015) on CoNLL-03 data (Sang and De Meulder, 2003) (Section 4.3).



We have also provided a theoretical analysis on the impact of our regularization techniques in the asymptotic regime where network widths become increasingly large, and learning rates become infinitesimally small. In a nutshell, our analysis reveals that as long as the number of hidden state neurons, which we denote by in this work, is less than the number of distinct classes in a classification problem, both POM and TTM cannot achieve a zero training error regardless of how large the training dataset is or how deep the neural networks become. Moreover, we show that as long as is less than twice the number of classes, the hidden-state generating section of the RNN acts as a memoryless unit and produces hidden states that are almost independent of previous time-steps. On the other hand, given that is chosen sufficiently large, both POM and TTM are able to divide the hidden representation space of the RNN into a set of orthogonal affine subspaces, where each subspace is an indicator of a unique class. We refer to this property as spectral compression of sequence mixup, which is a similar behaviour to that of manifold mixup for feed-forward networks.
The rest of the paper is organized as follows: Section 2 reviews a number of related works to this problem. In Section 3, we propose Sequence Mixup, describe its challenges and specifications in detail, and also present our theoretical analysis. Section 4 is devoted to our experiments on real-world data. Finally, Section 5 concludes the paper.
2 Related Works
Data augmentation is a popular technique for training large neural networks; It implicitly regularizes the model, which ultimately leads to a lower generalization error. There are several methods for data augmentation in a variety of areas such as computer vision and speech recognition. For example, cropping, translation, rotation, resizing, and flipping are prevailing techniques for creating new artificial images in computer vision tasks (Shorten and Khoshgoftaar, 2019). Similarly, many successful methods such as SpecAugment (Park et al., 2019), vocal tract length perturbation (Jaitly and Hinton, 2013) and the stochastic feature mapping approach of Cui et al. (2017) have been proposed for data augmentation in speech recognition. However, data augmentation for natural language processing tasks is more challenging. One cannot simply employ signal transformation methods used in image and speech processing tasks, since altering the order of words in a sentence can change both its synthetic and semantic meanings. Majority of existing data augmentation techniques for text either rely on replacing a word with its close alternatives, or are only applicable to specific domains. For instance, Zhang et al. (2015) used a thesaurus to obtain synonyms of a word for replacement, Wang and Yang (2015) used -nearest neighbors and cosine similarity to find similar words, and more recently Kobayashi (2018) introduced contextual augmentation for extracting synonyms. Furthermore, Sennrich et al. (2016) employed a back translation technique for machine translation, and Kafle et al. (2017) made use of a number of generative models for producing new questions in a visual question answering task.
Popular regularization techniques used in feed-forward networks usually fail to work on recurrent neural networks. For example, weight decay prevents RNNs from learning long-term dependencies (Pascanu et al., 2013), and applying naive Dropout to RNNs causes deterioration of information flow through time-steps (Zaremba et al., 2014). Various types of Dropout have been adopted for RNNs without hurting its memorization capability, e.g., Zaremba et al. (2014) and Pham et al. (2014) applied Dropout only to non-recurrent sections of the network, Gal and Ghahramani (2016) used variational Dropout, Krueger et al. (2016) introduced Zoneout, and Merity et al. (2017) applied the same dropout mask to recurrent weights. Apart from Dropout-based strategies, Cooijmans et al. (2016) extended batch normalization (Ioffe and Szegedy, 2015) to RNNs for reducing internal covariate shift among time-steps. Also, Dieng et al. (2018) proposed Noisin for regularizing the network through injecting random noise into the hidden states of the RNN.
3 Sequence Mixup
In this section, we build upon both Input Mixup (Zhang et al., 2017) and Manifold Mixup (Verma et al., 2018) regularizations from non-recurrent networks and make them applicable on RNNs. First, a set of necessary mathematical notations and definitions need to be established: For a finite set of time indices , let us consider a recurrent neural network with input sequence , corresponding one-hot label sequence , set of hidden state vectors and class predictions for time-steps . Here, functions and represent the state-generating and output-generating neural architectures in the RNN, respectively. Figure 2 illustrates a block diagram which corresponds to the RNN described above. By a one-hot label , we simply mean a vector of dimension , with denoting the number of distinct classes in a given classification task, where the dimension that corresponds to a particular class is set to while others are . Also, let us assume the neural net that corresponds to function has output neurons, i.e., the hidden representation space is -dimensional. Throughout the paper, and for any two vectors and and coefficient , we denote by . Finally, let us denote as the given training dataset including sample pairs.
In the conventional mixup setting for feed-forward networks, we -mix randomly chosen samples from the training set (with , and usually sampled from a distribution) and then expose them to the network for learning. Here, by -mixing of two feature-label pairs and , we mean the artificial pair 111In this example, both feature and corresponding one-hot label are vectors, which are different from the RNN training dataset in this paper where input sample-pairs are sequences of length .. For the case of an RNN, this procedure becomes complicated since one can think of mixing different timesteps of input sequence pair with potentially different mixing coefficients . In fact, the sequence can be it naturally considered as a time-dependent stochastic process with preferably -distributed marginals.
To summarize our contribution, first, we introduce a computationally efficient way of drawing instances of with an arbitrary level of temporal correlation in section 3.2. Also, in Section 4.1, we investigate the role of temporal correlation among in the performance of models. Moreover, we show that extending manifold mixup of Verma et al. (2018) to the realm of RNNs can be done in several ways. In this regard, we propose two possible extensions and give an asymptotic theoretical analysis for them in Section 3.3. A detailed experimental investigation is also presented in Sections 4.2 and 4.3, respectively.
3.1 Algorithms
For each step of training with a mini-batch size of (extension to larger mini-batch sizes is straightforward), given mixup coefficients for all , and assuming two randomly selected sample sequences and from the training dataset , we propose a natural extension of input mixup as follows:
-
•
Sequence Input Mixup algorithm at each time step , replaces by and by for the two selected samples and , and for all . This procedure is illustrated in Figure 3(a).
Also, we present two possible extensions for manifold mixup as:
The main difference between POM and TTM is that the latter keeps only one shared hidden representation for both sample pairs, while the former allows each pair to have their own flow historical information. More specifically, POM replaces by and by , while TTM replaces by and by . We have skipped the detailed algorithmic explanation of mixup training in this paper for the sake of readability. An interested reader can find such information in the original papers by Zhang et al. (2017) and Verma et al. (2018), respectively.
Remark 1
Even though we originally propose sequence mixup for sequence tagging, adopting each of its methods for other similar tasks is straightforward. For example in sequence classification, mixing the labels is equivalent to replacing sequence label with , where is the empirical mean of process .
3.2 Temporal Dependency Of Mixing Coefficients
In order to choose , Zhang et al. (2017) and Verma et al. (2018) employed the Beta distribution, , for selecting coefficients in non-recurrent neural networks, where hyper-parameter is usually adjusted for each particular task. Following the same strategy, we have also used the Beta distribution to generate mixup coefficient sequence . However, the set of coefficients are time-series data and therefore can be correlated through time. In fact, since both input and output sequences have potentially important time-varying dependencies, it is natural to design s with some levels of temporal correlation. In section 4, we have experimentally shown that correlation level of mixup coefficients has a meaningful impact on the performance of the model. Interestingly, for each particular task, fixing the spectral bandwidth of to a corresponding optimal value across the time reduces the loss of the base-line model.
In order to generate the mixup coefficients, we create a non-stationary Markov process with varying correlation levels as follows:
where and are computed by solving the following set of equations:
(2) |
There are closed-form formulas for efficiently computing s for each time-step. Here, user-defined hyper-parameter controls the level of dependency through time. Specifically, smooths the trajectory of coefficients by forcing to be close to through fixing its conditional mean near the and reducing its conditional variance.
3.3 Asymptotic Theoretical Analysis
In this part, we present the main theoretical results regarding the asymptotic analysis of sequence mixup, and Pre-Output Mixup (POM) technique in particular. Here, we attempt to give a more intuitive insight regarding our theoretical findings while mathematical details, notations and formal definitions are explained in Appendix A. Roughly speaking, the term “asymptotic” refers to the following two assumed properties:
-
•
Hidden layer widths (or depths, but not necessarily both) of the neural networks corresponding to functions and in Figure 3 become asymptotically large.
-
•
The learning rate which governs the training stage becomes infinitesimally small, which forces the number of training iterations to be increasingly large. This property makes it safe to assume that all possible pairs of samples in the batch have been mixed several times during the training stage.
As already mentioned in Section 1, let us denote the number of output neurons for function as . Also, it should be reminded that the number of classes in the classification problem has been denoted by . Then, we initially prove the following property for both POM and TTM:
Theorem 1 (Over-Regularization)
For any given RNN architecture and classification task, assume we have . Then, for an infinitesimally small learning rate , any training dataset size , and regardless of the vertical or horizontal sizes of neural networks corresponding to functions and , training error of both POM and TTM cannot strictly become, or asymptotically approach toward, zero.
Proof of Theorem 1 is discussed in Appendix A. Theorem 1 states that when is chosen to be smaller than , with being the number of classes in the problem, one just over-regularizes the RNN via POM or TTM. In other words, the RNN cannot be trained to zero-force the training error regardless of the complexity of its built-in neural nets and thus suffers from a non-zero bias error 222Note that due to Universal Approximation Theorem (Cybenko, 1989), non-regularized and asymptotically large neural nets always completely overfit to a finite-size training dataset, i.e., training error always become or asymptotically approach towards zero.. The following two theorems only hold for POM, however, similar arguments might hold for TTM as well.
Theorem 2
For any given RNN architecture and classification task, assume we have . Then, for any training dataset size , an infinitesimally small learning rate , and asymptotically large vertical and/or horizontal sizes of the neural networks corresponding to and , the following argument holds for the asymptotic solution of POM, denoted by :
acts as an almost memory-less unit, i.e., there exists function such that for all :
Theorem 2 roughly states that in order to enable POM solution to use the information of previous time-steps (through ), one has to make sure that is at least almost twice the number of distinct classes . Otherwise, only makes use of the previous label and current feature to estimate , which means the state vector that carries the information of all previous time-steps would be ignored. The final theorem which is stated below is the most important property of POM (and probably TTM), which describes their ability to linearly separate different classes in the representation space.
Theorem 3 (Spectral Compression Property)
For any given RNN architecture, classification task, and training dataset size , assume we have . Also, assume POM is used for regularization with an infinitesimally small learning rate , asymptotically large vertical and/or horizontal sizes of neural nets corresponding to and , and an arbitrary mini-batch size for training. Also, let us denote the learned RNN functions by and , respectively. Then, the output-generating function is (at least locally) linear, i.e., there exists and such that
where denotes the convex hull of a set of points. Also, divides the representation space into a set of orthogonal affine subspaces , such that for all , we have: where represents a one-hot vector with its th component being and the rest being . Also, the following equality holds w.r.t. dimensions of affine subspaces :
Spectral compression property is the main essence of hidden-state-based mixup strategies, i.e., manifold mixup for feed-forward nets and the proposed Pre-Output Mixup for RNNs. It shows that the mixup regularizer, when applied to the hidden states of neural nets, forces the core network to map data samples with different labels into distinct orthogonal affine subspaces of the representation space. Also, it dictates that the output-generating network mimics a simple linear unit. This property, which is partially validated through our experiments in Section 4 (even for non-asymptotic neural architectures), means that the spectral power distribution of hidden-state vectors for samples with the same label becomes more compact compared to non-regularized cases.
4 Experiments
In this section, three sets of experiments have been provided: In Section 4.1, we have studied the performance of sequence mixup as the correlation between mixup coefficients varies in time. In Section 4.2, spectral compression property of POM and TMM have been studied. Finally, in Section 4.3, we have compared the performance of sequence mixup with standard training. All experiments have been conducted on the named entity recognition task over CoNLL-2003 data (Sang and De Meulder, 2003).
4.1 Correlation of Mixup Coefficients
We define the baseline model as a model consisting of an embedding layer initialized with weights of Glove embedding (Pennington et al., 2014) followed by a single layer recurrent network with hidden size of , and finally a layer to map hidden states to class scores.


We have trained the baseline model with LSTM cell, epochs using stochastic gradient descent with an initial learning rate of (while halving it after each epochs). Also, cross-entropy is chosen as the measure of loss. Sequence mixup training with mixup coefficients generated from the Markov process of Section 3.2 (with and varying ) have been separately utilized for training. Figure 4 illustrates the model’s F-1 score and loss on the test data as a function of for Sequence Input Mixup, Pre-Output Mixup and Through-Time Mixup, respectively. As it is evident, the choice of , which is equivalent to setting all identical, has maximum test F-1 on all methods. Also, choosing a particular intermediate value for has the worst effect on test loss.
4.2 Spectral Compression
Based on the theoretical results in Section 3.3, POM (and possibly TTM) divide the hidden state of an RNN to orthogonal affine subspaces in the -dimensional representation space, where each subspace associates to a particular class index. This behavior will compress hidden states of samples within the same class into a lower-dimensional space. We have tried Singular Value Decomposition (SVD) to capture this effect by analyzing the spectral power compactness of the corresponding singular values.
Figure 5 plots the largest singular values obtained from hidden state vectors of training data which correspond to the same label, for two randomly selected and distinct labels. The baseline model with LSTM cell and is employed and subsequently trained with regular training, POM, and TTM, respectively. As demonstrated in the figure, more compact singular value distributions for POM and TTM suggest that hidden states for such methods lie on a compact and lower-dimensional subspace compared to the case of standard training. This observation is in agreement with the Spectral Compression Property, which is proved for asymptotic network architectures in Section 3.3.


4.3 Evaluation
Table 1 shows the F-1 scores of the baseline model on the test data with various cell types when trained with and without Sequence Mixup for different values of . We have set for generating mixup coefficients, as suggested by the previous result. Details of the experiments are similar to that of Section 4.1.
cell | Standard | alpha | Sequence Input Mixup | POM | TTM |
---|---|---|---|---|---|
RNN | |||||
GRU | |||||
LSTM | |||||
In Table 2, we have trained biLSTM-CRF model (Huang et al., 2015) with combination of contextual word embeddings (Akbik et al., 2018) and Glove embeddings (Pennington et al., 2014). The model specification is the same as Huang et al. (2015) for CoNLL-2003 on named entity recognition task. Specifically, there is an embedding layer initialized with contextual word embeddings and Glove, followed by a single-layer bidirectional LSTM with hidden size of , and finally a linear layer to generate the class scores. Similarly, for training, we followed the Akbik et al. (2018) and trained the model using Vanilla stochastic gradient descent, clipping gradients at for epochs with batch size of . For scheduling the learning rate, we halve it if training loss doesn’t improve for consecutive epochs. When training the model without mixup, we use locked dropout (Merity et al., 2017) and word-level dropout as used by Akbik et al. (2018). However, while using Sequence Mixup, we only utilize locked dropout to avoid the over-regularization problem. We perform model selection over , choosing the model with the minimum F-1 score on the validation set. Mixup coefficients then set to a random sample from across the sentence – same as setting in the previous part, and the model trains with both training and validation set. Experiments are then repeated times to obtain the mean and standard deviation of the F-1 score and loss, respectively.
Denoting target sequence of length by , predicted class scores by and transition matrix of the CRF model by , biLSTM-CRF model of Huang et al. (2015) scores each sequence by333For the ease of notations, here, denotes the class index which corresponds to the already-defined one-hot vector .
and computes the loss function as cross-entropy between one-hot label of the whole sequence among all possible sequences and the distribution of sequence scores. Applying Sequence Mixup methods, converts each sequence score to
for two samples and .
biLSTM-CRF | F-1 | Test NLL |
---|---|---|
Standard | ||
Sequence Input Mixup () | ||
Pre-Output Mixup () | ||
Through-Time Mixup () |
According to Table 2, TTM’s F-1 on the test data has gotten worse than standard training. This may be due to the fact that TTM is a much stronger regularizer than the other two, which them means it does not need locked dropout as an extra regularization. Interestingly, the loss of Sequence Mixup methods is much smaller than regular training, which consolidates the claim that Sequence Mixup renders a decision boundary with less certainty about difficult-to-classify instances.
5 Conclusion
We introduce Sequence Mixup, a set of regularization and data augmentation techniques for RNNs. Our work can thought as extending both input mixup (Zhang et al., 2017) and manifold mixup (Verma et al., 2018), which are originally porposed for feed-forward neural nets. For the case of manifold mixup, we propose two distinct variants called Pre-Output and Throgh-Time Mixup, respectively. An asymptotic theoretical analysis reveals that Pre-Output Mixup imposes (at least) a locally linear behavior on the network’s output generating section. In a classification task, this property leads to partitioning of the hidden representation space into a set of orthogonal affine subspaces, each of which corresponds to a unique class. Experimental results showed improvement on the loss and F-1 scores of both 1) a baseline and 2) state-of-the-art model on CoNLL-2003 NER task. We have studied the correlation of mixup coefficients through consecutive time-steps, and found out that using identical coefficients achieves better loss and F-1 on the NER task. However, at the same time, we conjecture that optimal correlation values for mixup coefficients across time may vary from task to task and thus requires experimental exploration to be adjusted. Lastly, the considerable reduction in the test loss achieved by sequence mixup methods (Section 4.3) implies that employing sequence mixup methods for language models may lead to a substantial improvement on the test perplexity.
References
- Akbik et al. (2018) Akbik, A., D. Blythe, and R. Vollgraf (2018). Contextual string embeddings for sequence labeling. In Proceedings of the 27th International Conference on Computational Linguistics, pp. 1638–1649.
- Cho et al. (2014) Cho, K., B. van Merriënboer, C. Gulcehre, D. Bahdanau, F. Bougares, H. Schwenk, and Y. Bengio (2014). Learning phrase representations using rnn encoder–decoder for statistical machine translation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 1724–1734.
- Cooijmans et al. (2016) Cooijmans, T., N. Ballas, C. Laurent, Ç. Gülçehre, and A. Courville (2016). Recurrent batch normalization. arXiv preprint arXiv:1603.09025.
- Cui et al. (2017) Cui, X., V. Goel, and B. E. D. Kingsbury (2017, February). Data augmentation method based on stochastic feature mapping for automatic speech recognition. (20170040016).
- Cybenko (1989) Cybenko, G. (1989). Approximation by superpositions of a sigmoidal function. Mathematics of control, signals and systems 2(4), 303–314.
- Dieng et al. (2018) Dieng, A. B., R. Ranganath, J. Altosaar, and D. M. Blei (2018). Noisin: Unbiased regularization for recurrent neural networks. In 35th International Conference on Machine Learning, ICML 2018, pp. 2030–2039. International Machine Learning Society (IMLS).
- Gal and Ghahramani (2016) Gal, Y. and Z. Ghahramani (2016). Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In international conference on machine learning, pp. 1050–1059.
- Huang et al. (2015) Huang, Z., W. Xu, and K. Yu (2015). Bidirectional lstm-crf models for sequence tagging. arXiv preprint arXiv:1508.01991.
- Ioffe and Szegedy (2015) Ioffe, S. and C. Szegedy (2015). Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning, pp. 448–456.
- Jaitly and Hinton (2013) Jaitly, N. and G. E. Hinton (2013). Vocal tract length perturbation (vtlp) improves speech recognition. In Proc. ICML Workshop on Deep Learning for Audio, Speech and Language, Volume 117.
- Kafle et al. (2017) Kafle, K., M. Yousefhussien, and C. Kanan (2017, September). Data augmentation for visual question answering. In Proceedings of the 10th International Conference on Natural Language Generation, Santiago de Compostela, Spain, pp. 198–202. Association for Computational Linguistics.
- Kobayashi (2018) Kobayashi, S. (2018, June). Contextual augmentation: Data augmentation by words with paradigmatic relations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), New Orleans, Louisiana, pp. 452–457. Association for Computational Linguistics.
- Krueger et al. (2016) Krueger, D., T. Maharaj, J. Kramár, M. Pezeshki, N. Ballas, N. R. Ke, A. Goyal, Y. Bengio, A. Courville, and C. Pal (2016). Zoneout: Regularizing rnns by randomly preserving hidden activations. arXiv preprint arXiv:1606.01305.
- Lample et al. (2016) Lample, G., M. Ballesteros, S. Subramanian, K. Kawakami, and C. Dyer (2016). Neural architectures for named entity recognition. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 260–270.
- Merity et al. (2017) Merity, S., N. S. Keskar, and R. Socher (2017). Regularizing and optimizing lstm language models. arXiv preprint arXiv:1708.02182.
- Mikolov et al. (2011) Mikolov, T., S. Kombrink, L. Burget, J. Černockỳ, and S. Khudanpur (2011). Extensions of recurrent neural network language model. In 2011 IEEE international conference on acoustics, speech and signal processing (ICASSP), pp. 5528–5531. IEEE.
- Park et al. (2019) Park, D. S., W. Chan, Y. Zhang, C.-C. Chiu, B. Zoph, E. D. Cubuk, and Q. V. Le (2019). Specaugment: A simple augmentation method for automatic speech recognition.
- Pascanu et al. (2013) Pascanu, R., T. Mikolov, and Y. Bengio (2013). On the difficulty of training recurrent neural networks. In International conference on machine learning, pp. 1310–1318.
- Pennington et al. (2014) Pennington, J., R. Socher, and C. D. Manning (2014). Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pp. 1532–1543.
- Pham et al. (2014) Pham, V., T. Bluche, C. Kermorvant, and J. Louradour (2014). Dropout improves recurrent neural networks for handwriting recognition. In 2014 14th international conference on frontiers in handwriting recognition, pp. 285–290. IEEE.
- Sang and De Meulder (2003) Sang, E. F. and F. De Meulder (2003). Introduction to the conll-2003 shared task: Language-independent named entity recognition. arXiv preprint cs/0306050.
- Sennrich et al. (2016) Sennrich, R., B. Haddow, and A. Birch (2016, August). Improving neural machine translation models with monolingual data. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), Berlin, Germany, pp. 86–96. Association for Computational Linguistics.
- Shorten and Khoshgoftaar (2019) Shorten, C. and T. M. Khoshgoftaar (2019). A survey on image data augmentation for deep learning. Journal of Big Data 6(1), 60.
- Verma et al. (2018) Verma, V., A. Lamb, C. Beckham, A. Najafi, I. Mitliagkas, A. Courville, D. Lopez-Paz, and Y. Bengio (2018). Manifold mixup: Better representations by interpolating hidden states. arXiv preprint arXiv:1806.05236.
- Wang and Yang (2015) Wang, W. Y. and D. Yang (2015, September). That’s so annoying!!!: A lexical and frame-semantic embedding based data augmentation approach to automatic categorization of annoying behaviors using #petpeeve tweets. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, Lisbon, Portugal, pp. 2557–2563. Association for Computational Linguistics.
- Zaremba et al. (2014) Zaremba, W., I. Sutskever, and O. Vinyals (2014). Recurrent neural network regularization. arXiv preprint arXiv:1409.2329.
- Zhang et al. (2017) Zhang, H., M. Cisse, Y. N. Dauphin, and D. Lopez-Paz (2017). mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412.
- Zhang et al. (2015) Zhang, X., J. Zhao, and Y. LeCun (2015). Character-level convolutional networks for text classification. In Advances in neural information processing systems, pp. 649–657.
Appendix A Asymptotic Theoretical Analysis: Details
In this section, we theoretically analyze the asymptotic aspects of some of our regularization techniques during the training stage. The term asymptotic here implies that our analysis only considers cases where the width of the neural networks used in the architecture of RNNs, and also the number of SGD iterations in the training stage go to infinity. Non-asymptotic analyzes have also been done w.r,t. neural networks, however, their depth, scope and achievements have been considerably limited due to the inherent technical difficulty of the problem. Consideration of asymptotically wide neural nets (when the number of neurons in the hidden layer goes to infinity) allow us to take advantage of the Universal Approximation Theorem (UAT) (Cybenko, 1989) in order to facilitate the behaviour and performance analysis of neural networks.
First, let us introduce a number of necessary notations that we use in this section. We show the empirical distribution of data samples by
(3) |
where denotes the tuple showing the th training sample consisting of feature vector and one-hot label vector . Here, denotes the number of classes in our supervised learning problem. Let represent the hypothesis set corresponding to neural network classifiers with output neurons, which have at least hidden layers, and at least neurons per each hidden layer. Throughout this section, we assume with .
Training with Input or Manifold Mixup cannot be readily formulated into a manageable analytic format unless one assumes very small gradient descent steps and a consequently large number of iterations. Let us assume stochastic gradient descent (SGD) with a mini-batch size of is used to optimize the loss function associated to any of the Input and/or Manifold Mixup regularization techniques described in Section 3. Also, let denote the number of SGD iterations during the training stage. In this section, we are particularly interested in an asymptotic regime where both and go to infinity. In other words, we set out to investigate the properties of the solution neural networks and defined as
(4) |
We show that regardless of the size of the training dataset , or the inherent hardness of the learning task, under ceration conditions there exist and which give a zero value for the empirical loss function .
A.1 Asymptotic Theory of Pre-Output Mixup (POM)
In this part, we analyze Pre-Output Mixup (POM) regularization technique. Assuming an infinitely large number of training iterations, the following equality holds almost surely according to the law of large numbers:
where and are training sequences randomly and independently chosen from the empirical data distribution , and are temporal state vectors and , respectively, and is an arbitrary Ergodic stochastic process with marginal Beta distributions. The process is assumed to be independent from the random choice of training sequence pairs and .
Based on the independence assumption between stochastic processes and , the empirical error for asymptotic regime of can be rewritten and subsequently simplified as follows:
(5) | ||||
where for a finite set of vector sequences means the th time-instance of the th member in the set. Equation (5) implies that in order to get a zero training error, one must have the following equality for all and :
(6) |
where indicates the set of all values with and denotes the conditional probability measure of stochastic process . Recall that has been assumed to be an Ergodic real-valued stochastic process, which makes (6) to hold only when
(7) | ||||
(8) | ||||
The condition (8) dictates a locally linear behaviour for the presumed optimal neural network . In other words, is supposed to act as a linear function between any two pairs of points . Obviously, the local linear behaviour is satisfied if we just let be a linear function throughout its input space. In fact, an important implication of the above analytic statement regarding is that adding extra hidden layers for the output-generating neural net in order to make it more flexible for imitating nonlinear relations is totally redundant. This it due to the fact that the whole network still tries to imitate a linear function which can be simply attained with zero hidden layers.
By assuming the global linearity property for , we have the following relation for the optimal function , with denoting the number of neurons for the hidden state vector :
(9) |
where is an dimensional matrix and . The following statements still hold even if we only consider the proved local linearity property of . However, we omit further analytical details for the sake of simplicity and stick to the global linearity assumption. On the other hand, for all we must have
(12) |
The equalities above almost surely hold under mild conditions which are derived in the remainder of this section. The fundamental reason for this phenomenon is that we have already assumed ; Then, based on the universal approximation theorem, the function set with becomes dense in the space of functions , with denoting the dimension of input feature vectors. In other words, is simply assumed to be able to approximate any function with an arbitrarily small error bound which solely depends on the network’s width and goes to zero as is being increased.
Note that one-hot label vectors are finite. In fact, there are only possible distinct label vectors , where represents a one-hot -dimensional vector where the th component is and the rest are . In other words, the linear function has been assumed to map the set of -dimensional real-valued vectors to the set of linearly independent vectors .
Let be the matrix whose columns are members of . Also, let be a matrix, which is similarly attained from . Then, we have the following relation:
(13) |
The above equality has a number of interesting implications for the optimal neural network :
-
•
First, it should be noted that the r.h.s. of (13) is at least rank (assuming we have at least one observation from each class in the training dataset ), while the l.h.s. is at most rank . Then, in order to get a zero training error for Pre-Output Mixup regularizer, we must have . It should be reminded that is in fact the number of output neurons for . This result is in agreement with the analysis of the Manifold Mixup technique presented by Verma et al. (2018), where the latter only considers non-recurrent frameworks.
-
•
Second, the hidden state subsets for must lie in separate and orthogonal linear subspaces . In other words, we have , and for . We also have
(14)
In this regard, the neural network function acts as a state-changing machine that switches among orthogonal subspaces in the hidden-state space according to the input feature vector . More specifically, assume the machine is at state and has produced the label . Therefore, the state vector must lie in the low-dimensional subspace which is uniquely determined by through the procedure described earlier (we have , where is a linear function). At time step , the input vector is applied to the machine and its state would be changed to which lies on the low-dimensional subspace , again uniquely characterized by the label at time , shown as .
Interestingly, we have for all where is a fixed mapping from the set of all possible one-hot labels to a set of low-dimensional subspaces in , i.e. . That means the subspace encompassing the hidden state does not depend on the history of the sequence and is uniquely identified by the current label . However, if we have , then can still take infinitely many values and thus would be able to store information about the past. Therefore, in order to provide the architecture with capability of storing information about the history of a sequence rather than just the current labels, the following inequality must hold:
(15) |
which means one should have .