Multi-Source Neural Translation

Barret Zoph, Kevin Knight

Introduction

?) points out that if a document is translated once, it is likely to be translated again and again into other languages. This gives rise to an interesting idea: a human does the first translation by hand, then turns the rest over to machine translation (MT). The translation system now has two strings as input, which can reduce ambiguity via “triangulation” (Kay’s term). For example, the normally ambiguous English word “bank” may be more easily translated into French in the presence of a second, German input string containing the word “Flussufer” (river bank).

?) describe such a multi-source MT system. They first train separate bilingual MT systems F<spanclass="katexdisplay"><spanclass="katex"><spanclass="katexmathml"><mathxmlns="http://www.w3.org/1998/Math/MathML"display="block"><semantics><mrow><mo></mo></mrow><annotationencoding="application/xtex"></annotation></semantics></math></span><spanclass="katexhtml"ariahidden="true"><spanclass="base"><spanclass="strut"style="height:0.3669em;"></span><spanclass="mrel"></span></span></span></span></span>EF<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo>→</mo></mrow><annotation encoding="application/x-tex">\rightarrow</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.3669em;"></span><span class="mrel">→</span></span></span></span></span>E, G<spanclass="katexdisplay"><spanclass="katex"><spanclass="katexmathml"><mathxmlns="http://www.w3.org/1998/Math/MathML"display="block"><semantics><mrow><mo></mo></mrow><annotationencoding="application/xtex"></annotation></semantics></math></span><spanclass="katexhtml"ariahidden="true"><spanclass="base"><spanclass="strut"style="height:0.3669em;"></span><spanclass="mrel"></span></span></span></span></span>EG<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo>→</mo></mrow><annotation encoding="application/x-tex">\rightarrow</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.3669em;"></span><span class="mrel">→</span></span></span></span></span>E, etc. At runtime, they separately translate input strings ff and gg into candidate target strings e1e_{1} and e2e_{2}, then select the best one of the two. A typical selection factor is the product of the system scores. ?) revisits such factors in the context of log-linear models and Bleu score, while ?) re-rank F<spanclass="katexdisplay"><spanclass="katex"><spanclass="katexmathml"><mathxmlns="http://www.w3.org/1998/Math/MathML"display="block"><semantics><mrow><mo></mo></mrow><annotationencoding="application/xtex"></annotation></semantics></math></span><spanclass="katexhtml"ariahidden="true"><spanclass="base"><spanclass="strut"style="height:0.3669em;"></span><spanclass="mrel"></span></span></span></span></span>EF<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo>→</mo></mrow><annotation encoding="application/x-tex">\rightarrow</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.3669em;"></span><span class="mrel">→</span></span></span></span></span>E n-best lists using n-gram precision with respect to G<spanclass="katexdisplay"><spanclass="katex"><spanclass="katexmathml"><mathxmlns="http://www.w3.org/1998/Math/MathML"display="block"><semantics><mrow><mo></mo></mrow><annotationencoding="application/xtex"></annotation></semantics></math></span><spanclass="katexhtml"ariahidden="true"><spanclass="base"><spanclass="strut"style="height:0.3669em;"></span><spanclass="mrel"></span></span></span></span></span>EG<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo>→</mo></mrow><annotation encoding="application/x-tex">\rightarrow</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.3669em;"></span><span class="mrel">→</span></span></span></span></span>E translations. ?) exploits hypothesis selection in multi-source MT to expand available corpora, via co-training.

Others use system combination techniques to merge hypotheses at the word level, creating the ability to synthesize new translations outside those proposed by the single-source translators. These methods include confusion networks [Matusov et al. (2006, Schroeder et al. (2009], source-side string combination [Schroeder et al. (2009], and median strings [González-Rubio and Casacuberta (2010].

The above work all relies on base MT systems trained on bilingual data, using traditional methods. This follows early work in sentence alignment [Gale and Church (1993] and word alignment [Simard (1999], which exploited trilingual text, but did not build trilingual models. Previous authors possibly considered a three-dimensional translation table t(ef,ge|f,g) to be prohibitive.

In this paper, by contrast, we train a P(ef,ge|f,g) model directly on trilingual data, and we use that model to decode an (f,gf,g) pair simultaneously. We view this as a kind of multi-tape transduction [Elgot and Mezei (1965, Kaplan and Kay (1994, Deri and Knight (2015] with two input tapes and one output tape. Our contributions are as follows:

We train a P(ef,ge|f,g) model directly on trilingual data, and we use it to decode a new source string pair (f,gf,g) into target string ee.

We show positive Bleu improvements over strong single-source baselines.

We show that improvements are best when the two source languages are more distant from each other.

We are able to achieve these results using the framework of neural encoder-decoder models, where multi-target MT [Dong et al. (2015] and multi-source, cross-modal mappings have been explored [Luong et al. (2015a].

Multi-Source Neural MT

In the neural encoder-decoder framework for MT [Neco and Forcada (1997, Castaño and Casacuberta (1997, Sutskever et al. (2014, Bahdanau et al. (2014, Luong et al. (2015b], we use a recurrent neural network (encoder) to convert a source sentence into a dense, fixed-length vector. We then use another recurrent network (decoder) to convert that vector in a target sentence.We follow previous authors in presenting the source sentence to the encoder in reverse order.

In this paper, we use a four-layer encoder-decoder system (Figure 1) with long short-term memory (LSTM) units [Hochreiter and Schmidhuber (1997] trained for maximum likelihood (via a softmax layer) with back-propagation through time [Werbos (1990]. For our baseline single-source MT system we use two different models, one of which implements the local attention plus feed-input model from ?).

Figure 2 shows our approach to multi-source MT. Each source language has its own encoder. The question is how to combine the hidden states and cell states from each encoder, to pass on to the decoder. Black combiner blocks implement a function whose input is two hidden states (h1h_{1} and h2h_{2}) and two cell states (c1c_{1} and c2c_{2}), and whose output is a single hidden state hh and cell state cc. We propose two combination methods.

The Basic method works by concatenating the two hidden states from the source encoders, applying a linear transformation WcW_{c} (size 2000 x 1000), then sending its output through a tanh non-linearity. This operation is represented by the equation:

WcW_{c} and all other weights in the network are learned from example string triples drawn from a trilingual training corpus.

The new cell state is simply the sum of the two cell states from the encoders.

We also attempted to concatenate cell states and apply a linear transformation, but training diverges due to large cell values.

2 Child-Sum Method

Our second combination method is inspired by the Child-Sum Tree-LSTMs of ?). Here, we use an LSTM variant to combine the two hidden states and cells. The standard LSTM input, output, and new cell value are all calculated. Then cell states from each encoder get their own forget gates. The final cell state and hidden state are calculated as in a normal LSTM. More precisely:

3 Multi-Source Attention

The local-p attention model from ?) works as follows. First, a position to look at in the source encoder is predicted by equation 9:

SS is the source sentence length, and vpv_{p} and WpW_{p} are learned parameters, with vpv_{p} being a vector of dimension 1000, and WpW_{p} being a matrix of dimension 1000 x 1000.

After ptp_{t} is computed, a window of size 2D+12D+1 is looked at in the top layer of the source encoder centered around ptp_{t} (D=10D=10). For each hidden state in this window, we compute an alignment score a_{t}\big{(}s\big{)}, between 0 and 1. This alignment score is computed by equations 10, 11 and 12:

In equation 10, σ\sigma is set to be D/2D/2 and ss is the source index for that hidden state. WaW_{a} is a learnable parameter of dimension 1000 x 1000.

Once all of the alignments are calculated, ctc_{t} is created by taking a weighted sum of all source hidden states multiplied by their alignment weight.

The final hidden state sent to the softmax layer is given by:

We modify this attention model to look at both source encoders simultaneously. We create a context vector from each source encoder named ct1c_{t}^{1} and ct2c_{t}^{2} instead of the just ctc_{t} in the single-source attention model:

In our multi-source attention model we now have two ptp_{t} variables, one for each source encoder. We also have two separate sets of alignments and therefore now have two ctc_{t} values denoted by ct1c_{t}^{1} and ct2c_{t}^{2} as mentioned above. We also have distinct WaW_{a}, vpv_{p}, and WpW_{p} parameters for each encoder.

Experiments

We use English, French, and German data from a subset of the WMT 2014 dataset [Bojar et al. (2014]. Figure 3 shows statistics for our training set. For development, we use the 3000 sentences supplied by WMT. For testing, we use a 1503-line trilingual subset of the WMT test set.

For the single-source models, we follow the training procedure used in ?), but with 15 epochs and halving the learning rate every full epoch after the 10th epoch. We also re-scale the normalized gradient when norm >> 5. For training, we use a minibatch size of 128, a hidden state size of 1000, and dropout as in ?). The dropout rate is 0.2, the initial parameter range is [[-0.1, +0.1]], and the learning rate is 1.0. For the normal and multi-source attention models, we adjust these parameters to 0.3, [[-0.08, +0.08]], and 0.7, respectively, to adjust for overfitting.

Figure 4 show our results for target English, with source languages being French and German). We see that the Basic combination method yields a +4.8 Bleu improvement over the strongest single-source, attention-based system. It also improves Bleu by +2.2 over the non-attention baseline. The Child-Sum method gives improvements of +4.4 and +1.4. We also confirm that two copies of the same French input yields no BLEU improvement.

Figure 5 shows the action of the multi-attention model during decoding.

When our source languages are English and French (Figure 6), we observe smaller BLEU gains (up to +1.1). This is evidence that the more distinct the source languages, the better they disambiguate each other.

Conclusion

We describe a multi-source neural MT system that gets up to +4.8 Bleu gains over a very strong attention-based, single-source baseline. We obtain this result through a novel encoder-vector combination method and a novel multi-attention system. We release the code for these experiments at https://github.com/isi-nlp/Zoph_RNN.

References