Dual Learning for Machine Translation
While neural machine translation (NMT) is making good progress in the past two years, tens of millions of bilingual sentence pairs are needed for its training. However, human labeling is very costly. To tackle this training data bottleneck, we develop a dual-learning mechanism, which can enable an NMT system to automatically learn from unlabeled data through a dual-learning game. This mechanism is inspired by the following observation: any machine translation task has a dual task, e.g., English-to-French translation (primal) versus French-to-English translation (dual); the primal and dual tasks can form a closed loop, and generate informative feedback signals to train the translation models, even if without the involvement of a human labeler. In the dual-learning mechanism, we use one agent to represent the model for the primal task and the other agent to represent the model for the dual task, then ask them to teach each other through a reinforcement learning process. Based on the feedback signals generated during this process (e.g., the language-model likelihood of the output of a model, and the reconstruction error of the original sentence after the primal and dual translations), we can iteratively update the two models until convergence (e.g., using the policy gradient methods). We call the corresponding approach to neural machine translation dual-NMT. Experiments show that dual-NMT works very well on EnglishFrench translation; especially, by learning from monolingual data (with 10 comparable accuracy to NMT trained from the full bilingual data for the French-to-English translation task.READ FULL TEXT VIEW PDF
In this paper, we study a new learning paradigm for Neural Machine
While Iterative Back-Translation and Dual Learning effectively incorpora...
Dual learning has been successfully applied in many machine learning
Many supervised learning tasks are emerged in dual forms, e.g.,
We propose a neural machine translation (NMT) approach that, instead of
Unsupervised bilingual lexicon induction naturally exhibits duality, whi...
For neural sequence model training, maximum likelihood (ML) has been com...
Dual Learning for Machine Translation
and the recently emerged neural networks based translation approachesbahdanau2014neural ; chousing , heavily rely on aligned parallel training corpora. However, such parallel data are costly to collect in practice and thus are usually limited in scale, which may constrain the related research and applications.
Given that there exist almost unlimited monolingual data in the Web, it is very natural to leverage them to boost the performance of MT systems. Actually different methods have been proposed for this purpose, which can be roughly classified into two categories. In the first categorybrants2007large ; gulcehre2015using , monolingual corpora in the target language are used to train a language model, which is then integrated with the MT models trained from parallel bilingual corpora to improve the translation quality. In the second category ueffing2008semi ; sennrich2015improving , pseudo bilingual sentence pairs are generated from monolingual data by using the translation model trained from aligned parallel corpora, and then these pseudo bilingual sentence pairs are used to enlarge the training data for subsequent learning. While the above methods could improve the MT performance to some extent, they still suffer from certain limitations. The methods in the first category only use the monolingual data to train language models, but do not fundamentally address the shortage of parallel training data. Although the methods in the second category can enlarge the parallel training data, there is no guarantee/control on the quality of the pseudo bilingual sentence pairs.
In this paper, we propose a dual-learning mechanism that can leverage monolingual data (in both the source and target languages) in a more effective way. By using our proposed mechanism, these monolingual data can play a similar role to the parallel bilingual data, and significantly reduce the requirement on parallel bilingual data during the training process. Specifically, the dual-learning mechanism for MT can be described as the following two-agent communication game.
The first agent, who only understands language A, sends a message in language A to the second agent through a noisy channel, which converts the message from language A to language B using a translation model.
The second agent, who only understands language B, receives the translated message in language B. She checks the message and notifies the first agent whether it is a natural sentence in language B (note that the second agent may not be able to verify the correctness of the translation since the original message is invisible to her). Then she sends the received message back to the first agent through another noisy channel, which converts the received message from language B back to language A using another translation model.
After receiving the message from the second agent, the first agent checks it and notifies the second agent whether the message she receives is consistent with her original message. Through the feedback, both agents will know whether the two communication channels (and thus the two translation models) perform well and can improve them accordingly.
The game can also be started from the second agent with an original message in language B, and then the two agents will go through a symmetric process and improve the two channels (translation models) according to the feedback.
It is easy to see from the above descriptions, although the two agents may not have aligned bilingual corpora, they can still get feedback about the quality of the two translation models and collectively improve the models based on the feedback. This game can be played for an arbitrary number of rounds, and the two translation models will get improved through this reinforcement procedure (e.g., by means of the policy gradient methods). In this way, we develop a general learning framework for training machine translation models through a dual-learning game.
The dual learning mechanism has several distinguishing features. First, we train translation models from unlabeled data through reinforcement learning. Our work significantly reduces the requirement on the aligned bilingual data, and it opens a new window to learn to translate from scratch (i.e., even without using any parallel data). Experimental results show that our method is very promising.
Second, we demonstrate the power of deep reinforcement learning (DRL) for complex real-world applications, rather than just games. Deep reinforcement learning has drawn great attention in recent years. However, most of them today focus on video or board games, and it remains a challenge to enable DRL for more complicated applications whose rules are not pre-defined and where there is no explicit reward signals. Dual learning provides a promising way to extract reward signals for reinforcement learning in real-world applications like machine translation.
The remaining parts of the paper are organized as follows. In Section 2, we briefly review the literature of neural machine translation. After that, we introduce our dual-learning algorithm for neural machine translation. The experimental results are provided and discussed in Section 4. We extend the breadth and depth of dual learning and discuss future directions in the last section.
In principle, our dual-learning framework can be applied to both phrase-based statistical machine translation and neural machine translation. In this paper, we focus on the latter one, i.e., neural machine translation (NMT), due to its simplicity as an end-to-end system, without suffering from human crafted engineering chousing .
Neural machine translation systems are typically implemented with a Recurrent Neural Network (RNN) based encoder-decoder framework. Such a framework learns a probabilistic mappingfrom a source language sentence to a target language sentence , in which and are the -th and -th words for sentences and respectively.
To be more concrete, the encoder of NMT reads the source sentence and generates hidden states by an RNN:
in which is the hidden state at time , and function
is the recurrent unit such as Long Short-Term Memory (LSTM) unitsutskever2014sequence
or Gated Recurrent Unit (GRU)cho2014learning
. Afterwards, the decoder of NMT computes the conditional probability of each target wordgiven its proceeding words , as well as the source sentence, i.e., , which is then used to specify
according to the probability chain rule.is given as:
where is the decoder RNN hidden state at time , similarly computed by an LSTM or GRU, and denotes the contextual information in generating word according to different encoder hidden states. can be a ‘global’ signal summarizing sentence cho2014learning ; sutskever2014sequence , e.g., , or ‘local’ signal implemented by an attention mechanism bahdanau2014neural , e.g., , , where
We denote all the parameters to be optimized in the neural network as and denote as the dataset that contains source-target sentence pairs for training. Then the learning objective is to seek the optimal parameters :
In this section, we present the dual-learning mechanism for neural machine translation. Noticing that MT can (always) happen in dual directions, we first design a two-agent game with a forward translation step and a backward translation step, which can provide quality feedback to the dual translation models even using monolingual data only. Then we propose a dual-learning algorithm, called dual-NMT, to improve the two translation models based on the quality feedback provided in the game.
Consider two monolingual corpora and which contain sentences from language and respectively. Please note these two corpora are not necessarily aligned with each other, and they may even have no topical relationship with each other at all. Suppose we have two (weak) translation models that can translate sentences from to and verse visa. Our goal is to improve the accuracy of the two models by using monolingual corpora instead of parallel corpora. Our basic idea is to leverage the duality of the two translation models. Starting from a sentence in any monolingual data, we first translate it forward to the other language and then further translate backward to the original language. By evaluating this two-hop translation results, we will get a sense about the quality of the two translation models, and be able to improve them accordingly. This process can be iterated for many rounds until both translation models converge.
Suppose corpus contains sentences, and contains sentences. Denote and as two neural translation models, where and are their parameters (as described in Section 2).
Assume we already have two well-trained language models and (which are easy to obtain since they only require monolingual data), each of which takes a sentence as input and outputs a real value to indicate how confident the sentence is a natural sentence in its own language. Here the language models can be trained either using other resources, or just using the monolingual data and .
For a game beginning with sentence in , denote as the middle translation output. This middle step has an immediate reward , indicating how natural the output sentence is in language B. Given the middle translation output , we use the log probability of recovered from as the reward of the communication (we will use reconstruction and communication interchangeably). Mathematically, reward .
We simply adopt a linear combination of the LM reward and communication reward as the total reward, e.g., , where is a hyper-parameter. As the reward of the game can be considered as a function of , and translation models and , we can optimize the parameters in the translation models through policy gradient methods for reward maximization, as widely used in reinforcement learning sutton1999policy .
We sample according to the translation model . Then we compute the gradient of the expected reward with respect to parameters and . According to the policy gradient theorem sutton1999policy , it is easy to verify that
in which the expectation is taken over .
The game can be repeated for many rounds. In each round, one sentence is sampled from and one from , and we update the two models according to the game beginning with the two sentences respectively. The details of this process are given in Algorithm 1.
We conducted a set of experiments to test the proposed dual-learning mechanism for neural machine translation.
which generates pseudo bilingual sentence pairs from monolingual corpora to assist training (pseudo-NMT for short). We leverage a tutorial NMT system implemented by Theano for all the experiments.111dl4mt-tutorial: https://github.com/nyu-dl
We evaluated our algorithm on the translation task of a pair of languages: EnglishFrench (EnFr) and FrenchEnglish (FrEn). In detail, we used the same bilingual corpora from WMT’14 as used in bahdanau2014neural ; chousing , which contains M sentence pairs extracting from five datasets: Europarl v7, Common Crawl corpus, UN corpus, News Commentary, and French-English corpus. Following common practices, we concatenated newstest2012 and newstest2013 as the validation set, and used newstest2014 as the testing set. We used the “News Crawl: articles from 2012” provided by WMT’14 as monolingual data.
We used the GRU networks and followed the practice in bahdanau2014neural
to set experimental parameters. For each language, we constructed the vocabulary with the most common 30K words in the parallel corpora, and out-of-vocabulary words were replaced with a special token
For the baseline NMT model, we exactly followed the settings reported in bahdanau2014neural . For the baseline pseudo-NMT sennrich2015improving , we used the trained NMT model to generate pseudo bilingual sentence pairs from monolingual data, removed the sentences with more than 50 words, merged the generated data with the original parallel training data, and then trained the model for testing. Each of the baseline models was trained with AdaDelta zeiler2012adadelta on K40m GPU until their performances stopped to improve on the validation set.
Our method needs a language model for each language. We trained an RNN based language model mikolov2010recurrent for each language using its corresponding monolingual corpus. Then the language model was fixed and the log likelihood of a received message was used to reward the communication channel (i.e., the translation model) in our experiments.
While playing the game, we initialized the channels using warm-start translation models (e.g., trained from bilingual data corpora), and see whether dual-NMT can effectively improve the machine translation accuracy. In our experiments, in order to smoothly transit from the initial model trained from bilingual data to the model training purely from monolingual data, we adopted the following soft-landing strategy. At the very beginning of the dual learning process, for each mini batch, we used half sentences from monolingual data and half sentences from bilingual data (sampled from the dataset used to train the initial model). The objective was to maximize the reward based on monolingual data defined in Section 3 together the likelihood on bilingual data defined in Section 2. When the training process went on, we gradually increased the percentage of monolingual sentences in the mini batch, until no bilingual data were used at all. Specifically, we tested two settings in our experiments:
In the first setting (referred to Large), we used all the M bilingual sentences pairs during the soft-landing process. That is, the warm start model was learnt based on full bilingual data.
In the second setting (referred to Small), we randomly sampled 10% of the M bilingual sentences pairs and used them during the soft-landing process.
For each of the settings we trained our dual-NMT algorithm for one week. We set the beam search size to be 2 in the middle translation process, and . We found that using stochastic gradient decent performs very well for our algorithm, and we chose the to be and chose the to be
. All the hyperparameters in the experiments are set by cross validation.
We used the BLEU score papineni2002bleu
as the evaluation metric, which are computed by themulti-bleu.perl script222https://github.com/moses-smt/mosesdecoder/blob/master/scripts/generic/multi-bleu.perl. Following the common practice, during testing we used beam search sutskever2014sequence with beam size of 12 for all the algorithms as in many previous works.
We report the experimental results in this section. Recall that the two baselines for EnglishFrench and FrenchEnglish are trained separately while our dual-NMT conducts joint training. We summarize the overall performances in Table 1 and plot the BLEU scores with respect to the length of source sentences in Figure 1.
|EnFr (Large)||FrEn (Large)||EnFr (Small)||FrEn (Small)|
From Table 1 we can see that our dual-NMT algorithm outperforms the baseline algorithms in all the settings. For the translation from English to French, dual-NMT outperforms the baseline NMT by about / points for the first/second warm start setting, and outperforms pseudo-NMT by about / points for both settings. For the translation from French to English, the improvement is more significant: our dual-NMT outperforms NMT by about / points for the first/second warm start setting, and outperforms pseudo-NMT by about / points for both settings. Surprisingly, with only 10% bilingual data, dual-NMT achieves comparable translation accuracy as vanilla NMT using 100% bilingual data for the FrEn task. These results demonstrate the effectiveness of our dual-NMT algorithm. Furthermore, we have the following observations:
Although pseudo-NMT outperforms NMT, its improvements are not very significant. Our hypothesis is that the quality of pseudo bilingual sentence pairs generated from the monolingual data is not very good, which limits the performance gain of pseudo-NMT. One might need to carefully select and filter the generated pseudo bilingual sentence pairs to get better performance for pseudo-NMT.
When the parallel bilingual data are small, dual-NMT makes larger improvement. This shows that the dual-learning mechanism makes very good utilization of monolingual data. Thus we expect dual-NMT will be more helpful for language pairs with smaller labeled parallel data. Dual-NMT opens a new window to learn to translate from scratch.
We plot BLEU scores with respect to the length of source sentences in Figure 1. From the figure, we can see that our dual-NMT algorithm outperforms the baseline algorithms in all the ranges of length.
|EnFrEn (L)||FrEnFr (L)||EnFrEn (S)||FrEnFr (S)|
We make some deep studies on our dual-NMT algorithm in Table 2. We study the self-reconstruction performance of the algorithms: For each sentence in the test set, we translated it forth and back using the models and then checked how close the back translated sentence is to the original sentence using the BLEU score. We also used beam search to generate all the translation results. It can be easily seen from Table 2 that the self-reconstruction BLEU scores of our dual-NMT are much higher than NMT and pseudo-NMT. In particular, our proposed method outperforms NMT by about / points when using warm-start model trained on large parallel data, and outperforms NMT for about / points when using the warm-start model trained on % parallel data.
We list several example sentences in Table 4 to compare the self-reconstruction results of models before and after dual learning. It is quite clear that after dual learning, the reconstruction is largely improved for both directions, i.e., EnglishFrenchEnglish and FrenchEnglishFrench.
|RNNSearchchousing||29.97 / 33.08|
|RNNSearch-LV with k source/target wordschousing||32.68 / 34.11|
|MRT shen2016minimum||31.30 / 34.23|
|dual-NMT (Large)||32.06 / 34.83|
We summarize the EnFr BLEU scores (carried out by multi-bleu.pl) on tokenized newstest2014 of several 1-layer NMT based machine translation systems in Table 3. The numbers of the second column are the BLEU scores before/after postprocessing the <UNK>. We use the method proposed by chousing to deal with unknown words. We can see that our dual-NMT outperforms the above baselines.
To summarize, all the results show that the dual-learning mechanism is promising and better utilizes the monolingual data.
|Translation-back-translation results||Translation-back-translation results|
|before dual-NMT training||after dual-NMT training|
|Source (En)||The majority of the growth in the years to come will come from its|
|liquefied natural gas schemes in Australia.|
|La plus grande partie de la crois-||La majorité de la croissance dans|
|EnFr||-sance des années à venir viendra||les années à venir viendra de ses|
|de ses systèmes de gaz naturel||régimes de gaz naturel liquéfié|
|liquéfié en Australie .||en Australie .|
|Most of the growth of future||The majority of growth in the|
|EnFrEn||years will come from its liquefied||coming years will come from its|
|natural gas systems in Australia .||liquefied natural gas systems|
|in Australia .|
|Source (Fr)||Il précise que " les deux cas identifiés en mai 2013 restent donc|
|les deux seuls cas confirmés en France à ce jour " .|
|He noted that " the two cases||He states that " the two cases|
|FrEn||identified in May 2013 therefore||identified in May 2013 remain the|
|remain the only two two confirmed||only two confirmed cases in France|
|cases in France to date " .||to date "|
|Il a noté que " les deux cas||Il précise que " les deux cas|
|FrEnFr||identifiésen mai 2013 demeurent||identifiés en mai 2013 restent les|
|donc les deux seuls deux deux cas||seuls deux cas confirmés en France|
|confirmés en France à ce jour "||à ce jour ".|
In this section, we discuss the possible extensions of our proposed dual learning mechanism and list several future works for machine translation.
First, although we have focused on machine translation in this work, the basic idea of dual learning is generally applicable: as long as two tasks are in dual form, we can apply the dual-learning mechanism to simultaneously learn both tasks from unlabeled data using reinforcement learning algorithms. Actually, many AI tasks are naturally in dual form, for example, speech recognition versus text to speech, image caption versus image generation, question answering versus question generation (e.g., Jeopardy!), search (matching queries to documents) versus keyword extraction (extracting keywords/queries for documents), so on and so forth. It would very be interesting to design and test dual-learning algorithms for more dual tasks beyond machine translation.
Second, although we have focused on dual learning on two tasks, our technology is not restricted to two tasks only. Actually, our key idea is to form a closed loop so that we can extract feedback signals by comparing the original input data with the final output data. Therefore, if more than two associated tasks can form a closed loop, we can apply our technology to improve the model in each task from unlabeled data. For example, for an English sentence , we can first translate it to a Chinese sentence , then translate to a French sentence , and finally translate back to an English sentence . The similarity between and can indicate the effectiveness of the three translation models in the loop, and we can once again apply the policy gradient methods to update and improve these models based on the feedback signals during the loop. We would like to name this generalized dual learning as close-loop learning, and will test its effectiveness in the future.
We plan to explore the following directions in the future. First, in the experiments we used bilingual data to warm start the training of dual-NMT. A more exciting direction is to learn from scratch, i.e., to learn translations directly from monolingual data of two languages (maybe plus lexical dictionary). Second, our dual-NMT was based on NMT systems in this work. Our basic idea can also be applied to phrase-based SMT systems and we will look into this direction. Third, we only considered a pair of languages in this paper. We will extend our approach to jointly train multiple translation models for a tuple of languages using monolingual data.
In Proceedings of the Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning. Citeseer, 2007.
A neural attention model for abstractive sentence summarization.In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 379–389, Lisbon, Portugal, September 2015. Association for Computational Linguistics.