Title: MONOTONIC MULTIHEAD ATTENTION

Abstract: Simultaneous machine translation models start generating a target sequence before they have encoded the source sequence. Recent approaches for this task either apply a fixed policy on a state-of-the art Transformer model, or a learnable monotonic attention on a weaker recurrent neural network-based structure. In this paper, we propose a new attention mechanism, Monotonic Multihead Attention (MMA), which extends the monotonic attention mechanism to multihead attention. We also introduce two novel and interpretable approaches for latency control that are specifically designed for multiple attention heads. We apply MMA to the simultaneous machine translation task and demonstrate better latency-quality tradeoffs compared to MILk, the previous state-of-the-art approach. We analyze how the latency controls affect the attention span and we study the relationship between the speed of a head and the layer it belongs to. Finally, we motivate the introduction of our model by analyzing the effect of the number of decoder layers and heads on quality and latency. 1

1. INTRODUCTION:

Simultaneous machine translation adds the capability of a live interpreter to machine translation: a simultaneous model starts generating a translation before it has finished reading the entire source sentence. Such models are useful in any situation where translation needs to be done in real time. For example, simultaneous models can translate live video captions or facilitate conversations between people speaking different languages. In a usual translation model, the encoder first reads the entire sentence, then the decoder writes the target sentence. On the other hand, a simultaneous neural machine translation model alternates between reading the input and writing the output using either a fixed or learned policy.

Monotonic attention mechanisms fall into the flexible policy category, in which the policies are automatically learned from data. Recent work exploring monotonic attention variants for simultaneous translation include: hard monotonic attention (Raffel et al., 2017) , monotonic chunkwise attention (MoChA) (Chiu & Raffel, 2018) and monotonic infinite lookback attention (MILk) (Arivazhagan et al., 2019) . MILk in particular has shown better quality/latency trade-offs than fixed policy approaches, such as wait-k (Ma et al., 2019) or wait-if-* (Cho & Esipova, 2016) policies. MILk also outperforms hard monotonic attention and MoChA; while the other two monotonic attention mechanisms only consider a fixed window, MILk computes a softmax attention over all previous encoder states, which may be the key to its improved latency-quality tradeoffs. These monotonic attention approaches also provide a closed-form expression for the expected alignment between source and target tokens.

However, monotonic attention-based models, including the state-of-the-art MILk, were built on top of RNN-based models. RNN-based models have been outperformed by the recent state-of-the-art Transformer model (Vaswani et al., 2017) , which features multiple encoder-decoder attention layers and multihead attention at each layer.

We thus propose monotonic multihead attention (MMA), which combines the high translation quality from multilayer multihead attention and low latency from monotonic attention. We propose two variants, Hard MMA (MMA-H) and Infinite Lookback MMA (MMA-IL). MMA-H is designed with streaming systems in mind where the attention span must be limited. MMA-IL emphasizes the quality of the translation system. We also propose two novel latency regularization methods. The first encourages the model to be faster by directly minimizing the average latency. The second encourages the attention heads to maintain similar positions, preventing the latency from being dominated by a single or a few heads.

The main contributions of this paper are: (1) A novel monotonic attention mechanism, monotonic multihead attention, which enables the Transformer model to perform online decoding. This model leverages the power of the Transformer and the efficiency of monotonic attention. (2) Better latency/quality tradeoffs compared to the MILk model, the previous state-of-the-art, on two standard translation benchmarks, IWSLT15 English-Vietnamese (En-Vi) and WMT15 German-English (De-En). ( 3) Analyses on how our model is able to control the attention span and on the relationship between the speed of a head and the layer it belongs to. We motivate the design of our model with an ablation study on the number of decoder layers and the number of decoder heads.

2. MONOTONIC MULTIHEAD ATTENTION MODEL:

In this section, we review the monotonic attention-based approaches in RNN-based encoder-decoder models. We then introduce the two types of Monotonic Multihead Attention (MMA) for Transformer models: MMA-H and MMA-IL. Finally, we introduce strategies to control latency and coverage.

2.1. MONOTONIC ATTENTION:

The hard monotonic attention mechanism (Raffel et al., 2017) was first introduced in order to achieve online linear time decoding for RNN-based encoder-decoder models. We denote the input sequence as x = {x 1 , ..., x T }, and the corresponding encoder states as m = {m 1 , ..., m T }, with T being the length of the source sequence. The model generates a target sequence y = {y 1 , ..., y U } with U being the length of the target sequence. At the i-th decoding step, the decoder only attends to one encoder state m ti with t i = j. When generating a new target token y i , the decoder chooses whether to move one step forward or to stay at the current position based on a Bernoulli selection probability p i,j , so that t i ≥ t i-1 . Denoting the decoder state at the i-th position, starting from j = t i-1 , t i-1 + 1, t i-1 + 2, ..., this process can be calculated as follows:2 e i,j = MonotonicEnergy(s i-1 , m j )

(1) p i,j = Sigmoid (e i,j )

(2)

EQUATION

When z i,j = 1, we set t i = j and start generating a target token y i ; otherwise, we set t i = j + 1 and repeat the process. During training, an expected alignment α is introduced to replace the softmax attention. It can be calculated in a recurrent manner, shown in Equation 4:

EQUATION

Raffel et al. ( 2017) also introduce a closed-form parallel solution for the recurrence relation in Equation 5:

EQUATION

where

cumprod(x) = [1, x 1 , x 1 x 2 , ..., |x|-1 i=1 x i ] and cumsum(x) = [x 1 , x 1 + x 2 , ..., |x| i=1 x i ].

In practice, the denominator in Equation 5 is clamped into a range of [ , 1] to avoid numerical instabilities introduced by cumprod. Although this monotonic attention mechanism achieves online linear time decoding, the decoder can only attend to one encoder state. This limitation can diminish translation quality as there may be insufficient information for reordering.

Moreover, the model lacks a mechanism to adjust latency based on different requirements at decoding time. To address these issues, Chiu & Raffel (2018) introduce Monotonic Chunkwise Attention (MoChA), which allows the decoder to apply softmax attention to a fixed-length subsequence of encoder states. Alternatively, Arivazhagan et al. (2019) introduce Monotonic Infinite Lookback Attention (MILk) which allows the decoder to access encoder states from the beginning of the source sequence. The expected attention for the MILk model is defined in Equation 6.

β i,j = |x| k=j α i,k exp(u i,j ) k l=1 exp(u i,l ) (6)

2.2. MONOTONIC MULTIHEAD ATTENTION:

Previous monotonic attention approaches are based on RNN encoder-decoder models with a single attention and haven't explored the power of the Transformer model. 3 The Transformer architecture (Vaswani et al., 2017) has recently become the state-of-the-art for machine translation (Barrault et al., 2019) . An important feature of the Transformer is the use of a separate multihead attention module at each layer. Thus, we propose a new approach, Monotonic Multihead Attention (MMA), which combines the expressive power of multihead attention and the low latency of monotonic attention.

Multihead attention allows each decoder layer to have multiple heads, where each head can compute a different attention distribution. Given queries Q, keys K and values V , multihead attention MultiHead(Q, K, V ) is defined in Equation 7.

EQUATION

The attention function is the scaled dot-product attention, defined in Equation 8:

Attention(Q, K, V ) = Softmax QK T √ d k V (8)

There are three applications of multihead attention in the Transformer model:

1. The Encoder contains self-attention layers where all of the queries, keys and values come from previous layers. 2. The Decoder contains self-attention layers that allow each position in the decoder to attend to all positions in the decoder up to and including that position. 3. The Encoder-Decoder attention contains multihead attention layers where queries come from the previous decoder layer and the keys and values come from the output of the encoder. Every decoder layer has a separate encoder-decoder attention.

For MMA, we assign each head to operate as a separate monotonic attention in encoder-decoder attention.

For a transformer with L decoder layers and H attention heads per layer, we define the selection process of the h-th head encoder-decoder attention in the l-th decoder layer as

EQUATION

p l,h i,j

= Sigmoid(e i,j ) (10) where W l,h is the input projection matrix, d k is the dimension of the attention head. We make the selection process independent for each head in each layer. We then investigate two types of MMA, MMA-H(ard) and MMA-IL(infinite lookback). For MMA-H, we use Equation 4in order to calculate the expected alignment for each layer each head, given p l,h i,j . For MMA-IL, we calculate the softmax energy for each head as follows:

EQUATION

EQUATION

and then use Equation 6to calculate the expected attention. Each attention head in MMA-H hardattends to one encoder state. On the other hand, each attention head in MMA-IL can attend to all previous encoder states. Thus, MMA-IL allows the model to leverage more information for translation, but MMA-H may be better suited for streaming systems with stricter efficiency requirements. Finally, our models use unidirectional encoders: the encoder self-attention can only attend to previous states, which is also required for simultaneous translation.

At inference time, our decoding strategy is shown in Algorithm 1. For each l, h, at decoding step i, we apply the sampling processes discussed in subsection 2.1 individually and set the encoder step at t l,h i . Then a hard alignment or partial softmax attention from encoder states, shown in Equation 13, will be retrieved to feed into the decoder to generate the i-th token. The model will write a new target token only after all the attentions have decided to write. In other words, the heads that have decided to write must wait until the others have finished reading.

EQUATION

Figure 1 illustrates a comparison between our model and the monotonic model with one attention head. Compared with the monotonic model, the MMA model is able to set attention to different positions so that it can still attend to previous states while reading each new token. Each head can adjust its speed on-the-fly. Some heads read new inputs, while the others can stay in the past to retain the source history information. Even with the hard alignment variant (MMA-H), the model is still able to preserve the history information by setting heads to past states. In contrast, the hard monotonic model, which only has one head, loses the previous information at the attention layer.

2.3. LATENCY CONTROL:

Effective simultaneous machine translation must balance quality and latency. At a high level, latency measures how many source tokens the model has read until a translation is generated. The model we have introduced in subsection 2.2 is not able to control latency on its own. While MMA allows simultaneous translation by having a read or write schedule for each head, the overall latency is determined by the fastest head, i.e. the head that reads the most. It is possible that a head always reads new input without producing output, which would result in the maximum possible latency. Note that the attention behaviors in MMA-H and MMA-IL can be different. In MMA-IL, a head reaching the end of the sentence will provide the model with maximum information about the source sentence. On the other hand, in the case of MMA-H, reaching the end of sentence for a head only Algorithm 1 MMA monotonic decoding. Because each head is independent, we compute line 3 to 16 in parallel

Input: x = source tokens, h = encoder states, i = 1, j = 1, t l,h 0 = 1, y0 = StartOfSequence. 1: while yi-1 = EndOfSequence do 2: tmax = 1 3: h = empty sequence 4:

for l ← 1 to L do 5:

for h ← 1 to H do 6:

for j ← t l,h i-1 to |x| do 7:

p l,h i,j = Sigmoid MonotonicEnergy(si-1,m j ) 8: if p l,h i,j > 0.5 then 9:

t l,h i = j 10: c l,h i = fcontext(h, t l,h i ) 11:

Break 12: else 13:

if j > tmax then 14:

Read token xj 15:

Calculate state hj and append to h 16: tmax = j 17:

c l i = Concat(c l,1 i , c l,2 i , ..., c l,H i ) 18: s l i = DecoderLayer l (s l 1:i-1 , s l-1 1:i-1 , c l i ) 19: yi = Output(s L i ) 20: i = i + 1

gives a hard alignment to the end-of-sentence token, which provides very little information to the decoder. Furthermore, it is possible that an MMA-H attention head stays at the beginning of sentence without moving forward. Such a head would not cause latency issues but would degrade the model quality since the decoder would not have any information about the input. In addition, this behavior is not suited for streaming systems.

To address these issues, we introduce two latency control methods. The first one is weighted average latency, shown in Equation 14:

EQUATION

)

where g l,h i = |x| j=1 jα i,j . Then we calculate the latency loss with a differentiable latency metric C.

EQUATION

Like Arivazhagan et al. (2019) , we use the Differentiable Average Lagging. It is important to note that, unlike the original latency augmented training in Arivazhagan et al. (2019) , Equation 15is not the expected latency metric given C, but weighted average C on all the attentions. The real expected latency is ĝ = max l,h g l,h instead of ḡ, but using this directly would only affect the speed of the fastest head. Equation 15 can control every head in a way that the faster heads will be automatically assigned to larger weights and slower heads will also be moderately regularized. For MMA-H models, we found that the latency of are mainly due to outliers that skip almost every token. The weighted average latency loss is not sufficient to control the outliers. We therefore introduce the head divergence loss, the average variance of expected delays at each step, defined in Equation 16:

EQUATION

)

where ḡi = 1 LH g i The final objective function is presented in Equation 17:

EQUATION

)

where λ avg , λ var are hyperparameters that control both losses. Intuitively, while λ avg controls the overall speed, λ var controls the divergence of the heads. Combining these two losses, we are able to dynamically control the range of attention heads so that we can control the latency and the reading buffer. For MMA-IL model, we only use L avg ; for MMA-H we only use L var .

3 EXPERIMENTAL SETUP

3.1. EVALUATION METRICS:

We evaluate our model using quality and latency. For translation quality, we use tokenized BLEU4 for IWSLT15 En-Vi and detokenized BLEU with SacreBLEU (Post, 2018) for WMT15 De-En. For latency, we use three different recent metrics, Average Proportion (AP) (Cho & Esipova, 2016) , Average Lagging (AL) (Ma et al., 2019) and Differentiable Average Lagging (DAL) (Arivazhagan et al., 2019) 5 . We remind the reader of the metric definitions in Appendix A.2. We evaluate our method on two standard machine translation datasets, IWSLT14 En-Vi and WMT15 De-En. Statistics of the datasets can be found in Table 1 . For each dataset, we apply tokenization with the Moses (Koehn et al., 2007) tokenizer and preserve casing.

3.2. DATASETS:

IWSLT15 English-Vietnamese TED talks from IWSLT 2015 Evaluation Campaign (Cettolo et al., 2016) . We follow the settings from Luong & Manning (2015) and Raffel et al. (2017) . We replace words with frequency less than 5 by <unk>. We use tst2012 as a validation set tst2013 as a test set. WMT15 German-English We follow the setting from Arivazhagan et al. (2019) . We apply byte pair encoding (BPE) (Sennrich et al., 2016) jointly on the source and target to construct a shared vocabulary with 32K symbols. We use newstest2013 as validation set and newstest2015 as test set.

3.3. MODELS:

We evaluate MMA-H and MMA-IL models on both datasets. The MILK model we evaluate on IWSLT15 En-Vi is based on Luong et al. (2015) rather than RNMT+ (Chen et al., 2018) . In general, our offline models use unidirectional encoders, i.e. the encoder self-attention can only attend to previous states, and greedy decoding. We report offline model performance in Table 2 and the effect of using unidirectional encoders and greedy decoding in Table 3 . For MMA models, we replace the encoder-decoder layers with MMA and keep other hyperparameter settings the same as the offline model. Detailed hyperparameter settings can be found in subsection A.1. We use the Fairseq library (Ott et al., 2019) for our implementation.

4. RESULTS:

In this section, we present the main results of our model in terms of latency-quality tradeoffs, ablation studies and analyses. In the first study, we analyze the effect of the variance loss on the attention span. Then, we study the effect of the number of decoder layers and decoder heads on quality and latency. We also provide a case study for the behavior of attention heads in an example. Finally, we study the relationship between the rank of an attention head and the layer it belongs to. 

4.1. LATENCY-QUALITY TRADEOFFS:

We plot the quality-latency curves for MMA-H and MMA-IL in Figure 2 . The BLEU and latency scores on the test sets are generated by setting a latency range and selecting the checkpoint with best BLEU score on the validation set. We use differentiable average lagging (Arivazhagan et al., 2019) when setting the latency range. We find that for a given latency, our models obtain a better translation quality. While MMA-IL tends to have a decrease in quality as the latency decreases, MMA-H has a small gain in quality as latency decreases: a larger latency does not necessarily mean an increase in source information available to the model. In fact, the large latency is from the outlier attention heads, which skip the entire source sentence and point to the end of the sentence. The outliers not only increase the latency but they also do not provide useful information. We introduce the attention variance loss to eliminate the outliers, as such a loss makes the attention heads focus on the current context for translating the new target token.

It is interesting to observe that MMA-H has a better latency-quality tradeoff than MILk7 even though each head only attends to only one state. Although MMA-H is not yet able to handle an arbitrarily long input (without resorting to segmenting the input), since both encoder and decoder self-attention have an infinite lookback, that model represents a good step in that direction.

4.2. ATTENTION SPAN:

In subsection 2.3, we introduced the attention variance loss to MMA-H in order to prevent outlier attention heads from increasing the latency or increasing the attention span. We have already evaluated the effectiveness of this method on latency in subsection 4.1. We also want to measure the difference between the fastest and slowest heads at each decoding step. We define the average Published as a conference paper at ICLR 2020 attention span in Equation 18:

S = 1 |y|   |y| i max l,h t l,h i -min l,h t l,h i   (18)

It estimates the reading buffer we need for streaming translation. We show the relation between the average attention span versus λ var in Figure 3 . As expected, the average attention span is reduced as we increase λ var . 

4.3. EFFECT ON NUMBER OF LAYERS AND NUMBER OF HEADS:

One motivation to introduce MMA is to adapt the Transformer, which is the current state-of-the-art model for machine translation, to online decoding. Important features of the Transformer architecture include having a separate attention layer for each decoder layer block and multihead attention. In this section, we test the effect of these two components on the offline, MMA-H, and MMA-IL models from a quality and latency perspective. We report quality as measured by detokenized BLEU and latency as measured by DAL on the WMT13 validation set in Figure 4 . We set λ avg = 0.2 for MMA-IL and λ var = 0.2 for MMA-H.

The offline model benefits from having more than one decoder layer. In the case of 1 decoder layer, increasing the number of attention heads is beneficial but in the case of 3 and 6 decoder layers, we do not see much benefit from using more than 2 heads. The best performance is obtained for 3 layers and 2 heads (6 effective heads). The MMA-IL model behaves similarly to the offline model, and the best performance is observed with 6 layers and 4 heads (24 effective heads). For MMA-H, with 1 layer, performance improves with more heads. With 3 layers, the single-head setting is the most effective (3 effective heads). Finally, with 6 layers, the best performance is reached with 16 heads (96 effective heads).

The general trend we observe is that performance improves as we increase the number of effective heads, either from multiple layers or multihead attention, up to a certain point, then either plateaus or degrades. This motivates the introduction of the MMA model.

We also note that latency increases with the number of effective attention heads. This is due to having fixed loss weights: when more heads are involved, we should increase λ var or λ avg to better control latency.

4.4. ATTENTION BEHAVIORS:

We characterize attention behaviors by providing a running example of MMA-H and MMA-IL, shown in Figure 5 . Each curve represents the path that an attention head goes through at inference time. For MMA-H, shown in Figure 5a , we found that when the source and target tokens have the same order, the attention heads behave linearly and the distance between fastest head and slowest head is small. For example, this can be observed from partial sentence pair "I also didn't know that" and target tokens "Tôi cũng không biết rằng", which have the same order. However, when the source tokens and target tokens have different orders, such as "the second step" and "bước (step) thứ hai (second)", the model will generate "bước (step)" first and some heads will stay in the past to retain the information for later reordered translation "thứ hai (second)". We can also see that the attention heads have a near-diagonal trajectory, which is appropriate for streaming inputs.

The behavior of the heads in MMA-IL models is shown in Figure 5b . Notice that we remove the partial softmax alignment in this figure. We don't expect streaming capability for MMA-IL: some heads stop at early position of the source sentence to retain the history information. Moreover, because MMA-IL has more information when generating a new target token, it tends to produce translations with better quality. In this example, the MMA-IL model has a better translation on "isolate the victim" than MMA-H ("là cô lập nạn nhân" vs "là tách biệt nạn nhân") In Figure 6 , we calculate the average and standard deviation of rank of each head when generating every target token. For MMA-IL, we find that heads in lower layers tend to have higher rank and are thus slower. However, in MMA-H, the difference of the average rank are smaller. Furthermore, the standard deviation is very large which means that the order of the heads in MMA-H changes frequently over the inference process. 

6. CONCLUSION:

In this paper, we propose two variants of the monotonic multihead attention model for simultaneous machine translation. By introducing two new targeted loss terms which allow us to control both latency and attention span, we are able to leverage the power of the Transformer architecture to achieve better quality-latency trade-offs than the previous state-of-the-art model. We also present detailed ablation studies demonstrating the efficacy and rationale of our approach. By introducing these stronger simultaneous sequence-to-sequence models, we hope to facilitate important applications, such as high-quality real-time interpretation between human speakers. 

Latency Metric Calculation:

Average Proportion We provide the detailed results in Figure 2 as Table 6 and Table 7 .

1 |x||y| |y| i=1 g i Average Lagging 1 τ τ i=1 g i - i -1 |y|/|x| where τ = arg max i (g i = |x|) Differentiable Average Lagging 1 |y| |y| i=1 g i - i -1 |y|/|x| where g i =    g i i = 0 max(g i , g i-1 + |y| |x| ) i < 0

A.4 THRESHOLD OF READING ACTION:

We explore a simple method that can adjust system's latency at inference time without training new models. In Algorithm 1 line 8, 0.5 was used as an threshold. One can set different threshold p during the inference time to control the latency. We run the pilot experiments on IWSLT15 En-Vi dataset and the results are shown as We explore applying a simple average instead of a weighted average loss to MMA-H. The results are shown in Figure 7 and Table 9 . We find that even with very large weights, we are unable to reduce the overall latency. In addition, we find that the weighted average loss severely affects the translation quality negatively. On the other hand, the divergence loss we propose in Equation 16 can efficiently reduce the latency while retaining relatively good translation quality for MMA-H models. 

:

The code is available at https://github.com/pytorch/fairseq/tree/master/ examples/simultaneous_translation

Note that during training, to encourage discreteness,Raffel et al. (2017) added a zero mean, unit variance pre-sigmoid noise to ei,j.

MILk was based on a strengthened RNN-based model called RNMT+. The original RNMT+ model (Chen et al., 2018) uses multihead attention, computes attention only once, and then concatenates that single attention layer to the output of each decoder layer block. However, the RNMT+ model used for MILk in Arivazhagan et al. (2019) only uses a single head.

We acquire the data from https://nlp.stanford.edu/projects/nmt/, which is tokenized. We do not have the tokenizer which processed this data, thus we report tokenize d BLEU for IWSLT15

Latency metrics are computed on BPE tokens for WMT15 De-En -consistent with Arivazhagan et al. (2019) -and on word tokens for IWSLT15 En-Vi.

Luong & Manning (2015) report a BLEU score of 23.0 but they didn't mention what type of BLEU score they used. This score is from our implementation on the data aquired from https://nlp.stanford.edu/projects/nmt/

The numbers of MILk on WMT15 De-En are fromArivazhagan et al. (2019)

Figures and Tables:

Figure 1: Monotonic Attention (Left) versus Monotonic Multihead Attention (Right).

Figure 2: Latency-quality tradeoffs for MILk (Arivazhagan et al., 2019) and MMA on IWSLT15 En-Vi and WMT15 De-En. Black dashed line indicates the unidirectional offline transformer model with greedy search.

Figure3: Effect of λvar on the average attention span. The variance loss works as intended by reducing the span with higher weights.

Figure4: Effect of the number of decoder attention heads and the number of decoder attention layers on quality and latency, reported on the WMT13 validation set.

Figure 5: Running examples on IWSLT15 English-Vietnamese dataset

Figure 6: The average rank of attention heads during inference on IWSLT15 En-Vi. Error bars indicate the standard deviation. L indicates the layer number and H indicates the head number.

Figure 7: Effect average loss, weighted average loss and variance loss on MMA-H on WMT15 DeEn development set.

Number of sentences in each split.

Table content: <table><tr><td>Dataset</td><td/><td colspan="2">Train Validation</td><td>Test</td></tr><tr><td colspan="3">IWSLT15 En-Vi 133k</td><td>1268</td><td>1553</td></tr><tr><td colspan="2">WMT15 De-En</td><td>4.5M</td><td>3000</td><td>2169</td></tr><tr><td>Dataset</td><td/><td>RNN</td><td/><td>Transformer</td></tr><tr><td>IWSLT15 En-Vi</td><td/><td>25.6 6</td><td/><td>28.7</td></tr><tr><td>WMT15 De-En</td><td colspan="3">28.4 (Arivazhagan et al., 2019)</td><td>32.3</td></tr></table>

Offline model performance with unidirectional encoder and greedy decoding.

Table content: <table><tr><td>Dataset</td><td colspan="3">Beam Search Bidirectional Encoder Unidirectional Encoder</td></tr><tr><td>WMT15 De-En</td><td>1 4</td><td>32.6 33.0</td><td>32.3 33.0</td></tr><tr><td>IWSLT15 En-Vi</td><td>1 10</td><td>28.7 28.8</td><td>29.4 29.5</td></tr></table>

Effect of using a unidirectional encoder and greedy decoding to BLEU score.

Table content: <table/>

Offline and monotonic models hyperparameters.

Table content: <table><tr><td>Hyperparameter</td><td colspan="2">WMT15 German-English IWSLT English-Vietnamese</td></tr><tr><td>encoder embed dim</td><td>1024</td><td>512</td></tr><tr><td>encoder ffn embed dim</td><td>4096</td><td>1024</td></tr><tr><td>encoder attention heads</td><td>16</td><td>4</td></tr><tr><td>encoder layers</td><td>6</td><td/></tr><tr><td>decoder embed dim</td><td>1024</td><td>512</td></tr><tr><td>decoder ffn embed dim</td><td>4096</td><td>1024</td></tr><tr><td>decoder attention heads</td><td>16</td><td>4</td></tr><tr><td>decoder layers</td><td>6</td><td/></tr><tr><td>dropout</td><td>0.3</td><td/></tr><tr><td>optimizer</td><td>adam</td><td/></tr><tr><td>adam-β</td><td>(0.9, 0.98)</td><td/></tr><tr><td>clip-norm</td><td>0.0</td><td/></tr><tr><td>lr</td><td>0.0005</td><td/></tr><tr><td>lr scheduler</td><td>inverse sqrt</td><td/></tr><tr><td>warmup-updates</td><td>4000</td><td/></tr><tr><td>warmup-init-lr</td><td>1e-07</td><td/></tr><tr><td>label-smoothing</td><td>0.1</td><td/></tr><tr><td>max tokens</td><td>3584 × 8 × 8 × 2</td><td>16000</td></tr></table>

The calculation of latency metrics, given source x, target y and delays g

Table content: <table><tr><td>A.3 DETAILED RESULTS</td></tr></table>

Although this method doesn't require training new model, it dramatically hurts the translation quality.

Table content: <table><tr><td/><td colspan="2">BLEU AP</td><td>AL</td><td>DAL</td></tr><tr><td>λ avg</td><td/><td colspan="2">MMA-IL</td></tr><tr><td>0.05</td><td>30.7</td><td colspan="3">0.78 10.91 12.64</td></tr><tr><td>0.1</td><td>30.5</td><td colspan="2">0.70 7.42</td><td>8.82</td></tr><tr><td>0.2</td><td>30.1</td><td colspan="2">0.63 5.17</td><td>6.41</td></tr><tr><td>0.3</td><td>30.3</td><td colspan="2">0.60 4.18</td><td>5.35</td></tr><tr><td>0.4</td><td>29.2</td><td colspan="2">0.59 3.75</td><td>4.90</td></tr><tr><td>0.5</td><td>26.7</td><td colspan="2">0.59 3.69</td><td>4.83</td></tr><tr><td>0.75</td><td>25.5</td><td colspan="2">0.58 3.40</td><td>4.46</td></tr><tr><td>1.0</td><td>25.1</td><td colspan="2">0.56 3.00</td><td>4.03</td></tr><tr><td>λ var</td><td/><td colspan="2">MMA-H</td></tr><tr><td>0.1</td><td>28.5</td><td colspan="3">0.74 8.94 10.83</td></tr><tr><td>0.2</td><td>28.9</td><td colspan="3">0.69 6.82 8.622</td></tr><tr><td>0.3</td><td>29.2</td><td colspan="2">0.64 5.45</td><td>7.03</td></tr><tr><td>0.4</td><td>28.5</td><td colspan="2">0.59 3.90</td><td>5.21</td></tr><tr><td>0.5</td><td>28.5</td><td colspan="2">0.59 3.88</td><td>5.19</td></tr><tr><td>0.6</td><td>29.6</td><td colspan="2">0.56 3.13</td><td>4.32</td></tr><tr><td>0.7</td><td>29.1</td><td colspan="2">0.56 2.93</td><td>4.10</td></tr></table>

Detailed results for MMA-H and MMA-IL on WMT15 DeEn

Table content: <table><tr><td/><td colspan="2">BLEU AP</td><td>AL DAL</td></tr><tr><td>λ</td><td/><td colspan="2">MILk</td></tr><tr><td>0.1</td><td colspan="3">24.62 0.71 5.93 7.19</td></tr><tr><td>0.2</td><td colspan="3">24.68 0.67 4.90 5.97</td></tr><tr><td>0.3</td><td colspan="3">24.31 0.65 4.45 5.43</td></tr><tr><td>0.4</td><td colspan="3">23.73 0.64 4.28 5.24</td></tr><tr><td>λ avg</td><td/><td colspan="2">MMA-IL</td></tr><tr><td colspan="4">0.02 28.28 0.76 7.09 8.29</td></tr><tr><td colspan="4">0.04 28.33 0.70 5.44 6.57</td></tr><tr><td>0.1</td><td colspan="3">28.42 0.67 4.63 5.65</td></tr><tr><td>0.2</td><td colspan="3">28.47 0.63 3.57 4.44</td></tr><tr><td>0.3</td><td>27.9</td><td colspan="2">0.59 2.98 3.81</td></tr><tr><td>0.4</td><td colspan="3">27.73 0.58 2.68 3.46</td></tr><tr><td>λ var</td><td/><td colspan="2">MMA-H</td></tr><tr><td colspan="4">0.02 27.26 0.77 7.52 8.71</td></tr><tr><td>0.1</td><td colspan="3">27.68 0.69 5.22 6.31</td></tr><tr><td>0.2</td><td colspan="3">28.06 0.63 3.81 4.84</td></tr><tr><td>0.4</td><td colspan="3">27.79 0.62 3.57 4.59</td></tr><tr><td>0.8</td><td colspan="3">27.95 0.60 3.22 4.19</td></tr></table>

Detailed results for MILk, MMA-H and MMA-IL on IWSLT15 En-Vi A.5 AVERAGE LOSS FOR MMA-H

Table content: <table/>

Comparison between setting threshold for reading action and weighted average latency loss.

Table content: <table><tr><td/><td/><td colspan="2">Reading Threshold</td><td/><td/><td colspan="4">Weighted Average Latency Loss</td></tr><tr><td>p</td><td>BLEU</td><td>AP</td><td>AL</td><td>DAL</td><td colspan="2">L avg BLEU</td><td>AP</td><td>AL</td><td>DAL</td></tr><tr><td>0.5</td><td>25.5</td><td colspan="4">0.792387 7.13673 8.27187 0.02</td><td>25.5</td><td colspan="3">0.792387 7.13673 8.27187</td></tr><tr><td colspan="2">0.4 25.25</td><td colspan="4">0.73749 5.72003 6.85812 0.04</td><td colspan="4">25.68 0.728107 5.52856 6.61744</td></tr><tr><td colspan="5">0.3 23.06 0.697398 4.88087 6.03342</td><td>0.3</td><td>24.9</td><td colspan="3">0.602703 2.90054 3.68039</td></tr><tr><td colspan="5">0.2 18.37 0.678298 4.71099 5.94636</td><td>0.2</td><td>25.3</td><td colspan="3">0.636914 3.54577 4.38623</td></tr><tr><td>0.1</td><td>8.73</td><td colspan="3">0.696452 5.5225 7.20439</td><td>0.1</td><td colspan="4">25.48 0.684424 4.57901 5.54102</td></tr></table>

Detailed numbers on average loss, weighted average loss and head divergence loss on WMT15 De-En development set

Table content: <table/>

Peer review (iclr2020):
Summary: This paper applies monotonic attention to the multiheaded (self-attention) mechanisms used in a Transformer. It also proposes a few new losses which encourage low-latency alignments. Experiments are carried out on WMT EnDe and IWSLT EnVi translation, with evaluation using BLEU and latency-related metrics. Review: Applying monotonic attention mechanisms to the Transformer architecture is an obvious and necessary idea, and as such this paper constitutes an important contribution. The application of monotonic attention to the Transformer is as I would have expected. The latency-reduction losses are novel, however. I think there are various things the authors could do to clarify their results as well as the presentation of their methods, which I discuss below. Overall, I think this is a solid accept, especially with some improvements to the presentation. Specific comments & suggestions: - There is a typo in the abstract: *multiple attentions heads* - *the denominator in Equation 5 is clamped into a range of (eps, 1]* Technically this doesn*t need to be an open range on the left. - *which allows the decoder to apply softmax attention over a chunk (subsequence of encoder positions).* It may be clearer if you just say *which allows the decoder to apply to a fixed-length subsequence of encoder states preceding *. - I think more could be done to distinguish the behavior of the encoder self-attention, the encoder-decoder attention, and the decoder self-attention. You write *The model will write a new target token only after all the attentions have decided to write* but also *Some heads read new inputs, while the others can stay in the past to retain the source history information.* If an attention head is *staying in the past*, then the model will not be able to write a new target token. I think in one of these cases you are referring to (encoder) self-attention and in the other you are referring to decoder attention. Please clarify. - *Although MMA-H is not quite yet streaming capable since both the encoder and decoder self-attention have an infinite lookback, that model represents a good step in that direction.* I think you should distinguish between online and streaming translation. It sounds like when you say streaming you mean that the utterances may continue arbitrarily, so infinite lookback is impractical. However, one could truncate the source sequence whenever the decoder outputs an end-of-sentence token, or something. I*m not sure people usually make a strong distinction here. - For completeness it would be useful to include at least wait-k, and potentially a line corresponding to offline attention performance, in the plots in Figure 2. - Why don*t you include MMA-IL in WMT*15 EnDe? (figure 2) - Are you copying the results from (Arivazhagan et al., 2019) or did you reimplement MILk in your codebase? - The results in Figure 2 could be made much more informative if there was some way of communicating the multiplier (the *lambdas*) of the different latency losses for each of the different dots on the plot. This would make it much more obvious how important these losses are and how the effect the quality/latency trade-off. - There are some additional possible references for online seq2seq, like CTC, the Neural Transducer, *Learning Hard Alignments with Variational Inference*, *Learning online alignments with continuous rewards policy gradient”, etc.