S ELF - SUPERVISED AND S UPERVISED J OINT T RAINING FOR R ESOURCE - RICH M ACHINE T RANSLATION
Anonymous authors
Paper under double-blind review
A BSTRACT
Self-supervised pre-training of text representations has been successfully applied to low-resource Neural Machine Translation (NMT).
However, it usually fails to achieve notable gains on resource-rich NMT.
In this paper, we propose a joint training approach, F 2 -XEnDec , to combine self-supervised and supervised learning to optimize NMT models.
To exploit complementary self-supervised signals for supervised learning, NMT models are trained on examples that are interbred from monolingual and parallel sentences through a new process called crossover encoder-decoder.
Experiments on two resource-rich translation benchmarks, WMT’14 English-German and WMT’14 English-French, demonstrate that our approach achieves substantial improvements over a vanilla Transformer and obtains a new state of the art of 46 BLEU on English-French.
Results also show that our approach is capable of improving model robustness to input perturbations, particularly to code-switching noise which usually appears on the social media.
I NTRODUCTION
Self-supervised pre-training of text representations (Peters et al., 2018; Radford et al., 2018) has achieved tremendous success in natural language processing applications.
Inspired by BERT (Devlin et al., 2019), recent works attempt to leverage sequence-to-sequence model pre-training for
Neural Machine Translation (NMT).
Generally, these methods comprise two stages: pre-training and ﬁnetuning.
During the pre-training stage, a proxy task, e.g. the Cloze task (Devlin et al., 2019), is used to learn the model parameters on abundant unlabeled monolingual data.
In the second stage, the full or partial model is ﬁnetuned on a downstream translation task of labeled parallel sentences.
When the amount of labeled data is limited, studies have demonstrated the beneﬁt of pre-training for low-resource translation tasks (Lewis et al., 2019; Song et al., 2019).
In many NMT applications, we are confronted with resource-rich languages which are characterized by millions of labeled parallel sentences.
However, for these resource-rich tasks, pre-training representations rarely endows the NMT model with superior quality and, even worse, it sometimes can undermine the model’s performance if improperly utilized (Zhu et al., 2020).
This is partly due to catastrophic forgetting (French, 1999) where prolonged ﬁnetuning on large corpora causes the learning to overwhelm the knowledge learned during pre-training.
Several mitigation methods have been proposed for resource-rich machine translation (Edunov et al., 2019; Yang et al., 2019; Zhu et al., 2020), such as freezing the pre-trained representations during the ﬁnetuning stage.
In this paper, we study resource-rich machine translation through a different perspective of joint training where in contrast to the conventional two-stage approaches, we train NMT models in a single stage using the self-supervised objective (on unlabeled monolingual sentences) in addition to the supervised objective (on labeled parallel sentences).
The biggest challenge for this single-stage training paradigm is that self-supervised learning is less useful in joint training because it provides a much weaker learning signal that is easily dominated by the signal obtained through supervised learning.
As a result, plausible approaches such as simply combining self-supervised and supervised learning objectives perform not much better than the supervised learning objective by itself.
To this end, we introduce an approach to exploit complementary self-supervised learning signals to facilitate supervised learning in a joint training framework.
Inspired by chromosomal crossovers (Rieger et al., 2012), we propose a new task called crossover encoder-decoder (or XEnDec ) which takes two training examples as inputs (called parents), shufﬂes their source sentences, and produces a “virtual” sentence (called offspring) by a mixture decoder model.
The key to our approach is to “interbreed” monolingual (unlabeled) and parallel (labeled) sentences through second ﬁlial generation with a crossover encoder-decoder, which we call F 2 -XEnDec , and train NMT models on the F 2 offspring.
As the F 2 offspring exhibits combinations of traits that differ from those found in either parent, it turns out to be a meaningful objective to learn NMT models from both labeled and unlabeled sentences in a joint training framework.
To the best of our knowledge, the proposed F 2 -XEnDec is among the ﬁrst joint training approaches that substantially improve resource-rich machine translation.
Closest to our work are two-stage approaches by Zhu et al.
(2020) and Yang et al.
(2019) who designed special ﬁnetuning objectives.
Compared to their approaches, our focus lies on addressing a different challenge which is making self-supervised learning complementary to joint training of supervised NMT models on large labeled parallel corpora .
Our experimental results substantiate the competitiveness of the proposed joint training approach.
Furthermore, our results suggest that the approach improves the robustness of
NMT models (Belinkov & Bisk, 2018; Cheng et al., 2019).
Contemporary NMT systems often lack robustness and therefore suffer from dramatic performance drops when they are exposed to input perturbations, even though these perturbations may not be strong enough to alter the meaning of the input sentence.
Our improvement in robustness is interesting as none of the two-stage training approaches have ever reported this behavior.
We empirically validate our approach on the WMT’14 English-German and WMT’14 EnglishFrench
translation benchmarks which yields an improvement of 2 . 13 and 1 .
BLEU points over a vanilla Transformer model baseline.
We also achieve a new state of the art of 46 BLEU on the
WMT’14 English-French translation task.
In summary, our contributions are as follows:
We propose a crossover encoder-decoder ( XEnDec ) that generates ”virtual” examples over pairs of training examples.
We discuss its relation to the standard self-supervised learning objective that can be recovered by XEnDec . 2.
We combine self-supervised and supervised losses in a joint training framework using our proposed F 2 -XEnDec and show that self-supervised learning is complementary to supervised learning for resource-rich NMT.
Our approach achieves signiﬁcant improvements on resource-rich translation tasks and exhibits higher robustness against input perturbations, particularly to code-switching noise.
B ACKGROUND 2. N EURAL M ACHINE T RANSLATION
Under the encoder-decoder paradigm (Bahdanau et al., 2015; Gehring et al., 2017; Vaswani et al., 2017), the conditional probability P ( y | x ; θ ) of a target-language sentence y =
y 1 , · · · , y J given a source-language sentence x = x 1 , · · · , x I is modeled as follows:
The encoder maps the source sentence x onto a sequence of I word embeddings e ( x )
=
e ( x 1 ) , ..., e ( x I ) .
Then the word embeddings are encoded into their corresponding continuous hidden representations.
The decoder acts as a conditional language model that reads embeddings e ( y ) for a shifted copy of y along with the aggregated contextual representations c .
For clarity, we denote the input and output in the decoder as z and y , i.e. z = (cid:104) s (cid:105) , y 1 , · · · , y J − 1 , where (cid:104) s (cid:105) is a start symbol.
Conditioned on the aggregated contextual representation c j and its partial target input z ≤ j , the decoder generates y as
P ( y | x ; θ ) = (cid:81)
Jj =1 P ( y j | z ≤ j , c j ; θ ) .
The aggregated contextual representation c is often calculated by summarizing the sentence x with an attention mechanism (Bahdanau et al., 2015).
A byproduct of the attention computation is a noisy alignment matrix A ∈ R J
× I which roughly captures the translation correspondence between target and source words (Garg et al., 2019).
Generally, NMT optimizes the model parameters θ by minimizing the empirical risk over a parallel training set ( x , y ) ∈ S :
[Equation]
where (cid:96) is the cross entropy loss between the model prediction f ( x , y ; θ ) and h ( y ) , and h ( y ) denotes the sequence of one-hot label vectors for y with label smoothing in the Transformer (Vaswani et al., 2017).
2. P RE - TRAINING FOR N EURAL M ACHINE T RANSLATION
Pre-training sequence-to-sequence models for language generation is receiving increasing attention in the machine translation community (Song et al., 2019; Lewis et al., 2019).
These methods generally comprise two stages: pre-training and ﬁnetuning.
The pre-training takes advantage of the abundant monolingual corpus U = { y } to learn representations through a self-supervised objective called denoising autoencoder (Vincent et al., 2008).
The denoising autoencoder aims at reconstructing the original sentence y from one of its corrupted counterparts.
Let y (cid:5) be obtained by corrupting y with a noise function n ( · ) and masking words.
Then the pseudo parallel data ( y (cid:5) , y ) is fed into the NMT model to compute the reconstruction loss.
The self-supervised loss over the monolingual corpus U is deﬁned as:
[Equation]
The optimal model parameters θ (cid:63) are learned via a self-supervised loss L U ( θ ) and used to initialize downstream models during the ﬁnetuning on the parallel training set S .
C ROSS - BREEDING : F 2 -XEnDec
[Table]
(cid:88)(cid:83)(cid:79)(cid:73)(cid:82)(cid:87)(cid:4)(cid:77)(cid:82)(cid:4)(cid:81)(cid:83)(cid:82)(cid:83)(cid:80)(cid:77)(cid:82)(cid:75)(cid:89)(cid:69)(cid:80)(cid:4)(cid:87)(cid:73)(cid:82)(cid:88)(cid:73)(cid:82)(cid:71)(cid:73)(cid:87)
[Figure]
For resource-rich translation tasks in which a large parallel corpus S and (virtually) unlimited monolingual corpora U are available, our goal is to improve translation performance by exploiting selfsupervised signals to complement the supervised learning.
In F 2 -XEnDec , we jointly train NMT models with supervised and self-supervised learning objectives in a single stage.
We design a new objective L F 2 and construct virtual data (˜ x , ˜ y ) to bridge the parallel data (in supervised learning) and the pseudo parallel data (in self-supervised learning).
The training loss over the virtual data (˜ x , ˜ y ) is computed as:
[Equation]
[Equation]
) where generating (˜ x , ˜ y ) depends on the parallel data ( x p , y p ) and the pseudo parallel data ( y (cid:5) , y ).
We propose a method called crossover encoder-decoder ( XEnDec ) that operates on two sentence pairs.
As illustrated in Fig.
1, the ﬁrst generation (Fig. 1(1)) uses XEnDec to combine monolingual sentences, thereby incurring a self-supervised proxy loss L F 1 which is equivalent to L U .
The second generation (Fig. 1(2)) applies XEnDec between the offspring of the ﬁrst generation ( y (cid:5) , y ) and the parallel sentence ( x p , y p ) to introduce L F 2 .
The ﬁnal NMT models are optimized jointly on the original translation loss and the above two auxiliary losses.
[Equation]
L F 2 in Equation 4 is used to deeply fuse self-supervised and supervised training at instance level, rather than mixing them across instances mechanically.
In the remainder of this section, we ﬁrst detail XEnDec .
We then discuss the relation between our approach, pre-training, and adversarial training objectives.
Finally, we summarize some important techniques used in our approach and present the overall algorithm.
3. C ROSSOVER E NCODER -D ECODER
[Figure]
This section introduces the crossover encoder-decoder ( XEnDec ) – an essential subtask for the proposed method.
Different from a conventional encoder-decoder, XEnDec takes two training examples as inputs (called parents), shufﬂes the parents’ source sentences and produces a virtual example (called offspring) through a mixture decoder model.
Fig.
2 illustrates this process.
Formally, let ( x , y ) denote a training example where x = x 1 , · · · , x I represents a source sentence of I words and y =
y 1 , · · · , y J is the corresponding target sentence.
In supervised training, x and y are parallel sentences.
As we shall see in Section 3.4, XEnDec can be carried out with and without supervision, although we do not distinguish both cases for now.
Given a pair of examples ( x , y ) and ( x (cid:48) , y (cid:48) ) called parents, the crossover encoder shufﬂes the two source sequences into a new source sentence ˜ x calculated from:
[Equation]
where m = m 1 , · · · , m I ∈ { 0 , 1 } I stands for a series of Bernoulli random variables with each taking the value 1 with probability p .
If m i = 1 , then the i -th word in x will be substituted with the word in x (cid:48) at the same position.
For convenience, the lengths of the two sequences are aligned by padding tokens to the end of the shorter sentence.
The crossover decoder employs a mixture model to generate the virtual target sentence.
The embedding of the decoder’s input ˜ z is computed as:
[Equation]
where e ( · ) is the embedding function.
Z = (cid:80) Ii =1 A ( j − 1)
i m i
+ A (cid:48)
( j − 1) i (1 − m i ) is the normalization term where A and A (cid:48) are the alignment matrices for the source sequences x and x (cid:48) , respectively.
Equation 6 averages embeddings of y and y (cid:48) through the latent weights computed by m , A and
A (cid:48) .
The alignment matrix measures the contribution of the source words for generating a speciﬁc target word (Och & Ney, 2004; Bahdanau et al., 2015).
For example, A j : indicates the contribution scores of each source word for the j -th word in the target sentence.
For simplicity, this paper uses the attention matrix learned in the NMT model as a noisy alignment matrix (Garg et al., 2019).
Likewise, we compute label vectors for the crossover decoder by:
[Equation]
The h ( · ) function projects a word onto its label vector, e.g. a one-hot vector.
The loss of XEnDec over ( x , y , x (cid:48) , y (cid:48) ) is computed as the negative log-likelihood of generating the virtual sentence ˜
y :
(cid:96) ( f ( ˜ x , ˜ y ; θ ) , h ( ˜ y ))
=
− log P ( ˜ y | ˜ x ; θ ) = (cid:88)
[Equation] [Equation]
Notice that even though we do not directly observe the “virtual sentences” ˜ z and ˜ y , we are still able to compute the loss using their embeddings.
In practice, the length of ˜ x is | x | whereas lengths of both ˜ y and ˜ z are max( | y | , | y (cid:48) | ) .
3. R ELATION WITH O THER W ORKS
Before introducing the proposed method, this subsection shows that the crossover encoder-decoder
XEnDec (when fed with appropriate inputs) yields learning objectives identical to two recently proposed self-supervised learning approaches, MASS (Song et al., 2019) and BART (Lewis et al., 2019), as well as a supervised learning approach called Doubly Adversarial (Cheng et al., 2019).
Table 1 summarizes the inputs of XEnDec to recover the learning objectives of these existing approaches.
XEnDec can be used for self-supervised learning.
Given arbitrary alignment matrices, if we set x (cid:48)
=
y , y (cid:48)
=
y , and x to be a corrupted y , then XEnDec is equivalent to the denoising autoencoder
[Table]
1 Function F 2 -XEnDec ( S , U , p 1 , p 2 ) : foreach ( x p , y p ) ∈ S do
Sample a y ∈ U with similar length as x p ; // done offline.
L
; end θ )
+ L F 1 ( θ ) + L F 2 ( θ ) ; // Equation 4. which is commonly used to pre-train sequence-to-sequence models such as in MASS (Song et al., 2019) and BART (Lewis et al., 2019).
In particular, if we allow x (cid:48) to be a dummy sentence of length | y | containing only “ (cid:104) mask (cid:105) ” tokens, Equation 8 yields the learning objective deﬁned in the MASS model (Song et al., 2019) except that losses over unmasked words are not counted.
Likewise, as shown in Table 1, we can recover BART’s objective by setting x = n ( y ) where n ( · ) is a noise function that alters y by shufﬂing tokens or dropping them.
In both cases, the crossover encoderdecoder is trained with a self-supervised proxy objective to reconstruct the original sentence from one of its corrupted sentences.
XEnDec can also be used in supervised learning.
We can achieve the translation loss proposed in (Cheng et al., 2019) by letting x (cid:48) and y (cid:48) be two “adversarial inputs”, x adv and y adv , both of which consist of adversarial words at each position.
For the construction of x adv , we refer to Algorithmin (Cheng et al., 2019).
In this case, the crossover encoder-decoder is trained with a supervised objective over parallel sentences.
3. W HAT D OES L F 2 L EARN ?
The core term L F 2 introduced in our training objective ( Equation 4) aims to combine parallel and monolingual training examples respectively in supervised and self-supervised learning.
Over simply combining L S and L F 1 which mechanically mixes the losses across instances, L F 2 further enhances the combination by deeply fusing them at instance level.
Let us take an example in Figure 3 to explore what L F 2 really learns.
L F 2 on the virtual data (˜ x , ˜ y ) is optimized by performing the following tasks simultaneously:
The NMT model is required to factor the fused source sentences out into two sentences at the target side guided by the alignment.
The NMT model is required to predict the tokens corresponding to “MASK” tokens and copy unmasked tokens in the source sentences y (cid:5) once it is factored out from ˜ x .
For example, predict “MASK” in ˜ x to “new”.
The NMT model is required to translate words in x p once it is factored out.
For example, translate “Tianqi” to “whether”.
[Table]
1 A
i m i /Z
= 0 .
85 in Equation 7. 4.
The NMT model is required to predict tokens that are not picked in the source sentence of the virtual data but can be inferred from the left contextual words.
For example, although “market” does not correspond to any word in ˜ x , it can still be speculated to some extent from the words “Stock”, “MASK” and “height”.
“today” is more likely to be predicted based on “Tianqi” and “feichang”.
The NMT model is required to separate the loss portion of each above task from the mixed target side.
Integrating all the above ﬁve tasks into one task L F 2 via the fused virtual data (ˆ x , ˆ y ) would expect to have the following advantages:
Each of the above tasks integrated in L F 2 is a harder task than the individually designed task because integration introduces confusions.
The virtual points have a more intelligent regularization effect than simply summing up the losses of individual tasks.
This is because a virtual data point which deeply fuses the training examples from two speciﬁc tasks (self-supervised and supervised tasks) enables the model to try its best to decouple this integration.
Training the model over the loss L F 2 by integrating the above ﬁve tasks performs much more efﬁciently than simply training ﬁve individual tasks.
3. T RAINING
Algorithm 1 delineates the entire procedure to compute the ﬁnal loss L ( θ ) .
Speciﬁcally, each time we sample a monolingual sentence to avoid the expensive enumeration in Equation 3.
To speed up the training, we group sentences by length during ofﬂine computation.
For the noise function n ( · ) in
Step 4, we follow Lample et al.
(2017) and locally shufﬂe words while keeping the distance between the original and new position at ≤ 3 .
There are two techniques to boost the ﬁnal performance.
Computing A
The alignment matrix A is obtained by averaging the attention weights across all layers and heads.
We also add a temperature to control the sharpness of the attention distribution, the reciprocal of which was linearly increased from 0 to 2 during the ﬁrst 20 K steps.
To avoid overﬁtting to A , we apply dropout to A .
Notice that we stop back-propagating gradients through A .
Computing h (˜ y )
Instead of interpolating one-hot labels in Equation 7, we use the prediction vector f
( x , y ; ˆ θ ) estimated by the model where ˆ θ indicates no gradients are back-propagated over it.
However, the predictions made at early stages are usually unreliable.
We propose to linearly combine the ground-truth one-hot label with the model prediction using a parameter v , which is computed as vf j ( x , y ; ˆ θ ) + (1 − v ) h
( y j ) where v is gradually annealed from 0 to 1 during the ﬁrst 20 K steps.
Training Efﬁciency
When training the vanilla Transformer model, each batch contains 4096 ×tokens of parallel sentences on a 128 P100 GPUs cluster.
The training speed is about 0 .
5 steps/sec
[Table]
on average.
As there are three losses included in our training objective ( Equation 4) and the input for each of them are different
[Table]
we evenly spread the GPU memory budget into these three types of data by letting each batch include 2048 × 128 tokens.
Thus the total batch size is 2048 × 128 × 3 .
The training speed on it is about 0.3 steps/sec on average which is about 60% of the standard training speed.
The additional computation cost partly comes from implementing the noise function n ( · ) to construct the corrupted y (cid:5) , which actually can be reduced by caching noisy data in the data input pipeline.
Then the training speed can accelerate to about 0 .
4 steps/sec.
E XPERIMENTS 4. S ETTINGS
Datasets We evaluate our approach on two representative, resource-rich translation datasets,
WMT’14 English-German and WMT’14 English-French across four translation directions,
English → German (En → De), German → English (De → En), English → French (En → Fr)
[Table]
and
French → English (Fr → En).
To fairly compare with previous state-of-the-art results on these two tasks, we report the case-sensitive tokenized BLEU scores calculated by the multi-bleu.perl script.
The English-German and English-French datasets consist of 4.5M and 36M sentence pairs, respectively.
The English, German and French monolingual corpora in our experiments come from the
WMT’14 translation tasks.
We concatenate all the newscrawl07-13 data for English and German, and newscrawl07-14 for French which result in 90M English sentences, 89M German sentences, and 42M French sentences.
We mainly follows the pre-processing pipeline ( https: //github.com/pytorch/fairseq/tree/master/examples/translation ) which is also adopted by Ott et al.
(2018) and Zhu et al.
(2020), except for the sub-word tool.
We use a word piece model (Schuster & Nakajima, 2012) to split tokenized words into sub-word units.
For
English-German, we build a shared vocabulary of 32K sub-words units.
The validation set is newstest2013 and the test set is newstest2014.
The vocabulary for the English-French dataset is also jointly split into 44K sub-word units.
The concatenation of newstest2012 and newstest2013 is used as the validation set while newstest2014 is the test set.
Model and Hyperparameters We implement our approach on top of the Transformer model (Vaswani et al., 2017) using the Lingvo toolkit (Shen et al., 2019).
The Transformer base and big models follow the original network settings (Vaswani et al., 2017).
In particular, the layer normalization is employed after each residual connection rather than before each sub-layer.
The dropout ratios are all set to 0 .
1 for Transformer-base models on English-German and Transformerbig models on English-French.
For the Transformer-big model on English-German, 0 . 3 is used as the dropout ratio.
We search the hyperparameters using the Transformer-base model on EnglishGerman.
In our method, the shufﬂing ratio p 1 is set to 0 .
p 2 is sampled from a Beta distribution
Beta (2 , 6) .
The dropout ratio for A is 0 .
For decoding, we use beam search with a beam size of 4 and a length penalty of 0 . 6 for English-German.
For English-French, we use a beam size ofand a length penalty of 1 . 0 .
We carry out our experiments on a cluster with 128 GPUs and update gradients synchronously.
The model is optimized with Adam (Kingma & Ba, 2014) following the same learning rate schedule used in (Vaswani et al., 2017), except for warmup steps which is set to 4000 for all models.
[Table]
4. M AIN R ESULTS
Table 2 shows results comparing our method with several baseline methods on the English-German and English-French datasets across four translation directions.
Ott et al.
(2018) investigated how to train a strong Transformer model at scale.
Our reproduced Transformer model performs comparably with their reported results.
Cheng et al.
(2019) improved NMT by introducing adversarial attack and defense mechanisms in supervised learning.
Nguyen et al.
(2019) presented an effective method to boost NMT performance by adopting multiple rounds of back-translated sentences.
Both Zhu et al.
(2020) and Yang et al.
(2019) incorporated the knowledge of pre-trained models into NMT models by treating them as frozen input representations for NMT.
For English-German, our approach achieves signiﬁcant improvements in both translation directions over the standard Transformer model (up to +2 .
13 BLEU points on the English → German translation).
Even compared with the strongest baseline on English → German, our approach obtains a +0 .
BLEU gain.
More importantly, when we apply our approach to a signiﬁcantly larger dataset,
English-French with 36 M sentence pairs (vs. English-German with 4 .
5 M sentence pairs)
, it still yields consistent and notable improvements over the standard Transformer model.
The gains over the best baseline (Zhu et al., 2020) on the larger dataset extend to +1 .
37 BLEU points, which further corroborates the superiority of our approach on resource-rich language pairs.
4. A NALYSES
Back Translation as a Noise Function One widely applicable method to leverage monolingual data in NMT is back translation (Sennrich et al., 2016).
A straightforward way to incorporate back translation into our approach is to treat back-translated corpora as parallel corpora.
However, back translation can also be regarded as a noise function n ( · ) in F 2 -XEnDec (shown in Fig. 1), which can increase the noise diversity.
As shown in Table 3, for English → German trained on Transformerbase, our approach yields an additional +1 .
95 BLEU gain when using back translation to substitute n ( · ) and also outperforms the back-translation baseline.
When applied to the English-French dataset, we achieve a new state of the art result over the best baseline (Edunov et al., 2018).
This is interesting because, consistent with what was found in previous works, e.g. (Caswell et al., 2019), the standard back translation for English-French hurts the performance of Transformer.
These results show that our approach is complementary to the back-translation method and performs more robustly when back-translated corpora are less informative.
Robustness to Noisy Inputs Following (Cheng et al., 2019), we validate the robustness of NMT models by word perturbation.
Speciﬁcally, we design two types of noise to perturb the clean dataset.
The ﬁrst one is code-switching noise (CS) that randomly replaces words in the source sentences with their corresponding target-language words.
Alignment matrices are employed to ﬁnd the targetlanguage words in the target sentences.
The other one is drop-words noise (DW) that randomly discards some words in the source sentences.
Table 4 shows that our approach exhibits higher robustness than the standard Transformer across all noise types and noise fractions.
In particular, our approach performs remarkably stable when exposed to the code-switching noise.
Effect of Monolingual Corpora Sizes Table 5 shows the impact of monolingual corpora sizes on the performance for our approach.
We ﬁnd that our approach already yields improvements over the
[Table] [Table]
baseline when using a monolingual corpus with size comparable to the bilingual corpus (1x).
As we increase the size of the monolingual corpus to 5x, we obtain the best performance with 30 .
BLEU scores.
However, continuing to increase the data size fails to improve the performance any further, and a bigger model with increased capacity might be needed which we leave for future work.
Finetuning vs. Joint Training To study the effect of pre-trained models on the Transformer model and our approach
[Table]
we use Equation 2 to pre-train an NMT model on the entire English and German monolingual corpora.
Then we ﬁnetune the pre-trained model on the parallel English-German corpus.
Models ﬁnetuned on pre-trained models usually perform better than models trained from scratch at the early stage of training.
However, this advantage gradually vanishes as training progresses (cf.
Figure 4 in the Appendix).
As shown in Table
[Table]
Transformer with ﬁnetuning achieves virtually identical results as a Transformer trained from scratch.
Using the pre-trained model over our approach impairs performance.
We believe this to be caused by a discrepancy between the pre-trained loss and our joint training loss
[Table]
[Table]
Ablation Study Table 7 studies the effect of different components and veriﬁes the design in our approach.
When L F 1 is removed, we cannot obtain A (cid:48) in Algorithm 1 which leads to the failure of calculating L F 2 .
We design a prior alignment matrix to handle this issue (cf. A.2).
We ﬁnd that removing any component including training techniques (such as dropout A and using model predictions to substitute h ( y i ) ) can result in slightly lower performance.
We also tried using Mixup as proposed by Zhang et al.
(2018) to replace our second XEnDec but observe a large drop compared to F 2 -XEnDec .
When applying Mixup on a pair of sentences ( x , y ) and ( x (cid:48) , y (cid:48) ) , Equation 5, Equationand Equation 7 can be replaced by e (˜ x i )
=
λe ( x i ) + (1 − λ ) e ( x (cid:48) i ) , e (˜ z j ) =
λe ( y j − 1 ) + (1 − λ ) e ( y (cid:48)
j − 1 ) and h ( ˜ y j ) = λh ( y j ) + (1 − λ ) h ( y (cid:48) j ) , respectively. λ is sampled from a Beta distribution. It is worth noting that just applying XEnDec over parallel data (last row) also achieves promising results compared to the Transformer baseline.
R ELATED W ORK
The recent past has witnessed an increasing interest in the research community on leveraging pretraining models to boost NMT model performance (Ramachandran et al., 2016; Lample & Conneau, 2019; Song et al., 2019; Lewis et al., 2019;
Edunov et al., 2018; Zhu et al., 2020; Yang et al., 2019).
Most successes come from low-resource and zero-resource translation tasks.
Zhu et al.
(2020) and
Yang et al.
(2019) achieve some promising results on resource-rich translations.
They propose to combine NMT model representations and frozen pre-trained representations under the common twostage framework.
The bottleneck of these methods is that these two stages are decoupled and separately learned.
Our method, on the other hand, jointly trains self-supervised and supervised NMT models to close the gap between representations learned from either of them with an essential new subtask, XEnDec .
We also show that our method consistently outperforms previous approaches across several translation benchmarks.
Another line of research related to ours is mixing the pixels in labeled image data (Zhang et al., 2018;
Yun et al., 2019; Jiang et al., 2020) to enhance generalization and robustness.
Our XEnDec shares the commonality of combining example pairs.
However,
XEnDec ’s focus is on sequence-to-sequence learning for NLP with the aim of using self-supervised learning to complement supervised learning in a joint training framework.
C ONCLUSION
This paper has presented a joint training approach, F 2 -XEnDec , to combine self-supervised and supervised learning in a single stage.
The key part is a novel cross encoder-decoder which can be used to “interbreed” monolingual and parallel sentences.
Experiments on two resource-rich translation tasks, WMT’14 English-German and WMT’14 English-French, show that our joint training performs favorably against two-stage training approaches and improves the NMT robustness against input perturbations.
In the future, we plan to further examine the effectiveness of our approach on larger-scale corpora.
We also want to design more meaningful noise functions for our approach.
A A PPENDIX A. T RAINING D ETAILS
Batching Data Transformer groups training examples of similar lengths together with a varying batch size for training efﬁciency (Vaswani et al., 2017).
In our approach, when interpolating two source sentences, x p and y (cid:5) , it is better if the lengths of x p and y (cid:5) are similar, which can reduce the chance of wasting positions over padding tokens.
To this end, in the ﬁrst round, we search for monolingual sentences with exactly the same length of the source sentence in a parallel sentence pair.
After the ﬁrst traversal of the entire parallel data set, we relax the length difference to 1 .
This process is repeated by relaxing the constraint until all the parallel data are paired with their own monolingual data.
A. A P RIOR A LIGNMENT M ATRIX
When L F 1 is removed, we can not obtain A (cid:48) according to Algorithm 1 which leads to the failure of calculating L F 2 .
Thus we propose a prior alignment to tackle this issue.
For simplicity, we set n ( · ) to be a copy function when doing the ﬁrst XEnDec , which means that we just randomly mask some words in the ﬁrst round of XEnDec .
In the second XEnDec , we want to combine ( x p , y p ) and ( y (cid:5) , y ) .
The alignment matrix A (cid:48) for ( y (cid:5) , y ) is constructed as follows.
If a word y j in the target sentence y is picked in the source side which indicates y (cid:5) j is picked and m j = 0 , its attention value A (cid:48) ji if m i = 0 is assigned to
[Equation]
1 , otherwise it is assigned to
[Equation]
if m i = 1 .
Conversely, If a word y j is not picked which indicates m j = 1 , its attention value A (cid:48) ji is assigned to
[Equation]
if m i = 0 , otherwise it is
[Equation]