Title: IMPROVING SEQUENCE-TO-SEQUENCE LEARNING VIA OPTIMAL TRANSPORT

Abstract: Sequence-to-sequence models are commonly trained via maximum likelihood estimation (MLE). However, standard MLE training considers a word-level objective, predicting the next word given the previous ground-truth partial sentence. This procedure focuses on modeling local syntactic patterns, and may fail to capture long-range semantic structure. We present a novel solution to alleviate these issues. Our approach imposes global sequence-level guidance via new supervision based on optimal transport, enabling the overall characterization and preservation of semantic features. We further show that this method can be understood as a Wasserstein gradient flow trying to match our model to the ground truth sequence distribution. Extensive experiments are conducted to validate the utility of the proposed approach, showing consistent improvements over a wide variety of NLP tasks, including machine translation, abstractive text summarization, and image captioning.

1. INTRODUCTION:

Sequence-to-sequence (Seq2Seq) models are widely used in various natural language processing tasks, such as machine translation (Bahdanau et al., 2015; Cho et al., 2014; Sutskever et al., 2014 ), text summarization (Chopra et al., 2016; Rush et al., 2015) and image captioning (Vinyals et al., 2015; Xu et al., 2015) . Typically, Seq2Seq models are based on an encoder-decoder architecture, with an encoder mapping a source sequence into a latent vector, and a decoder translating the latent vector into a target sequence. The goal of a Seq2Seq model is to optimize this encoder-decoder network to generate sequences close to the target. Therefore, a proper measure of the distance between sequences is crucial for model training.

Maximum likelihood estimation (MLE) is often used as the training paradigm in existing Seq2Seq models (Goodfellow et al., 2016; Lamb et al., 2016) . The MLE-based approach maximizes the likelihood of the next word conditioned on its previous ground-truth words. Such an approach adopts cross-entropy loss as the objective, essentially measuring the word difference at each position of the target sequence (assuming truth for the preceding words). That is, MLE only provides a word-level training loss (Ranzato et al., 2016) . Consequently, MLE-based methods suffer from the so-called exposure bias problem (Bengio et al., 2015; Ranzato et al., 2016) , i.e., the discrepancy between training and inference stages. During inference, each word is generated sequentially based on previously generated words. However, ground-truth words are used in each timestep during training (Huszr, 2015; Wiseman & Rush, 2016) . Such discrepancy in training and testing leads to accumulated errors along the sequence-generation trajectory, and may therefore produce unstable results in practice. Further, commonly used metrics for evaluating the generated sentences at test time are sequence-level, such as BLEU (Papineni et al., 2002) and ROUGE (Lin, 2004) . This also indicates a mismatch of the training loss and test-time evaluation metrics.

Attempts have been made to alleviate the above issues, via a sequence-level training loss that enables comparisons between the entire generated and reference sequences. Such efforts roughly fall into two categories: (i) reinforcement-learning-based (RL) methods (Bahdanau et al., 2017; Ranzato et al., 2016) and (ii) adversarial-learning-based methods (Yu et al., 2017; Zhang et al., 2017) . These methods overcome the exposure bias issue through criticizing model output during training; however, both schemes have their own vulnerabilities. RL methods often suffer from large variance on policy-gradient estimation, and control variates and carefully designed baselines (such as a selfcritic) are needed to make RL training more robust (Liu et al., 2018; Rennie et al., 2017) . Further, the rewards used by RL training are often criticized as a bad proxy for human evaluation, as they are usually highly biased towards certain particular aspects (Wang et al., 2018b) . On the other hand, adversarial supervision relies on the delicate balance of a mini-max game, which can be easily undermined by mode-trapping and gradient-vanishing problems (Arjovsky et al., 2017; Zhang et al., 2017) . Sophisticated tuning is often desired for successful adversarial training.

We present a novel Seq2Seq learning scheme that leverages optimal transport (OT) to construct sequence-level loss. Specifically, the OT objective aims to find an optimal matching of similar words/phrases between two sequences, providing a way to promote their semantic similarity (Kusner et al., 2015) . Compared with the above RL and adversarial schemes, our approach has: (i) semanticinvariance, allowing better preservation of sequence-level semantic information; and (ii) improved robustness, since neither the reinforce gradient nor the mini-max game is involved. The OT loss allows end-to-end supervised training and acts as an effective sequence-level regularization to the MLE loss.

Another novel strategy distinguishing our model from previous approaches is that during training we consider not only the OT distance between the generated sentence and ground-truth references, but also the OT distance between the generated sentence and its corresponding input. This enables our model to simultaneously match the generated output sentence with both the source sentence(s) and target reference sentence, thus enforcing the generator to leverage information contained in the input sentence(s) during generation.

The main contributions of this paper are summarized as follows. (i) A new sequence-level training algorithm based on optimal transport is proposed for Seq2Seq learning. In practice, the OT distance is introduced as a regularization term to the MLE training loss. (ii) Our model can be interpreted as approximate Wasserstein gradient flows, learning to approximately match the sequence distribution induced by the generator and a target data distribution. (iii) In order to demonstrate the versatility of the proposed method, we conduct extensive empirical evaluations on three tasks: machine translation, text summarization, and image captioning.

2. SEMANTIC MATCHING WITH OPTIMAL TRANSPORT:

We consider two components of a sentence: its syntactic and semantic parts. In a Seq2Seq model, it is often desirable to keep the semantic meaning while the syntactic part can be more flexible.

Conventional training schemes, such as MLE, are known to be well-suited for capturing the syntactic structure. As such, we focus on the semantic part. An intuitive way to assess semantic similarity is to directly match the "key words" between the synthesized and the reference sequences. Consider the respective sequences as sets A and B, with vocabularies as their elements. Then the matching can be evaluated by |A ∩ B|, where | • | is the counting measure for sets. We call this hard matching, as it seeks to exactly match words from both sequences.

For language models, the above hard matching could be an over simplification. This is because words have semantic meaning, and two different words can be close to each other in the semantic space. To account for such ambiguity, we can relax the hard matching to soft bipartite matching (SBM). More specifically, assuming all sequences have the same length n, we pair w i k ∈ A and

w j k ∈ B for k ∈ [1, K], such that K ≤ n, {i k }, {j k } are unique and L SBM = k c(w i k , w j k ) is minimized.

Here c(w, w ) is a cost function measuring the semantic dissimilarity between the two words. For instance, the cosine distance c(x, y) = 1 -x y

x 2 y 2 between two word embedding vectors x and y is a popular choice (Pennington et al., 2014) . This minimization can be solved exactly, e.g., via the Hungarian algorithm (Kuhn, 1955) . Unfortunately, its O(n 3 ) complexity scales badly for common NLP tasks, and the objective is also non-differentiable wrt model parameters. As such, end-to-end supervised training is not feasible with the Hungarian matching scheme. To overcome this difficulty, we propose to further relax the matching criteria while keeping the favorable features of a semantic bipartite matching. OT arises as a natural candidate.

2.1. OPTIMAL TRANSPORT AND WASSERSTEIN DISTANCE:

We first provide a brief review of optimal transport, which defines distances between probability measures on a domain X (the sequence space in our setting). The optimal transport distance for two probability measures µ and ν is defined as (Peyré et al., 2017) :

EQUATION

where Π(µ, ν) denotes the set of all joint distributions γ(x, y) with marginals µ(x) and ν(y); c(x, y) : X × X → R is the cost function for moving x to y, e.g., the Euclidean or cosine distance. Intuitively, the optimal transport distance is the minimum cost that γ induces in order to transport from µ to ν. When c(x, y) is a metric on X, D c (µ, ν) induces a proper metric on the space of probability distributions supported on X, commonly known as the Wasserstein distance (Villani, 2008) . One of the most popular choices is the 2-Wasserstein distance W 2 2 (µ, ν) where the squared Euclidean distance c(x, y) = xy 2 is used as cost.

OT distance on discrete domains We mainly focus on applying the OT distance on textual data. Therefore, we only consider OT between discrete distributions. Specifically, consider two discrete distributions µ, ν ∈ P(X), which can be written as µ = n i=1 u i δ xi and ν = m j=1 v j δ yj with δ x the Dirac function centered on x. The weight vectors u = {u i } n i=1 ∈ ∆ n and v = {v i } m i=1 ∈ ∆ m respectively belong to the n and m-dimensional simplex, i.e., n i=1 u i = m j=1 v j = 1, as both µ and ν are probability distributions. Under such a setting, computing the OT distance as defined in (1) is equivalent to solving the following network-flow problem (Luise et al., 2018) :

EQUATION

where

Π(u, v) = {T ∈ R n×m + |T1 m = u, T 1 n = v}, 1

n denotes an n-dimensional all-one vector, C is the cost matrix given by C ij = c(x i , y j ) and T, C = Tr(T C) represents the Frobenius dot-product. We refer to the minimizer T * of (2) as OT matching. Comparing the two objectives, one can readily recognize that soft bipartite matching represents a special constrained solution to (2), where T can only take values in

Γ = {T| max i { Te i 0 , e T i T 0 } ≤ 1, T ij ∈ {0, 1}, T 0 = K} instead of Π(u, v); here • 0 is the L 0 norm

and e i is the unit vector along i-th axis. As such, OT matching can be regarded as a relaxed version of soft bipartite matching. In Figure 1 we illustrate the three matching schemes discussed above.

The IPOT algorithm Unfortunately, the exact minimization over T is in general computational intractable (Arjovsky et al., 2017; Genevay et al., 2018; Salimans et al., 2018) . To overcome such intractability, we consider an efficient iterative approach to approximate the OT distance. We propose to use the recently introduced Inexact Proximal point method for Optimal Transport (IPOT) algorithm to compute the OT matrix T * , thus also the OT distance (Xie et al., 2018) . IPOT provides a solution to the original OT problem specified in (2). Specifically, IPOT iteratively solves the following optimization problem using the proximal point method (Boyd & Vandenberghe, 2004) :

EQUATION

where the proximity metric term B(T, T (t) ) penalizes solutions that are too distant from the latest approximation, and1 β is understood as the generalized stepsize. This renders a tractable iterative scheme towards the exact OT solution. In this work, we employ the generalized KL Bregman divergence B(T,

T (t) ) = i,j T ij log Tij T (t) ij -i,j T ij + i,j T (t)

ij as the proximity metric. Algorithm 1 describes the implementation details for IPOT.

Algorithm 1 IPOT algorithm 1:

Input: Feature vectors S = {zi} n 1 , S = {z j } m 1 and generalized stepsize 1/β, 2: σ = 1 m 1m, T (1) = 1n1m 3: Cij = c(zi, z j ), Aij = e - C ij β 4: for t = 1, 2, 3 . . . do 5: Q = A T (t) // is Hadamard product 6: for k = 1, . . . K do // K = 1 in practice 7: δ = 1 nQσ , σ = 1 mQ δ 8:

end for 9:

T (t+1) = diag(δ)Qdiag(σ) 10: end for 11: Return T, C

Note that the Sinkhorn algorithm (Cuturi, 2013) can also be used to compute the OT matrix.

Specifically, the Sinkhorn algorithm tries to solve the entropy regularized optimization problem:

Lot (µ, ν) = min T∈Π(u,v) T, C -1 H(T) ,

where

H(T) = -i,j T ij (log(T ij ) -1)

is the entropy regularization term and > 0 is the regularization strength. However, in our experiments, we empirically found that the numerical stability and performance of the Sinkhorn algorithm is quite sensitive to the choice of the hyper-parameter , thus only IPOT is considered in our model training.

2.2. OPTIMAL TRANSPORT DISTANCE AS A SEQUENCE LEVEL LOSS:

Figure 2 illustrates how OT is computed to construct the sequence-level loss. Given two sentences, we can construct their word-level or phrase-level embedding matrices S and S , where S = {z i } is usually recognized as the reference sequence embedding and S = {z j } for the model output sequence embedding. The cost matrix C is then computed by C ij = c(z i , z j ) and passed on to the IPOT algorithm to get the OT distance. Our full algorithm is summarized in Algorithm 2, and more detailed model specifications are given below.

Encoding model belief with a differentiable sequence generator We first describe how to design a differentiable sequence generator so that the gradients can be backpropagated from the OT losses to update the model belief. The Long Short-Term Memory (LSTM) recurrent neural network (Hochreiter & Schmidhuber, 1997) is used as our sequence model. At each timestep t, the LSTM decoder outputs a logit vector v t for the vocabularies, based on its context. Directly sampling from the multinomial distribution ŵt ∼ Softmax(v t ) is a non-differentiable operation 1 , so we consider the following differentiable alternatives:

• Soft-argmax: ŵSA t = Softmax(v t /τ ), where τ ∈ (0, 1) is the annealing parameter (Zhang et al., 2017) . This approximates the deterministic sampling scheme ŵmax t = arg max{v t }; • Gumbel-softmax (GS): ŵGS t = Softmax((v t + ξ t )/τ ), where ξ t are iid Gumbel random variables for each of the vocabulary. It is also known as the Concrete distribution (Jang et al., 2016; Maddison et al., 2017) . Unstable training and sub-optimal solutions have been observed for the GS-based scheme for the Seq2Seq tasks we considered (see Appendix G, Table 11 ), possibly due to the extra uncertainty introduced. As such, we will assume the use of soft-argmax to encode model belief in ŵt unless otherwise specified. Note ŵt is a normalized non-negative vector that sums up to one.

Sequence-level OT-matching loss:

To pass on the model belief to the OT loss, we use the mean word embedding predicted by the model, given by ẑt = E T ŵt , where E ∈ R V ×d is the word embedding matrix, V is the vocabulary size and d is the dimension for the embedding vector. We collect the predicted sequence embeddings into S g = { ẑt } L t=1 , where L is the length of sequence. Similarly we denote the reference sequence embeddings as S r = {z t } L t=1 , using ground truth onehot input token sequence {w t }. Based on the sequence embeddings S r and S g , we can compute the sequence-level OT loss between ground-truth and model prediction using the IPOT algorithm described above for different Seq2Seq tasks:

EQUATION

)

Algorithm 2 Seq2Seq Learning via Optimal Transport. Soft-copying mechanism We additionally consider feature matching using the OT criteria between the source and target. Intuitively, it will encourage the global semantic meaning to be preserved from source to target. This is related to the copy network (Gu et al., 2016) . However, in our framework, the copying mechanism can be understood as a soft optimal-transport-based copying, instead of the original hard retrieved-based copying used by Gu et al. (2016) . This soft copying mechanism considers semantic similarity in the embedding space, and thus presumably delivers smoother transformation of information. In the case where the source and target sequences do not share vocabulary (e.g., machine translation), this objective can still be applied by sharing the word embedding space between source and target. Ideally, the embedding for the same concept in different languages will automatically be aligned by optimizing such loss, making available a cosinesimilarity-based cost matrix. This is also related to bilingual skip-gram (Luong et al., 2015b) . We denote this loss as L copy IPOT(S g , S s ), where S s represents the source sequence embeddings.

Complementing MLE training with OT regularization OT training objectives discussed above can not train a proper language model on its own, as they do not explicitly consider word ordering, i.e., the syntactic strucuture of a language model. To overcome this issue, we propose to combine the OT loss with the de facto likelihood loss L MLE , which gives us the final training objective: L = L MLE + γL seq , where γ > 0 is a hyper-parameter to be tuned. For tasks with both input and output sentences, such as machine translation and text summarization, L copy can be applied, in which case the final objective can be written as L = L MLE + γ 1 L copy + γ 2 L seq .

3. INTERPRETATION AS APPROXIMATE WASSERSTEIN GRADIENT FLOWS:

To further justify the use of our approach (minimizing the loss {L MLE +γL ot }, where L ot denotes the Wasserstein loss), we now explain how our model approximately learns to match the ground-truth sequence distribution. Our derivation is based on the theory of Wasserstein gradient flows (WGF) (Villani, 2008) . In WGF, the Wasserstein distance describes the local geometry of a trajectory in the space of probability measures converging to a target distribution (Ambrosio et al., 2005) . In the following, we show that the proposed method learns to approximately match the data distribution, from the perspective of WGF. For simplicity we only discuss the continuous case, while a similar argument also holds for the discrete case (Li & Montufar, 2018) .

We denote the induced distribution of the sequences generated from the decoder at the l-th iteration as µ l . Assume the sequence data distribution is given by p d (x). Intuitively, the optimal generator in a Seq2Seq model learns a distribution µ * (x) that matches p d (x). Based on Craig (2014), this can be achieved by composing a sequence of discretized WGFs given by:

EQUATION

with J h (•) defined as

EQUATION

where λ = 1/(2h) is a regularization parameter (h is the generalized learning rate); W 2 2 (µ, ν) denotes the 2-Wasserstein distance between µ and ν; P s is the space of distributions with finite 2nd-order moments; and

D KL (ν p d ) = E x∼ν [log ν(x) -log p d (x)] is the Kullback-Leibler (KL)

divergence. It is not difficult to see that discreteized WGF is essentially optimizing the KL divergence with a proximal descent scheme, using the 2-Wasserstein distance as the proximity metric.

We denote µ * h = lim l→∞ µ l with generalized learning rate h. It is well known that lim h→0 µ * h = p d (Chen et al., 2018a) , that is to say the induced model distribution µ l asymptotically converges to the data distribution p d . In our case, instead of using L WGF (µ, ν) as the loss function, we define a surrogate loss using its upper bound L WGF (µ, ν) ≤ L WGF (p d , ν), where the inequality holds because (6) converges to p d . When our model distribution µ is parameterized by θ, µ l can be solved with stochastic updates on θ based on the following equation with stepsize η:

θ l ← θ l-1 + η∇ θ L WGF (p d , µ l-1 ) = θ l-1 + η{∇ θ D KL (µ l-1 p d ) + 1 2h ∇ θ W 2 2 (p d , µ l-1 )} . (7)

Unfortunately, ( 7) is an infeasible update as we do not know p d . However, we argue that this update is still locally valid when current model approximation µ l-1 is close to p d . To see this, recall that the KL-divergence is a natural Riemannian metric on the space of probability measures (Amari, 1985) , therefore it is locally symmetric. µ ). This justifies the use of our proposed scheme in a model-refinement stage, where model distribution µ is sufficiently close to p d . Empirically, we have observed that our scheme also improves training even when µ is distant from p d . While the above justification is developed based on Euclidean transport, other non-Euclidean costs such as cosine distance usually yield better empirical performance as they are more adjusted to the geometry of sequence data.

4. RELATED WORK AND DISCUSSION:

Optimal transport in NLP Although widely used in other fields such as computer vision (Rubner et al., 2000) , OT has only been applied in NLP recently. Pioneered by the work of Kusner et al. (2015) on word mover's distance (WMD), existing literature primarily considers OT either on a macroscopic level like topic modeling (Huang et al., 2016) , or a microscopic level such as word embedding (Xu et al., 2018) . Euclidean distance, instead of other more general distance, is often used as the transportation cost, in order to approximate the OT distance with the Kantorovich-Rubinstein duality (Gulrajani et al., 2017) or a more efficient yet less accurate lower bound (Kusner et al., 2015) . Our work employs OT for mesoscopic sequence-to-sequence models, presenting an efficient IPOT-based implementation to enable end-to-end learning for general cost functions. The proposed OT not only refines the word embedding matrix but also improves the Seq2Seq model (see Appendix H for details).

RL for sequence generation A commonly employed strategy for sequence-level training is via reinforcement learning (RL). Typically, this type of method employs RL by considering the evaluation metrics as the reward to guide the generation (Bahdanau et al., 2017; Huang et al., 2018; Ranzato et al., 2016; Rennie et al., 2017; Zhang et al., 2018a) . However, these approaches often introduce procedures that may yield large-variance gradients, resulting in unstable training. Moreover, it has been recognized that these automatic metrics may have poor correlation with human judgments in many scenarios (Wang et al., 2018b) . As such, reinforcing the evaluation metrics can potentially boost the quantitative scores but not necessarily improve the generation quality, as such metrics usually encourage exact text snippets overlapping rather than semantic similarity. Some nonstandard metrics like SPICE (Anderson et al., 2016 ) also consider semantic similarity, however they also can not learn a good model on their own (Liu et al., 2017) . Unlike RL methods, our method requires no human-defined rewards, thus preventing the model from over-fitting to one specific metric. As a concrete example, the two semantically similar sentences "do you want to have lunch with us " and "would you like to join us for lunch" would be considered as a bad match based on automatic metrics like BLEU, however, be rated as reasonable match in OT objective.

GAN for sequence generation Another type of method adopts the framework of generative adversarial networks (GANs) (Goodfellow et al., 2014) , by providing sequence-level guidance based on a learned discriminator (or, critic). To construct such a loss, Fedus et al. (2018) ; Guo et al. (2018) ; Lin et al. (2017) ; Yu et al. (2017) combine the policy-gradient algorithm with the original GAN training procedure, while Chen et al. (2018b) ; Zhang et al. (2017) uses a so-called feature mover distance and maximum mean discrepancy (MMD) to match features of real and generated sentences, respectively. 

5. EXPERIMENTS:

We consider a wide range of NLP tasks to experimentally validate the proposed model, and benchmark it with other strong baselines. All experiments are implemented with Tensorflow and run on a single NVIDIA TITAN X GPU. Code for our experiments are available from https: //github.com/LiqunChen0606/Seq2Seq-OT.

5.1. NEURAL MACHINE TRANSLATION:

We test our model on two datasets: (i) a small-scale English-Vietnamese parallel corpus of TEDtalks, which has 133K sentence pairs from the IWSLT Evaluation Campaign (Cettolo et al., 2015) ; and (ii) a large-scale English-German parallel corpus with 4.5M sentence pairs, from the WMT Evaluation Campaign (Vaswani et al., 2017) . We used Google's Neural Machine Translation (GMNT) model (Wu et al., 2016) as our baseline, following the architecture and hyper-parameter settings from the GNMT repository2 to make a fair comparison. For the English-Vietnamese (i.e., VI-EN and EN-VI) tasks, a 2-layer LSTM with 512 units in each layer is adopted as the decoder, with a 1-layer bidirectional-LSTM adopted as the encoder; the word embedding dimension is set to 512. Attention proposed in Luong et al. (2015a) is used together with a dropout rate of 0.2. For the English-German (i.e., DE-EN and EN-DE) tasks, we train a 4-layer LSTM decoder with 1024 units in each layer. A 2-layer bidirectional-LSTM is used as the encoder, and we adopt the attention used in Wu et al. (2016) . The word embedding dimension is set to 1024. Standard stochastic gradient descent is used for training with a decreasing learning rate, and we set β = 0.5 for the IPOT algorithm. More training details are provided in Appendix A. In terms of wall-clock time, our model only slightly increases training time. For the German-English task, it took roughly 5.5 days to train the GNMT model, and 6 days to train our proposed model from scratch, which only amounts to a roughly 10% increase.

We apply different combinations of L copy and L seq to fine-tune the pre-trained GNMT model (Luong et al., 2018) and the results are summarized in Table 1 and 2 We additionally tested our model with a more expressive 8-layer LSTM model on the EN-DE task.

The BLEU score of our method is 28.0 on NT2015. For reference, the GNMT model (same architecture) and a Transformer model (Vaswani et al., 2017) respectively report a score of 27.6 and 27.3.

Our method outperforms both baselines, and it is also competitive to the state-of-the-art BLEU score 28.4 reported by Vaswani et al. (2017) using a highly sophisticated model design.

The German-to-English translation examples are provided in Table 3 for qualitative assessment. The main differences among the reference translation, our translation and the GNMT translation are highlighted in blue and red. Our OT-augmented translations are more faithful to the reference than its MLE-trained counterpart. The soft-copying mechanism introduced by OT successfully maintains the key semantic content from the reference. Presumably, the OT loss helps refine the word embedding matrices, and promotes matching between words with similar semantic meanings. Vanilla Table 6 : Results for image captioning on the COCO dataset.

Method BLEU-1 BLEU-2 BLEU-3 BLEU-4 METEOR CIDEr Soft Attention (Xu et al., 2015) 70.7 49.2 34.4 24.3 23.9 -Hard Attention (Xu et al., 2015) 71.8 50.4 35.7 25.0 23.0 -Show & Tell (Vinyals et al., 2015) ---27.7 23.7 85.5 ATT-FCN (You et al., 2016) 70.9 53.7 40.2 30.4 24.3 -SCN-LSTM (Gan et al., 2017) 72.8 56.6 43.3 33.0 25.7 101.2 Adaptive Attention (Lu et al., 2017) 74.2 58.0 43.9 33.2 26.6 108.5 Top-Down Attention (Anderson et al., 2018) 77 split (Karpathy & Fei-Fei, 2015) , 113,287 images are used for training and 5,000 images are used for validation and testing. We follow the implementation of the Show, Attend (Xu et al., 2015) 4 , and use Resnet-152 (He et al., 2016) , image tagging (Gan et al., 2017) , and FastRCNN (Anderson et al., 2018) as the image feature extractor (encoder), and a one-layer LSTM with 1024 units as the decoder. The word embedding dimension is set to 512. Note that in this task, the input are images instead of sequences, therefore L copy cannot be applied.

We report BLEU-k (k from 1 to 4) (Papineni et al., 2002) , CIDEr (Vedantam et al., 2015) , and METEOR (Banerjee & Lavie, 2005) scores and the results with different settings are shown in Table 6 . Consistent across-the-board improvements are observed with the introduction of the OT loss, in contrast to the RL-based methods where drastic improvements can only be observed for the optimized evaluation metric (Rennie et al., 2017) . Consequently, the OT loss is a more reliable method to improve the quality of generated captions when compared with RL methods that aim to optimize and therefore potentially overfit one specific metric. Examples of generated captions are provided in Appendix F.

6. CONCLUSION:

This work is motivated by the major deficiency in training Seq2Seq models: that the MLE training loss does not operate at sequence-level. Inspired by soft bipartite matching, we propose the usage of optimal transport as a sequence-level loss to improve Seq2Seq learning. By applying this new method to machine translation, text summarization, and image captioning, we demonstrate that our proposed model can be used to help improve the performance compared to strong baselines. We believe the proposed method is a general framework, and will be useful to other sequence generation tasks as well, such as conversational response generation (Li et al., 2017; Zhang et al., 2018c) , which is left as future work.

C BLEU SCORE FOR DIFFERENT HYPER-PARAMETERS:

We tested different γ for the OT loss term and summarized the results in Figure 3 . γ = 0.1 gave the best performance for the EN-VI experiment. The results are robust wrt the choice of γ ≤ 1.0. 

D SUMMARIZATION EXAMPLES:



Examples:

Reference: When former First Lady Eleanor Roosevelt chaired the International Commission on Human Rights, which drafted the Universal Declaration of Human Rights that would in 1948 be adopted by the United Nations as a global covenant, Roosevelt and the drafters included a guarantee that "everyone has the right to form and to join trade unions for the protection of his interests." Ours:

When former First Lady Eleanor Roosevelt held the presidency of the International Commission on Human Rights , drafted by the Universal Declaration of Human Rights , adopted in 1948 by the United Nations as a global agreement , Roosevelt and the other authors gave a guarantee that " everyone has the right to form or join trade unions to protect their interests . " GNMT:

When former First Lady Eleanor Roosevelt presided over the International Human Rights Committee , which drew up the Universal Declaration of Human Rights , as adopted by the United Nations in 1948 as a agreement , Roosevelt and the other authors added a guarantee that " everyone has the right to form trade unions to protect their interests or to accede to them " . Reference: India's new prime minister, Narendra Modi, is meeting his Japanese counterpart, Shinzo Abe, in Tokyo to discuss economic and security ties, on his first major foreign visit since winning May's election. Ours:

India s new Prime Minister Narendra Modi meets his Japanese counterpart , Shinzo Abe , in Tokyo at his first major foreign visit since his election in May in order to discuss economic and security relations . GNMT:

India s new prime minister , Narendra Modi , is meeting his Japanese counterpart , Shinzo Abe , in Tokyo at his first important visit abroad in May to discuss economic and security relations . Reference: The police used tear gas . Ours:

The police used tear gas . GNMT:

The police put in tear gas . Reference: There were three people killed. Ours:

Three people were killed . GNMT:

Three people had been killed . Reference: The next day, turning up for work as usual, she was knocked down by a motorcyclist who had mounted the pavement in what passers-by described as a "vicious rage." Ours:

The next day , when she went to work as usual , she was crossed by a motorcyclist who , as described by passers-by , was in a sort of " brutal rage " on the road . GNMT:

The next day , when she went to work as usual , she was driven by a motorcyclist who , as passants described , went on foot in a kind of " brutal anger " . Reference: Double-check your gear. Ours:

Check your equipment twice . GNMT:

Control your equipment twice . Reference: Chinese leaders presented the Sunday ruling as a democratic breakthrough because it gives Hong Kongers a direct vote, but the decision also makes clear that Chinese leaders would retain a firm hold on the process through a nominating committee tightly controlled by Beijing. Ours:

The Chinese leadership presented Sunday s decision as a democratic breakthrough because it gives the citizens of Hong Kong a direct right to vote , but the decision also makes it clear that the Chinese leadership keeps the process firmly in the hands of a government-controlled Nomination Committee . GNMT:

The Chinese leadership presented Sunday s decision as a democratic breakthrough , because Hong Kong s citizens have a direct right to vote , but the decision also makes it clear that the Chinese leadership is firmly in control of the process through a UN-controlled nomination committee . Reference: Her mother arrived at Mount Sinai Hospital Thursday after an emergency call that she was in cardiac arrest at an Upper East Side clinic, Yorkville Endoscopy, sources said. Ours:

According to sources , her mother was sent to Mount Sinai on Thursday after an emergency due to heart failure in a clinic at the Upper East Side , Yorkville Endoscopy . GNMT:

According to sources , her mother was sent to Mount Sinai hospital on Thursday after an emergency due to heart closure in a clinic at the Upper East Side , Yorkville Endoscopy . Reference: Ukrainian soldiers had to withdraw from their positions in Ilovaysk after two columns of Russian armor and 1,000 troops last week moved into the Donetsk region to bolster the beleaguered separatists, Col. Andriy Lysenko, spokesman for the Ukrainian National Security and Defense Council, told reporters in Kiev on Saturday. Ours:

Ukrainian soldiers had to withdraw from their positions in Ilowajsk after two Russian tanks and 1,000 soldiers entered the Donetsk region last week to support the belated separatists , said Colonel Andrij Lysenko , Speaker of the Ukrainian National Security and Defence Council Reporters on Saturday in Kiev . GNMT:

Ukrainian soldiers had to withdraw from their positions in Ilowajsk after two Russian tanks and 1,000 soldiers invaded the Donetsk region last week to support the beloved separatists , said Colonel Andriy Lysenko , Ukrainian National Security and Defence Council spokesman on Saturday in Kiev . Reference: Mountain Rescue doctor, Professor Volker Lischke, who was there with his team to provide safety, and who was equipped with a four-wheel Bully and Quad, said: "I know him from Frankfurt -he trains for a specialist sleigh trail -it's just that he pulls the sleigh himself." The man is, therefore, in a sense his own sleigh dog. Ours:

Bergwacht doctor Professor Volker Lischke , who , with his team , endowed with Allrad-Bully and Quad for safety , said : " The kenn " I from Frankfurt , trained for a special sleigh trail , just that he trains the sleigh himself " , so the man is , in a sense , his own sled dog . GNMT:

Bergwacht physician Professor Volker Lischke , who with his team , equipped with Allrad-Bully and Quad , for safety , said : " Den kenn " ich aus Frankfurt , which trained for a special Schlittentrail , only to stop the sleigh itself " , so the man is in some way his own hook dog .

:

Here ŵt is understood as an one-hot vector in order to be notationally consistent with its differentiable alternatives.

https://github.com/tensorflow/nmt

https://github.com/thunlp/TensorFlow-Summarization

https://github.com/DeepRNN/image_captioning

Figures and Tables:

Figure 1: Different matching schemes. Left to right: hard matching, soft bipartite matching and OT matching. Dominant edges are shown in dark green for OT matching.

Figure 2: Schematic computation graph of OT loss.

. . Additional results for training from scratch are provided in Appendix B. The proposed OT approach consistently improves upon MLE training in all experimental setups.

Figure 3: the performance of EN-VI translation by different γ.

Input: batch size m, paired input and output sequences (X, Y) 2: Load MLE pre-trained Seq2Seq model M(•; θ) and word embedding E 3: for iteration = 1, . . .

Table content: <table><tr><td/><td>MaxIter do</td></tr><tr><td>4:</td><td>for i = 1, . . . , m do</td></tr><tr><td>5:</td><td colspan="2">Draw a pair of sequences xi, yi ∼ (X, Y), where xi = { wi,t}, yi = {wi,t}</td></tr><tr><td>6:</td><td colspan="2">Compute logit vectors from model: {vi,t} = M(xi; θ)</td></tr><tr><td>7:</td><td colspan="2">Encode model belief: ŵi,t = Soft-argmax(vi,t)</td></tr><tr><td>8:</td><td colspan="2">Feature vector embedding: Sr,i = {E T wi,t}, Sg,i = {E T ŵi,t}</td></tr><tr><td colspan="2">9: 10: 11: end for end for Update the M(•; θ) by optimizing: 1 m</td><td>m i=1 [LMLE(xi, yi; θ) + γLseq(Sr,i, Sg,i)]</td></tr></table>

So we can safely replace the D KL (µ p d ) term with D KL (p d µ) when µ is close to p d . This recovers the loss function L MLE + γL seq derived in Section 2.2 as D KL (p d µ) = L MLE + H(p d ), where H(p d ) is the entropy of p d , independent of µ, and L seq = W 2 2 (p d ,

Table content: <table/>

BLEU scores onVI-EN and EN-VI.

Table content: <table><tr><td>Systems</td><td colspan="2">NT2012 NT2013</td></tr><tr><td>VI-EN: GNMT</td><td>20.7</td><td>23.8</td></tr><tr><td>VI-EN: GNMT+Lseq</td><td>21.9</td><td>25.4</td></tr><tr><td>VI-EN: GNMT+Lseq+Lcopy</td><td>21.9</td><td>25.5</td></tr><tr><td>EN-VI: GNMT</td><td>23.8</td><td>26.1</td></tr><tr><td>EN-VI: GNMT+Lseq</td><td>24.4</td><td>26.5</td></tr><tr><td>EN-VI: GNMT+Lseq+Lcopy</td><td>24.5</td><td>26.9</td></tr></table>

BLEU scores onDE-EN and EN-DE.    However, mode-collapse and gradient-vanishing problems make the training of these methods challenging. Unlike GAN methods, since no min-max games are involved, the training of our model is more robust. Moreover, compared with GAN, no additional critic is introduced in our model, which makes the model complexity comparable to MLE and less demanding to tune.

Table content: <table><tr><td>Systems</td><td colspan="2">NT2013 NT2015</td></tr><tr><td>DE-EN: GNMT</td><td>29.0</td><td>29.9</td></tr><tr><td>DE-EN: GNMT+Lseq</td><td>29.1</td><td>29.9</td></tr><tr><td>DE-EN: GNMT+Lseq+Lcopy</td><td>29.2</td><td>30.1</td></tr><tr><td>EN-DE: GNMT</td><td>24.3</td><td>26.5</td></tr><tr><td>EN-DE: GNMT+Lseq</td><td>24.3</td><td>26.6</td></tr><tr><td>EN-DE: GNMT+Lseq+Lcopy</td><td>24.6</td><td>26.8</td></tr></table>

Examples on Text Summarization.

Table content: <table><tr><td>Examples</td><td/></tr><tr><td>Source:</td><td>japan 's nec corp. and UNK computer corp. of the united states said wednesday they had agreed to join</td></tr><tr><td/><td>forces in supercomputer sales .</td></tr><tr><td colspan="2">Reference: nec UNK in computer sales tie-up</td></tr><tr><td>Baseline:</td><td>nec UNK computer corp.</td></tr><tr><td>Ours:</td><td>nec UNK computer corp sales supercomputer.</td></tr><tr><td>Source:</td><td>five east timorese youths who scaled the french embassy 's fence here thursday , left the embassy on their</td></tr><tr><td/><td>way to portugal friday .</td></tr><tr><td colspan="2">Reference: UNK latest east timorese asylum seekers leave for portugal</td></tr><tr><td>Baseline:</td><td>five east timorese youths leave embassy</td></tr><tr><td>Ours:</td><td>five east timorese seekers leave embassy for portugal</td></tr><tr><td>Source:</td><td>the us space shuttle atlantis separated from the orbiting russian mir space station early saturday , after three days of</td></tr><tr><td/><td>test runs for life in a future space facility , nasa announced .</td></tr><tr><td colspan="2">Reference: atlantis mir part ways after three-day space collaboration by emmanuel UNK</td></tr><tr><td>Baseline:</td><td>atlantis separate from mir</td></tr><tr><td>Ours:</td><td>atlantis separate from mir space by UNK</td></tr><tr><td>Source:</td><td>australia 's news corp announced monday it was joining brazil 's globo , mexico 's grupo televisa and the us</td></tr><tr><td/><td>tele-communications inc. in a venture to broadcast ### channels via satellite to latin america .</td></tr><tr><td colspan="2">Reference: news corp globo televisa and tele-communications in satellite venture</td></tr><tr><td>Baseline:</td><td>australia 's news corp joins brazil</td></tr><tr><td>Ours:</td><td>australia 's news corp joins brazil in satellite venture</td></tr><tr><td colspan="2">Examples for abstract summarization are provided in Table 9.</td></tr><tr><td colspan="2">E NEURAL MACHINE TRANSLATION EXAMPLES</td></tr><tr><td colspan="2">In Table 10, we show more examples for comparison. From these examples, sentences generated</td></tr><tr><td colspan="2">from our model are more faithful to the reference sentences.</td></tr></table>

More DE-EN translation examples.

Table content: <table/>

Peer review (iclr2019):
 This submission deals with text generation. It proposes a sequence level objective, motivated by optimal transport, which is used as a regularizer to the (more standard) MLE. The goal is to complement MLE by allowing `soft matches` between different tokens with similar meanings. Empirical evaluation shows that the proposed technique improves over baselines on many sequence prediction tasks. I found this paper well motivated and a nice read. I would vote for acceptance. Pros: - A well-motivated and interesting method. - Solid empirical results. - Writing is clear. Cons: - The split of `syntax--MLE` and `semantics--OT` seems a bit awkward to me. Matching the exact tokens does not appear syntax to me. - Some technical details need to be clarified. Details: - Could the authors comment on the efficiency by using the IPOT approximate algorithm, e.g., how much speed-up can one get? I*m not familiar with this algorithm, but is there convergence guarantee or one has to set some kind of maximum iterations when applying it in this model? - Bottom of page 4, the `Complementary MLE loss paragraph`. I thought the OT loss is used as a regularizer, from the introduction. If the paper claims MLE is actually used as the complements, evidence showing that the OT loss works reasonably well on its own without including log loss, which I think is not included in the experiments. - I really like the analysis presented in Section 3. But it*s a bit hard for me to follow, and additional clarification might be needed. - It would be interesting to see whether the `soft-copying` version of OT-loss can be combined with the copy mechanisms based on attention weights. ================================ Thanks for the clarification and revision! It addressed some of my concerns. I would stick to the current rating, and vote for an acceptance.