Venue: ACL 2020

# BPE-Dropout: Simple and Effective Subword Regularization

Ivan Provilkov\({}^{*}\)1,2  Dmitrii Emelianenko\({}^{*}\)1,3  Elena Voita\({}^{4,5}\)

Footnote 1: Equal contribution.

###### Abstract

Subword segmentation is widely used to address the open vocabulary problem in machine translation. The dominant approach to subword segmentation is Byte Pair Encoding (BPE), which keeps the most frequent words intact while splitting the rare ones into multiple tokens. While multiple segmentations are possible even with the same vocabulary, BPE splits words into unique sequences; this may prevent a model from better learning the compositionality of words and being robust to segmentation errors. So far, the only way to overcome this BPE imperfection, its deterministic nature, was to create another subword segmentation algorithm Kudo (2018). In contrast, we show that BPE itself incorporates the ability to produce multiple segmentations of the same word. We introduce _BPE-dropout_ - simple and effective subword regularization method based on and compatible with conventional BPE. It stochastically corrupts the segmentation procedure of BPE, which leads to producing multiple segmentations within the same fixed BPE framework. Using _BPE-dropout_ during training and the standard BPE during inference improves translation quality up to 2.3 BLEU compared to BPE and up to 0.9 BLEU compared to the previous subword regularization.

+
Footnote †: _Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics_, pages 1882–1892

Dmitrii Emelianenko\({}^{*}\)1,3  Elena Voita\({}^{4,5}\)

Footnote 1: email: jv@nwm.nih.gov

\({}^{1}\)Yandex, Russia

\({}^{2}\)Moscow Institute of Physics and Technology, Russia

\({}^{3}\)National Research University Higher School of Economics, Russia

\({}^{4}\)University of Edinburgh, Scotland  \({}^{5}\)University of Amsterdam, Netherlands

{iv-provilkov, dimdi-y, lena-voita}@yandex-team.ru

## 1 Introduction

Using subword segmentation has become de-facto standard in Neural Machine Translation Bojar et al. (2018); Barrault et al. (2019). Byte Pair Encoding (BPE) Sennrich et al. (2016) is the dominant approach to subword segmentation. It keeps the common words intact while splitting the rare and unknown ones into a sequence of subword units. This potentially allows a model to make use of morphology, word composition and transliteration. BPE effectively deals with an opervocabulary problem and is widely used due to its simplicity.

There is, however, a drawback of BPE in its deterministic nature: it splits words into unique subword sequences, which means that for each word a model observes only one segmentation. Thus, a model is likely not to reach its full potential in exploiting morphology, learning the compositionality of words and being robust to segmentation errors. Moreover, as we will show further, subwords into which rare words are segmented end up poorly understood.

A natural way to handle this problem is to enable multiple segmentation candidates. This was initially proposed by Kudo (2018) as a subword regularization - a regularization method, which is implemented as an on-the-fly data sampling and is not specific to NMT architecture. Since standard BPE produces single segmentation, to realize this regularization the author had to propose a new subword segmentation, different from BPE. However, the introduced approach is rather complicated: it requires training a separate segmentation unigram language model, using EM and Viterbi algorithms, and forbids using conventional BPE.

In contrast, we show that BPE itself incorporates the ability to produce multiple segmentations of the same word. BPE builds a vocabulary of subwords and a merge table, which specifies which subwords have to be merged into a bigger subword, as well as the priority of the merges. During segmentation, words are first split into sequences of characters, then the learned merge operations are applied to merge the characters into larger, known symbols, till no merge can be done (Figure 1(a)). We introduce _BPE-dropout_ - a subword regularization method based on and compatible with conventional BPE. It uses a vocabulary and a

merge table built by BPE, but at each merge step, some merges are randomly dropped. This results in different segmentations for the same word (Figure 1). Our method requires no segmentation training in addition to BPE and uses standard BPE at test time, therefore is simple. _BPE-dropout_ is superior compared to both BPE and Kudo (2018) on a wide range of translation tasks, therefore is effective.

Our key contributions are as follows:

* a simple and effective subword regularization method;
* We show that our method outperforms both BPE and previous subword regularization on a wide range of translation tasks;
* We analyze how training with _BPE-dropout_ affects a model and show that it leads to a better quality of learned token embeddings and to a model being more robust to noisy input.

## 2 Background

In this section, we briefly describe BPE and the concept of subword regularization. We assume that our task is machine translation, where a model needs to predict the target sentence \(Y\) given the source sentence \(X\), but the methods we describe are not task-specific.

### Byte Pair Encoding (BPE)

To define a segmentation procedure, BPE Sennrich et al. (2016) builds a token vocabulary and a merge table. The token vocabulary is initialized with the character vocabulary, and the merge table is initialized with an empty table. First, each word is represented as a sequence of tokens plus a special end of word symbol. Then, the method iteratively counts all pairs of tokens and merges the most frequent pair into a new token. This token is added to the vocabulary, and the merge operation is added to the merge table. This is done until the desired vocabulary size is reached.

The resulting merge table specifies which subwords have to be merged into a bigger subword, as well as the priority of the merges. In this way, it defines the segmentation procedure. First, a word is split into distinct characters plus the end of word symbol. Then, the pair of adjacent tokens which has the highest priority is merged. This is done iteratively until no merge from the table is available (Figure 1).

### Subword regularization

Subword regularization Kudo (2018) is a training algorithm which integrates multiple segmentation candidates. Instead of maximizing log-likelihood, this algorithm maximizes log-likelihood marginalized over different segmentation candidates. Formally,

\[{\mathcal{L}}=\sum_{(X,Y)\in D}\mathop{\mathbb{E}}_{\begin{subarray}{c}x\sim P (x|X)\\ y\sim P(y|Y)\end{subarray}}\log P(y|x,\theta), \tag{1}\]

where \(x\) and \(y\) are sampled segmentation candidates for sentences \(X\) and \(Y\) respectively, \(P(x|X)\) and \(P(y|Y)\) are the probability distributions the candidates are sampled from, and \(\theta\) is the set of model parameters. In practice, at each training step only one segmentation candidate is sampled.

Since standard BPE segmentation is deterministic, to realize this regularization Kudo (2018) proposed a new subword segmentation. The introduced approach requires training a separate segmentation unigram language model to predict the probability of each subword, EM algorithm to optimize the vocabulary, and Viterbi algorithm to make samples of segmentations.

Subword regularization was shown to achieve significant improvements over the method using a single subword sequence. However, the proposed method is rather complicated and forbids using

Figure 1: Segmentation process of the word ‘_unrelated_’ using (a) BPE, (b) _BPE-dropout_. Hyphens indicate possible merges (merges which are present in the merge table); merges performed at each iteration are shown in green, dropped – in red.

 

conventional BPE. This may prevent practitioners from using subword regularization.

## 3 Our Approach: BPE-Dropout

We show that to realize subword regularization it is not necessary to reject BPE since multiple segmentation candidates can be generated within the BPE framework. We introduce _BPE-dropout_ - a method which exploits the innate ability of BPE to be stochastic. It alters the segmentation procedure while keeping the original BPE merge table. During segmentation, at each merge step some merges are randomly dropped with the probability \(p\). This procedure is described in Algorithm 1.

```
current_split \(\leftarrow\) characters from input_word; do \(merges\)\(\leftarrow\) all possible merges1 of tokens from\(current\_split\); for\(merge\)from\(merges\)do /* The only difference from BPE */ remove \(merge\) from \(merges\) with the probability \(p\); end if if\(merges\)is not emptythen \(merge\)\(\leftarrow\) select the merge with the highest priority from \(merges\); apply \(merge\) to \(current\_split\);  end while while\(mergeds\)is not emptythen return\(\_\)sprint;
```

**Algorithm 1****BPE-dropout**

If \(p\) is set to 0, the segmentation is equivalent to the standard BPE; if \(p\) is set to 1, the segmentation splits words into distinct characters. The values between 0 and 1 can be used to control the segmentation granularity.

We use \(p>0\) (usually \(p=0.1\)) in training time to expose a model to different segmentations and \(p=0\) during inference, which means that at inference time we use the original BPE. We discuss the choice of the value of \(p\) in Section 5.

When some merges are randomly forbidden during segmentation, words end up segmented in different subwords; see for example Figure 1(b). We hypothesize that exposing a model to different segmentations may result in better understanding of the whole words as well as their subword units; we will verify this in Section 6.

## 4 Experimental setup

### Baselines

Our baselines are the standard BPE and the subword regularization by Kudo (2018).

Subword regularization by Kudo (2018) has segmentation sampling hyperparameters \(l\) and \(\alpha\). \(l\) specifies how many best segmentations for each word are produced before sampling one of them, \(\alpha\) controls the smoothness of the sampling distribution. In the original paper \((l=\infty,\alpha=0.2/0.5)\) and \((l=64,\alpha=0.1)\) were shown to perform best on different datasets. Since overall they show comparable results, in all experiments we use \((l=64,\alpha=0.1)\).

### Vocabularies

There are two ways of building vocabulary for models trained with _BPE-dropout_: (1) take the vocabulary built by BPE; then the segmented with _BPE-dropout_ text will contain a small number of unknown tokens (UNKs)2; (2) add to the BPE vocabulary all tokens which can appear when segmenting with _BPE-dropout_.

Footnote 2: For example, for the English part of the IWSLT15 EnVi corpora, these UNKs make up 0.00585 and 0.00085 of all tokens for 32k and 4k vocabularies, respectively.

In the preliminary experiments, we did not observe any difference in quality; therefore, either of the methods can be used. We choose the first option to stay in the same setting as the standard BPE. Besides, a model exposed to some UNKs in training can be more reliable for practical applications where unknown tokens can be present.

### Data sets and preprocessing

We conduct our experiments on a wide range of datasets with different corpora sizes and languages; information about the datasets is summarized in Table 1. These datasets are used in the main experiments (Section 5.1) and were chosen to match the ones used in the prior work (Kudo, 2018). In the additional experiments (Sections 5.2-5.5), we also use random subsets of the WMT14 English-French data; in this case, we specify dataset size for each experiment.

Prior to seg 

datasets with the standard Moses toolkit.3 However, Chinese and Japanese have no explicit word boundaries, and Moses tokenizer does not segment sentences into words; for these languages, subword segmentations are trained almost from unsegmented raw sentences.

Footnote 2: [https://github.com/moses-smt/mosesdecoder](https://github.com/moses-smt/mosesdecoder)

Relying on a recent study of how the choice of vocabulary size influences translation quality Ding et al. (2019), we choose vocabulary size depending on the dataset size (Table 1).

In training, translation pairs were batched together by approximate sequence length. For the main experiments, the values of batch size we used are given in Table 1 (batch size is the number of source tokens). In the experiments in Sections 5.2, 5.3 and 5.4, for datasets not larger than 500k sentence pairs we use vocabulary size and batch size of 4k, and 32k for the rest.4

Footnote 3: Large batch size can be reached by using several of GPUs or by accumulating the gradients for several batches and then making an update.

In the main text, we train all models on lowercased data. In the appendix, we provide additional experiments with the original case and casesensitive BLEU.

### Model and optimizer

The NMT system used in our experiments is _Transformer base_Vaswani et al. (2017). More precisely, the number of layers is \(N=6\) with \(h=8\) parallel attention layers, or heads. The dimensionality of input and output is \(d_{model}=512\), and the inner-layer of feed-forward networks has dimensionality \(d_{ff}=2048\). We use regularization and optimization procedure as described in Vaswani et al. (2017).

### Training time

We train models till convergence. For all experiments, we provide number of training batches in the appendix (Tables 6 and 7).

### Inference

To produce translations, for all models, we use beam search with the beam of 4 and length normalization of 0.6.

In addition to the main results, Kudo (2018) also report scores using \(n\)-best decoding. To translate a sentence, this strategy produces multiple segmentations of a source sentence, generates a translation for each of them, and rescores the obtained translations. While this could be an interesting future work to investigate different sampling and rescoring strategies, in the current study we use 1-best decoding to fit in the standard decoding paradigm.

### Evaluation

For evaluation, we average 5 latest checkpoints and use BLEU Papineni et al. (2002) computed via SacreBleu5Post (2018). For Chinese, we add option --tok zh to SacreBLEU. For Japanese, we use character-based BLEU.

Footnote 5: Our SacreBLEU signature is: BLEU+case.lc+lang.[src-lang]—[dst-lang]+numrefs.l+smooth.exp+tok.l3a+version.1.3.6

## 5 Experiments

### Main results

The results are provided in Table 2. For all datasets, _BPE-dropout_ improves significantly over the standard BPE: more than 1.5 BLEU for En-Vi, Vi-En, En-Zh, Zh-En, Ar-En, De-en, and 0.5-1.4

\begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & & Number of sentences & Voc size & Batch size & The value of \(p\) \\  & & (train/dev/test) & & & in _BPE-dropout_ \\ \hline IWSLT15 & En \(\leftrightarrow\) Vi & 133k / 1553 / 1268 & 4k & 4k & 0.1 / 0.1 \\  & En \(\leftrightarrow\) Zh & 209k / 887 / 1261 & 4k / 16k & 4k & 0.1 / 0.6 \\ IWSLT17 & En \(\leftrightarrow\) Fr & 232k / 890 / 1210 & 4k & 4k & 0.1 / 0.1 \\  & En \(\leftrightarrow\) Ar & 231k / 888 / 1205 & 4k & 4k & 0.1 / 0.1 \\ WMT14 & En \(\leftrightarrow\) De & 4.5M / 3000 / 3003 & 32k & 32k & 0.1 / 0.1 \\ ASPEC & En \(\leftrightarrow\) Ja & 2M / 1700 / 1812 & 16k & 32k & 0.1 / 0.6 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Overview of the datasets and dataset-dependent hyperparameters; values of \(p\) are shown in pairs: source language / target language. (We explain the choice of the value of \(p\) for _BPE-dropout_ in Section 5.3.) 

BLEU for the rest. The improvements are especially prominent for smaller datasets; we will discuss this further in Section 5.4.

Compared to Kudo (2018), among the 12 datasets we use _BPE-dropout_ is beneficial for 8 datasets with improvements up to 0.92 BLEU, is not significantly different for 3 datasets and underperforms only on En-Ja. While Kudo (2018) uses another segmentation, our method operates within the BPE framework and changes only the way a model is trained. Thus, lower performance of _BPE-dropout_ on En-Ja and only small or insignificant differences for Ja-En, En-Zh and Zh-En suggest that Japanese and Chinese may benefit from a language-specific segmentation.

Note also that Kudo (2018) report larger improvements over BPE from using their method than we show in Table 2. This might be explained by the fact that Kudo (2018) used large vocabulary size (16k, 32k), which has been shown counterproductive for small datasets (Sennrich and Zhang, 2019; Ding et al., 2019). While this may not be the issue for models trained with subword regularization (see Section 5.4), this causes drastic drop in performance of the baselines.

### Single side vs full regularization

In this section, we investigate whether _BPE-dropout_ should be used only on one side of a translation pair or for both source and target languages. We select random subsets of different sizes from WMT14 En-Fr data to understand how the results are affected by the amount of data. We show that:

* for small and medium datasets, full regularization performs best;
* for large datasets, _BPE-dropout_ should be used only on the source side.

Since full regularization performs the best for most of the considered dataset sizes, in the subsequent sections we use _BPE-dropout_ on both source and target sides.

#### 5.2.1 Small and medium datasets: use full regularization

Table 3 indicates that using _BPE-dropout_ on the source side is more beneficial than on the target side; for the datasets not smaller than 0.5m sentence pairs, _BPE-dropout_ can be used only the source side. We can speculate that it is more important for the model to understand a source sentence than being exposed to different ways to generate the same target sentence.

#### 5.2.2 Large datasets: use only for source

For larger corpora (e.g., starting from 4m instances), it is better to use _BPE-dropout_ only on the source side (Table 3). Interestingly, using _BPE-dropout_ for both source and target languages hurts performance for large datasets.

\begin{table}
\begin{tabular}{c c c c} \hline  & BPE & Kudo (2018) & _BPE-dropout_ \\ \hline
**IWSLT15** & & & \\ En-Vi & 31.78 & 32.43 & **33.27** \\ Vi-En & 30.83 & 32.36 & **32.99** \\ En-Zh & 20.48 & **23.01** & **22.84** \\ Zh-En & 19.72 & 21.10 & **21.45** \\ \hline
**IWSLT17** & & & \\ En-Fr & 39.37 & 39.45 & **40.02** \\ Fr-En & 38.18 & 38.88 & **39.39** \\ En-Ar & 13.89 & 14.43 & **15.05** \\ Ar-En & 31.90 & 32.80 & **33.72** \\ \hline
**WMT14** & & & \\ En-De & 27.41 & **27.82** & **28.01** \\ De-En & 32.69 & 33.65 & **34.19** \\ \hline
**ASPEC** & & & \\ En-Ja & 54.51 & **55.46** & 55.00 \\ Ja-En & 30.77 & **31.23** & **31.29** \\ \hline \end{tabular}
\end{table}
Table 2: BLEU scores. Bold indicates the best score and all scores whose difference from the best is not statistically significant (with \(p\)-value of 0.05). [Statistical significance is computed via bootstrapping (Koehn, 2004)].)

\begin{table}
\begin{tabular}{c c c c c} \hline  & BPE & \multicolumn{3}{c}{_BPE-dropout_} \\  & & src-only & dst-only & both \\ \hline
250k & 26.94 & 27.98 & 27.71 & **28.40** \\
500k & 29.28 & **30.12** & 29.40 & **29.89** \\
1m & 30.53 & **31.09** & 30.62 & **31.23** \\
4m & 33.38 & **33.89** & 33.46 & **33.85** \\
16m & 34.37 & **34.82** & - & 33.66 \\ \hline \end{tabular}
\end{table}
Table 3: BLEU scores for models trained with _BPE-dropout_ on a single side of a translation pair or on both sides. Models trained on random subsets of WMT14 En-Fr dataset. Bold indicates the best score and all scores whose difference from the best is not statistically significant (with \(p\)-value of 0.05).

 



### Choice of the value of \(p\)

Figure 2 shows BLEU scores for the models trained on _BPE-dropout_ with different values of \(p\) (the probability of a merge being dropped). Models trained with high values of \(p\) are unable to translate due to a large mismatch between training segmentation (which is close to char-level) and inference segmentation (BPE). The best quality is achieved with \(p=0.1\).

In our experiments, we use \(p=0.1\) for all languages except for Chinese and Japanese. For Chinese and Japanese, we take the value of \(p=0.6\) to match the increase in length of segmented sentences for other languages.6

Footnote 6: Formally, for English/French/etc. with _BPE-dropout_, \(p=0.1\) sentences become on average about 1.25 times longer compared to segmented with BPE; for Chinese and Japanese, we need to set the value of \(p\) to \(0.6\) to achieve the same increase.

### Varying corpora and vocabulary size

Now we will look more closely at how the improvement from using _BPE-dropout_ depends on corpora and vocabulary size.

First, we see that _BPE-dropout_ performs best for all dataset sizes (Figure 3). Next, models trained with subword regularization are less sensitive to the choice of vocabulary size: differences in performance of models with 4k and 32k vocabulary are much less than for models trained with the standard BPE. This makes _BPE-dropout_ attractive since it allows (i) not to tune vocabulary size for each dataset, (ii) choose vocabulary size depending on the desired model properties: models with smaller vocabularies are beneficial in terms of number of parameters, models with larger vocabularies are beneficial in terms of inference time.7 Finally, we see that the effect from using _BPE-dropout_ vanishes when a corpora size gets bigger. This is not surprising: the effect of any regularization is less in high-resource settings; however, as we will show later in Section 6.3, when applied to noisy source, models trained with _BPE-dropout_ show substantial improvements up to 2 BLEU even in high-resource settings.

Footnote 7: Table 4 shows that inference for models with 4k vocabulary is more than 1.4 times longer than models with 32k vocabulary.

Note that for larger corpora, we recommend using _BPE-dropout_ only for source language (Section 5.2).

### Inference time and length of generated sequences

Since _BPE-dropout_ produces more fine-grained segmentation, sentences segmented with _BPE-dropout_ are longer; distribution of sentence lengths are shown in Figure 4 (a) (with \(p=0.1\), on average about 1.25 times longer). Thus there is a potential danger that models trained with _BPE-dropout_ may tend to use more fine-grained segmentation in inference and hence to slow inference down. However, in practice this is not the case: distributions of lengths of generated translations for models trained with BPE and with _BPE-dropout_ are close (Figure 4 (b)).8

Footnote 8: This is the result of using beam search: while samples from a model reproduce training data distribution quite well, beam search favors more frequent tokens Ott et al. (2018). Therefore, beam search translations tend not to use less frequent fine-grained segmentation.

Table 4 confirms these observations and shows that inference time of models trained with _BPE-dropout_ is not substantially different from the ones trained with BPE.

Figure 3: BLEU scores. Models trained on random subsets of WMT14 En-Fr.





## 6 Analysis

In this section, we analyze qualitative differences between models trained with BPE and _BPE-dropout_. We find, that

* when using BPE, frequent sequences of characters rarely appear in a segmented text as individual tokens rather than being a part bigger ones; _BPE-dropout_ alleviates this issue;
* by analyzing the learned embedding spaces, we show that using _BPE-dropout_ leads to a better understanding of rare tokens;
* as a consequence of the above, models trained with _BPE-dropout_ are more robust to misspelled input.

### Substring frequency

Here we highlight one of the drawbacks of BPE's deterministic nature: since it splits words into unique subword sequences, only rare words are split into subwords. This forces frequent sequences of characters to mostly appear in a segmented text as part of bigger tokens, and not as individual tokens. To show this, for each token in the BPE vocabulary we calculate how often it appears in a segmented text as an individual token and as a sequence of characters (which may be part of a bigger token or an individual token). Figure 5 shows distribution of the ratio between substring frequency as an individual token and as a sequence of characters (for top-\(10\%\) most frequent substrings).

For frequent substrings, the distribution of token to substring ratio is clearly shifted to zero, which confirms our hypothesis: frequent sequences of characters rarely appear in a segmented text as individual tokens. When a text is segmented using _BPE-dropout_ with the same vocabulary, this distribution significantly shifts away from zero, meaning that frequent substrings appear in a segmented text as individual tokens more often.

### Properties of the learned embeddings

Now we will analyze embedding spaces learned by different models. We take embeddings learned by models trained with BPE and _BPE-dropout_ and for each token look at the closest neighbors in the corresponding embedding space. Figure 6 shows several examples. In contrast to BPE, nearest neighbours of a token in the embedding space of _BPE-dropout_ are often tokens that share sequences of characters with the original token. To verify this observation quantitatively, we computed character 4-gram precision of top-10 neighbors: the proportion of those 4-grams of the top-10 closest neighbors which are present among 4-grams of the original token. As expected, embeddings of _BPE-dropout_ have higher character 4-gram precision (0.29) compared to the precision of BPE (0.18).

This also relates to the study by Gong et al. (2018). For several tasks, they analyze the em

Figure 4: Distributions of length (in tokens) of (a) the French part of WMT14 En-Fr test set segmented using BPE or _BPE-dropout_; and (b) the generated translations for the same test set by models trained with BPE or _BPE-dropout_.

Figure 5: Distribution of token to substring ratio for texts segmented using BPE or _BPE-dropout_ for the same vocabulary of 32k tokens; only \(10\%\) most frequent substrings are shown. (Token to substring ratio of a token is the ratio between its frequency as an individual token and as a sequence of characters.)

bedding space learned by a model. The authors find that while a popular token usually has semantically related neighbors, a rare word usually does not: a vast majority of closest neighbors of rare words are rare words. To confirm this, we reduce dimensionality of embeddings by SVD and visualize (Figure 7). For the model trained with BPE, rare tokens are in general separated from the rest; for the model trained with _BPE-dropout_, this is not the case. While to alleviate this issue Gong et al. (2018) propose to use adversarial training for embedding layers, we showed that a trained with _BPE-dropout_ model does not have this problem.

### Robustness to misspelled input

Models trained with _BPE-dropout_ better learn compositionality of words and the meaning of subwords, which suggests that these models have to be more robust to noise. We verify this by measuring the translation quality of models on a test set augmented with synthetic misspellings. We augment the source side of a test set by modifying each word with the probability of \(10\%\) by applying one of the predefined operations. The operations we consider are (1) removal of one character from a word, (2) insertion of a random character into a word, (3) substitution of a character in a word with a random one. This augmentation produces words with the edit distance of 1 from the unmodified words. Edit distance is commonly used to model misspellings Brill and Moore (2000); Ahmad and Kondrak (2005); Pinter et al. (2017).

Table 5 shows the translation quality of the models trained on WMT 14 dataset when given the original source and augmented with misspellings. We deliberately chose large datasets, where improvements from using _BPE-dropout_ are smaller. We can see that while for the original test sets the improvements from using _BPE-dropout_ are usually modest, for misspelled test set the improvements are a lot larger: 1.6-2.3 BLEU. This is especially interesting since models have not been exposed to misspellings during training. Therefore, even for large datasets using _BPE-dropout_ can result in substantially better quality for practical applications where input is likely to be noisy.

## 7 Conclusion

In this paper, we proposed an approach to misspelling neural networks based on WMT 14 and _BPE-dropout_. Our method uses a novel regularization technique to extract the features of the data. In particular, we demonstrated that our approach achieves good performance over all methods. We also demonstrated that our approach improves the accuracy of the model compared to other approaches.

We believe that our approach significantly outperforms the state-of-the-art unsupervised learning framework, as well as the ability to predict the correct answer to the question posed by the model. We hope that our approach is able to predict the correct answer to the question posed by the model.

The work presented here provides us with a simple approach to misspelling neural network. We show that our approach is capable of producing accurate answers to the question posed by the model. We demonstrate that our approach is capable of producing accurate answers to the question posed by the model.

Our approach is able to predict the correct answer to the question posed by the model. We also provide a new approach to misspelling neural network. We also discuss how to improve the generalization of the model to misspelling neural networks.

**Acknowledgements**

This research was supported by NSF grant DMS-190544.

## References

* [1] M. A. Abadi, S. Agarwal, J. Razahe, and D. Silverstein. Deep residual learning for image recognition. In _Advances in Neural Information Processing Systems (NIPS)_, pages 1-10. ACM, 2015.
* [2] N. Ahmed, C. Chen, Y. Li, X. Zhang, and H. Yu. Automatic classification of deep convolutional neural networks via deep reinforcement learning. In _Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)_, volume 1, pp. 1-10. ACM, 2015.
* [3] G. Corrado, L. Bottou, and T. Bengio. Generative adversarial nets for image recognition. In _Advances in Neural Information Processing Systems (ICASSP)_, volume 1, pages 1-10. Springer, 2016.
* [4] E. Dehghani, F. Dehghani, and I. Sutskever. Learning representations for image recognition. In _Advances in Neural Information Processing Systems (IJCNN)_, pages 1-10. AAAI Press, 2016.

[MISSING_PAGE_POST]

 

Related work

Closest to our work in motivation is the work by Kudo (2018), who introduced the subword regularization framework multiple segmentation candidates and a new segmentation algorithm. Other segmentation algorithms include Creutz and Lagus (2006), Schuster and Nakajima (2012), Chitnis and DeNero (2015), Kunchukuttan and Bhattacharyya (2016), Wu and Zhao (2018), Banerjee and Bhattacharyya (2018).

Regularization techniques are widely used for training deep neural networks. Among regularizations applied to a network weights the most popular are Dropout Srivastava et al. (2014) and \(L_{2}\) regularization. Data augmentation techniques in natural language processing include dropping tokens at random positions or swapping tokens at close positions Iyyer et al. (2015); Artetxe et al. (2018); Lample et al. (2018), replacing tokens at random positions with a placeholder token Xie et al. (2017), replacing tokens at random positions with a token sampled from some distribution (e.g., based on token frequency or a language model) Fadaee et al. (2017); Xie et al. (2017); Kobayashi (2018). While _BPE-dropout_ can be thought of as a regularization, our motivation is not to make a model robust by injecting noise. By exposing a model to different segmentations, we want to teach it to better understand the composition of words as well as subwords, and make it more flexible in the choice of segmentation during inference.

Several works study how translation quality depends on a level of granularity of a segmentation Cherry et al. (2018); Kreutzer and Sokolov (2018); Ding et al. (2019). Cherry et al. (2018) show that trained long enough character-level models tend to have better quality, but it comes with the increase of computational cost for both training and inference. Kreutzer and Sokolov (2018) find that, given flexibility in choosing segmentation level, the model prefers to operate on (almost) character level. Ding et al. (2019) explore the effect of BPE vocabulary size and find that it is better to use small vocabulary for low-resource setting and large vocabulary for a high-resource setting. Following these observations, in our experiments we use different vocabulary size depending on a dataset size to ensure the strongest baselines.

## 8 Conclusions

We introduce _BPE-dropout_ - simple and effective subword regularization, which operates within the standard BPE framework. The only difference from BPE is how a word is segmented during model training: _BPE-dropout_ randomly drops some merges from the BPE merge table, which results in different segmentations for the same word. Models trained with _BPE-dropout_ (1) outperform BPE and the previous subword regularization on a wide range of translation tasks, (2) have better quality of learned embeddings, (3) are more robust to noisy input. Future research directions include adaptive dropout rates for different merges and an in-depth analysis of other pathologies in learned token embeddings for different segmentations.

## Acknowledgments

We thank anonymous reviewers for the helpful feedback, Rico Sennrich for valuable comments on the first version of this paper, and Yandex Machine Translation team for discussions and inspiration.

## References

* Ahmad and Kondrak (2005) Farooq Ahmad and Grzegorz Kondrak. 2005. Learning a spelling error model from search query logs. In _Proceedings of Human Language Technology Conference and Conference on Empirical Methods in Natural Language Processing_, pages 955-962, Vancouver, British Columbia, Canada. Association for Computational Linguistics.
* Artetxe et al. (2018) Mikel Artetxe, Gorka Labaka, and Eneko Agirre. 2018. Unsupervised statistical machine translation. In _Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing_, pages 3632-3642, Brussels, Belgium. Association for Computational Linguistics.
* Banerjee and Bhattacharya (2018) Tamali Banerjee and Pushpak Bhattacharyya. 2018. Meaningless yet meaningful: Morphology grounded subword-level NMT. In _Proceedings of the Second Workshop on Subword/Character LEvel Models_, pages 55-60, New Orleans. Association for Computational Linguistics.
* Barrault et al. (2019) Loic Barrault, Ondrej Bojar, Marta R. Costa-jussa, Christian Federmann, Mark Fisher, Yvette Graham, Barry Haddow, Matthias Huck, Philipp Kochun, Shervin Malmasi, Christof Monz, Mathias Muller, Santanu Pal, Matt Post, and Marcos Zampieri. 2019. Findings of the 2019 conference on machine translation (WMT'19). In _Proceedings of the Fourth Conference on Machine Translation (Volume 2: Shared Task Papers, Day 1)_, pages 1-61, Florence, Italy. Association for Computational Linguistics 

* Bojar et al. (2018) Ondrej Bojar, Christian Federmann, Mark Fishel, Yvette Graham, Barry Haddow, Philipp Koehn, and Christof Monz. 2018. Findings of the 2018 conference on machine translation (WMT'18). In _Proceedings of the Third Conference on Machine Translation: Shared Task Papers_, pages 272-303, Belgium, Brussels. Association for Computational Linguistics.
* Brill and Moore (2000) Eric Brill and Robert C. Moore. 2000. An improved error model for noisy channel spelling correction. In _Proceedings of the 38th Annual Meeting of the Association for Computational Linguistics_, pages 286-293, Hong Kong. Association for Computational Linguistics.
*Cherry et al. (2018) Colin Cherry, George Foster, Ankur Bapna, Orhan Firat, and Wolfgang Macherey. 2018. Revisiting character-based neural machine translation with capacity and compression. In _Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing_, pages 4295-4305, Brussels, Belgium. Association for Computational Linguistics.
* Chitnis and DeNero (2015) Rohan Chitnis and John DeNero. 2015. Variable-length word encodings for neural translation models. In _Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing_, pages 2088-2093, Lisbon, Portugal. Association for Computational Linguistics.
* Creutz and Lagus (2006) Mathias Creutz and Krista Lagus. 2006. Morfessor in the morpho challenge. In _Proceedings of the PASCAL Challenge Workshop on Unsupervised Segmentation of Words into Morphemes_, pages 12-17. citeseer.
* Ding et al. (2019) Shuoyang Ding, Adithya Renduchintala, and Kevin Duh. 2019. A call for prudent choice of subword merge operations in neural machine translation. In _Proceedings of Machine Translation Summit XVII Volume 1: Research Track_, pages 204-213, Dublin, Ireland. European Association for Machine Translation.
* Fadaee et al. (2017) Marzieh Fadaee, Arianna Bisazza, and Christof Monz. 2017. Data augmentation for low-resource neural machine translation. In _Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers)_, pages 567-573, Vancouver, Canada. Association for Computational Linguistics.
* Gong et al. (2018) Chengyue Gong, Di He, Xu Tan, Tao Qin, Liwei Wang, and Tie-Yan Liu. 2018. Frage: Frequency-agnostic word representation. In _Advances in neural information processing systems_, pages 1334-1345.
* Iyyer et al. (2015) Mohit Iyyer, Varun Manjunatha, Jordan Boyd-Graber, and Hal Daume III. 2015. Deep unordered composition rivals syntactic methods for text classification. In _Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers)_, pages 1681-1691, Beijing, China. Association for Computational Linguistics.
* Kobayashi (2018) Sosuke Kobayashi. 2018. 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)_, pages 452-457, New Orleans, Louisiana. Association for Computational Linguistics.
* Koehn (2004) Philipp Koehn. 2004. Statistical significance tests for machine translation evaluation. In _Proceedings of the 2004 Conference on Empirical Methods in Natural Language Processing_.
* Kreutzer and Sokolov (2018) Julia Kreutzer and Artem Sokolov. 2018. Learning to segment inputs for nmt favors character-level processing. In _Proceedings of the 15th International Workshop on Spoken Language Translation_.
* Kudo (2018) Taku Kudo. 2018. Subword regularization: Improving neural network translation models with multiple subword candidates. In _Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)_, pages 66-75, Melbourne, Australia. Association for Computational Linguistics.
* Kunchukutta and Bhattacharyya (2016) Anoop Kunchukutta and Pushpak Bhattacharyya. 2016. Orthographic syllable as basic unit for SMT between related languages. In _Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing_, pages 1912-1917, Austin, Texas. Association for Computational Linguistics.
* Lample et al. (2018) Guillaume Lample, Alexis Conneau, Ludovic Denoyer, and Marc'Aurelio Ranzato. 2018. Unsupervised machine translation using monolingual corpora only. In _International Conference on Learning Representations_.
* Ott et al. (2018) Myle Ott, Michael Auli, David Grangier, and MarcAurelio Ranzato. 2018. Analyzing uncertainty in neural machine translation. In _International Conference on Machine Learning_, pages 3956-3965.
* Papineni et al. (2002) Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. Bleu: a method for automatic evaluation of machine translation. In _Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics_, pages 311-318, Philadelphia, Pennsylvania, USA. Association for Computational Linguistics.
* Winter et al. (2017) Yuval Pinter, Robert Gutthrie, and Jacob Eisenstein. 2017. Mimicking word embeddings using subword RNNs. In _Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing_, pages 102-112, Copenhagen, Denmark. Association for Computational Linguistics.
* Post (2018) Matt Post. 2018. A call for clarity in reporting BLEU scores. In _Proceedings of the Third Conference on 

Machine Translation: Research Papers_, pages 186-191, Belgium, Brussels. Association for Computational Linguistics.
* Schuster and Nakajima (2012) Mike Schuster and Kaisuke Nakajima. 2012. Japanese and korean voice search. In _2012 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)_, pages 5149-5152. IEEE.
* Sennrich et al. (2016) Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Neural machine translation of rare words with subword units. In _Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)_, pages 1715-1725, Berlin, Germany. Association for Computational Linguistics.
* Sennrich and Zhang (2019) Rico Sennrich and Biao Zhang. 2019. Revisiting low-resource neural machine translation: A case study. In _Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics_, pages 211-221, Florence, Italy. Association for Computational Linguistics.
* Srivastava et al. (2014) Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. 2014. Dropout: a simple way to prevent neural networks from overfitting. _The journal of machine learning research_, 15(1):1929-1958.
* Vaswani et al. (2017) Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In _NeurIPS_, Los Angeles.
* Wu and Zhao (2018) Yingting Wu and Hai Zhao. 2018. Finding better subword segmentation for neural machine translation. In _Chinese Computational Linguistics and Natural Language Processing Based on Naturally Annotated Big Data_, pages 53-64. Springer.
* Xie et al. (2017) Ziang Xie, Sida I. Wang, Jiwei Li, Daniel Levy, Aiming Nie, Dan Jurafsky, and Andrew Y. Ng. 2017. Data noising as smoothing in neural network language models. In _International Conference on Learning Representations_.

## Appendix A Training time

Table 6 shows number of training batches for the experiments in Section 5.1 (Table 2), Table 7 -- for the experiments in Section 5.2 (Table 3).

## Appendix B Additional experiments

In the main text, all models were trained (and evaluated) on lowercased data. Here we provide results of the models trained and evaluated without lower case (Table 8).

\begin{table}
\begin{tabular}{l c c c} \hline \hline  & BPE & Kudo (2018) & _BPE-dropout_ \\ \hline
**IWSLT15** & & & \\ En-Vi & 23 & 26 & 36 \\ Vi-En & 23 & 29 & 33 \\ En-Zh & 30 & 29 & 43 \\ Zh-En & 39 & 51 & 100 \\ \hline
**IWSLT17** & & & \\ En-Fr & 36 & 45 & 60 \\ Fr-En & 32 & 46 & 85 \\ En-Ar & 30 & 60 & 62 \\ Ar-En & 41 & 51 & 59 \\ \hline
**WMT14** & & & \\ En-De & 468 & 450 & 501 \\ De-En & 447 & 442 & 525 \\ \hline
**ASPEC** & & & \\ En-Ja & 280 & 165 & 462 \\ Ja-En & 239 & 144 & 576 \\ \hline \hline \end{tabular}
\end{table}
Table 6: Number of thousands of training batches for the experiments from Table 2.

\begin{table}
\begin{tabular}{r r r l} \hline \hline  & BPE & _BPE-dropout_ \\ \hline
**IWSLT15** & & \\ En-Vi & 31.44 & **32.70** \\ Vi-En & 32.19 & **33.22** \\ \hline
**IWSLT17** & & \\ En-Fr & 38.79 & **39.83** \\ Fr-En & 38.06 & **38.60** \\ En-Ar & 14.30 & **15.20** \\ Ar-En & 31.56 & **33.00** \\ \hline \hline \end{tabular}
\end{table}
Table 8: BLEU scores. Bold indicates the best score; differences with the baselines are statistically significant (with \(p\)-value of 0.05). (Statistical significance is computed via bootstrapping (Koehn, 2004).)