Towards Two-Dimensional Sequence to Sequence Model in Neural Machine Translation
Paper · 2018 · Parnia Bahar, Christopher Brix and Hermann Ney
Summary
A translation system must remember its previous output. A source phrase may need to appear much later in the translation, and a phrase that has already been translated may still look relevant when the system chooses its next word. In the attention-based architecture that Bahar and colleagues use as their starting point, the decoder can change which source positions it emphasizes at each step, but it repeatedly reads the same source representations. The authors ask what happens if those representations can change as the translation develops. Their proposal treats the interaction between the source sentence and the growing translation as a grid. It is an alternative way to organize neural machine translation.
The system begins by reading the source in both directions. It then passes through the resulting sequence of source vectors for each word it needs to predict. During each pass, a two-dimensional long short-term memory network, or 2DLSTM, receives the most recent target word and uses information carried from the preceding pass. The grid therefore has a source axis and a target axis. A cell can read information from the preceding source position in its own pass and from the same source position in the preceding pass. Once the system reaches the end of the source, it uses the last grid state to predict the next target word. This gives it a way to carry information about earlier translation decisions at individual source positions.
On the WMT 2017 German→English and English→German news tasks, the grid system scores higher than the standard attention baseline on case-sensitive BLEU on both test sets at both hidden widths. For instance, with 1000 hidden units, English→German BLEU on newstest2016 rises from 27.4 to 28.9. Development perplexity also favors the grid in every matched-width comparison. Translation edit rate shows a more mixed pattern, including a tie for the wider German→English systems on newstest2017. Adding a layer that learns to weight the grid’s source positions yields no BLEU gain over the plain grid in these comparisons.
The authors also compare the grid with attention systems that explicitly feed back where they have attended. In a German→English example, the plain attention system repeats a phrase locating an event at the end of a financial year. The grid and the explicit feedback systems each express that time reference once. The example illustrates the motivation for tracking source coverage, while the aggregate scores measure overall translation quality. The main practical cost is speed. In the reported implementation, the grid decodes at 0.7 words/s against 48 words/s for standard attention. The decoder repeatedly rebuilds earlier grid states, and the authors identify reuse of the preceding row as a way to remove that work.
Deep dive: Towards Two-Dimensional Sequence to Sequence Model in Neural Machine Translation
Bahar and colleagues use a two-dimensional LSTM to update the source representation during translation and test how it affects quality and speed. · about 35 minutes to read
The problem and its context
Choosing where to look and remembering where you looked
A translation has an order of its own. The next word may correspond to a source word near the beginning, near the end, or to a phrase spread across several positions. At the same time, the choice depends on what the translation says so far. A source expression might be relevant to the current decision even when its main contribution has already been made. A system therefore needs both access to the source and some means of relating that source to its earlier decisions.
The encoder–decoder architecture described by the authors divides these responsibilities. An encoder creates a sequence of vectors from the input. Each vector represents a source position in context. A decoder builds the output in order, using its state to carry information from the partial translation. Attention is the operation that joins the two. At each output step it assigns relevance weights to the source positions, then uses those weights to gather the information the decoder needs. The source can be read in a different pattern at each step even though the vectors available to read stay fixed.
The distinction matters because changing a read operation and changing the information available at a location are different capabilities. When the decoder returns to a source position, it finds the same encoder vector it encountered earlier. The decoder state and its attention computation may still cause it to use that vector differently. The authors’ concern is that there is no change at that position itself to reflect the progress of the translation. In their proposal, a state attached to a source position can respond to the target history, and a later output decision can consult it in that updated form.
The paper calls the underlying issue coverage. In this setting, coverage is about how much of the source has been accounted for in the translation so far. Over-translation is one possible consequence of poor coverage. A source expression can draw attention on several occasions and produce repeated material. Under-translation is another. If the system pays too little attention to a source expression, part of its content can be omitted. The question is whether the translation architecture can retain the information needed to manage those decisions as part of its ordinary operation.
Coverage in this sense concerns the contribution of a source expression, so it is more complicated than marking every source word as used upon first contact. Some expressions can contribute to several decisions. The amount of target material associated with a source position can depend on the word’s context. The paper’s comparison with a fertility mechanism makes that distinction concrete. Fertility estimates how much attention a source position should receive over the course of a translation. Coverage records attention already given, and fertility supplies a scale for interpreting that record.
What earlier translation systems already did
The authors describe recurrent, convolutional, self-attentive and hybrid approaches to encoding and decoding. Their recurrent point of comparison comes from work that jointly learns source alignment and translation. The encoder reads in both directions, and the decoder can select information from different parts of the resulting source sequence as it generates an output. The importance of that baseline is that the source is already contextualized and the decoder already has a flexible read operation. The proposal changes the organization of the interaction between two sequences that an attention system already knows how to connect. The earlier recurrent approach is described in Neural Machine Translation by Jointly Learning to Align and Translate.
The paper also identifies different ways of building an encoder or a decoder. Convolution is represented by Convolutional Sequence to Sequence Learning. The self-attention approach is represented by Attention Is All You Need. The combined approach appears in The Best of Both Worlds. In the paper’s account, these designs can give the system different ways to construct useful representations while retaining the division between a source sequence and a target sequence. The authors choose a simple recurrent attention baseline to examine the proposed change to that division.
Earlier coverage methods gave attention a way to look back at its alignments. An alignment in this context is a pattern of weights that relates the generation of a target word to positions in the source. Feeding past alignment information into the next attention calculation lets that calculation respond to previous use of a position. Accumulating the weights over the partial translation makes a longer history available. Scaling that accumulation by a predicted fertility gives the system a way to treat the same amount of past attention differently at different source positions. The paper places its experiments alongside Modeling Coverage for Neural Machine Translation and Incorporating Structural Alignment Biases into an Attentional Neural Translation Model.
The grid takes a different route to making earlier decisions available. It maintains a learned recurrent state at each combination of source position and target step. The state can carry coverage-related information together with other information relevant to translation. The architecture gives that information a route through time, and the training objective determines what the route actually carries. This is why the authors can formulate the coverage hypothesis without designing a variable that explicitly counts how frequently each position has been selected.
Why use a two-dimensional recurrence?
Two-dimensional recurrence already had applications in settings where the input itself has meaningful axes. The paper describes handwriting recognition systems that use multidimensional long short-term memory to extract information from images. It also describes speech recognition work that processes information along time and frequency. These examples establish the kind of operation the authors want to reuse. The state at a location can combine information arriving along different axes, and each axis can carry a distinct sort of context.
The paper also distinguishes its starting point from earlier grid LSTM work. In that work, a grid of recurrent units can support communication between network layers as well as across sequential steps. The grid used for translation here is organized by the two sentences. Moving along the source axis advances through source positions for the same prediction. Moving along the target axis advances the history of the translation for the same source position. The axes come from the structure of the conditional prediction problem.
Unlike the pixels of an image supplied all at once, the target side of a translation is only gradually available when the system is used. At training time the target sentence is known, so the recurrence can be arranged across the whole grid. At decoding time each new prediction makes a further row possible. That difference follows directly from using the target history to produce the source-dependent states, and it becomes important when the authors measure the cost of the architecture.
The method, step by step
From a source sentence to the next prediction
The system starts with a conventional bidirectional source encoder. Long short-term memory, or LSTM, is a recurrent unit that keeps an internal memory and learns gates that control the flow of information into, through and out of that memory. A bidirectional LSTM reads the input in each direction, so a source vector can reflect material on both sides of its position. This provides full-sentence source context before any output is generated. The grid then adds a second kind of context, derived from the partial translation.
Picture the source positions running from left to right. Each row represents a step in predicting the target, with the target axis running upward in the paper’s diagram. At a particular position in a row, the system has the source encoder’s vector for that position and an embedding of the preceding target word. An embedding is a learned numeric representation. At a given row, the target embedding is shared across the source positions, and the source vector changes from position to position. The previous target word can therefore affect how every source position is processed for the next prediction.
Each grid cell also receives recurrent information from the cell immediately to its left and from the cell at the same source position on the row below. The left neighbor has already processed earlier positions during the current pass. The lower neighbor contains information from the preceding target step at the current source position. The cell uses both neighbors to compute a new memory and a new hidden state. The hidden state is the part of its representation that subsequent computations read. The memory is also carried forward through the recurrence, through its own gated connections.
The system reads the whole source row before predicting the next target word. In the basic architecture, the state at the far right is the context vector for that prediction. A learned transformation gives a score to each candidate in the target vocabulary, and a softmax turns those scores into probabilities. During decoding, a selected continuation supplies the target embedding for the next row along that continuation. The original source vectors are available throughout. The states that make up their target-conditioned interpretation change as rows are added.
How the translation grid produces a target prediction
The steps in order.
This arrangement gives a local route for the history of each source position. Suppose a source expression corresponds to the time of an event and the beginning of the translation has already conveyed that time. At a later target step, the recurrent state at the position of the source expression can depend on the earlier output. It can pass that information across the current source row as the system anticipates its next word. This describes what the connectivity permits. The recurrence learns its internal representation from translation training, so the architecture alone does not assign a particular memory component to the time expression or declare it covered.
The source pass also serves an important role near the left edge of a row. The recurrent link from the left has processed little of the source at that point, yet the cell already has a bidirectional encoder vector. Information from farther to the right can consequently enter through that vector before the row recurrence arrives there. The recurrence itself proceeds left to right, as specified for the grid. Bidirectionality in this design belongs to the preliminary encoder.
How a grid cell combines its predecessors
The cell has two internal quantities that need to be distinguished. Its memory state holds information carried through the gated recurrence. Its hidden state exposes a transformed, gated version of that memory to neighboring cells and, where appropriate, to the prediction layer. Each cell uses the hidden states from its predecessors when deciding what to write, keep and expose. It uses the predecessor memories when carrying stored information forward.
In the cell equations, j indexes the source position and i indexes the target step. J and I are the respective sequence lengths. The horizontal predecessor is one source position earlier at the current target step. The vertical predecessor is one target step earlier at the same source position. The equations use x for the input at a grid location. In the translation architecture, that input combines the source encoder vector and the preceding target embedding.
iⱼ,ᵢ = σ(W₁ xⱼ,ᵢ + U₁ sⱼ₋₁,ᵢ + V₁ sⱼ,ᵢ₋₁)
The symbol i on the left denotes the input gate, while i in a subscript denotes the target index. j is the source index. xⱼ,ᵢ is the input vector at the cell. sⱼ₋₁,ᵢ is the left neighbor’s hidden state, and sⱼ,ᵢ₋₁ is the preceding target row’s hidden state at the same source position. W₁, U₁ and V₁ are learned matrices for these inputs, respectively. Juxtaposition indicates a matrix–vector product, + adds the resulting vectors, and σ applies the sigmoid element by element. The gate determines how much newly proposed content enters the memory.
fⱼ,ᵢ = σ(W₂ xⱼ,ᵢ + U₂ sⱼ₋₁,ᵢ + V₂ sⱼ,ᵢ₋₁)
Here fⱼ,ᵢ is the forget gate at source position j and target step i. It uses the current input xⱼ,ᵢ, the hidden state sⱼ₋₁,ᵢ from the left and the hidden state sⱼ,ᵢ₋₁ from the previous row. W₂, U₂ and V₂ are the forget gate’s learned matrices for those vectors. Their products are added and passed through the sigmoid σ. This gate controls the amount of inherited memory that survives after the two predecessor memories have been mixed.
oⱼ,ᵢ = σ(W₃ xⱼ,ᵢ + U₃ sⱼ₋₁,ᵢ + V₃ sⱼ,ᵢ₋₁)
oⱼ,ᵢ is the output gate at source index j and target index i. The three inputs are the cell input xⱼ,ᵢ, the preceding source hidden state sⱼ₋₁,ᵢ and the preceding target hidden state sⱼ,ᵢ₋₁. The subscript on W₃, U₃ and V₃ identifies the learned matrices of this gate. The products are summed before applying the sigmoid σ. The resulting vector regulates how much of the newly computed memory is exposed in the hidden state.
c̃ⱼ,ᵢ = g(W₄ xⱼ,ᵢ + U₄ sⱼ₋₁,ᵢ + V₄ sⱼ,ᵢ₋₁)
c̃ⱼ,ᵢ is the candidate memory content for source position j at target step i. The tilde identifies a proposal for the memory update. It is calculated from xⱼ,ᵢ, sⱼ₋₁,ᵢ and sⱼ,ᵢ₋₁, the current cell input and its horizontal and vertical predecessor hidden states. These are transformed by the learned matrices W₄, U₄ and V₄. The function g is the hyperbolic tangent, applied element by element to the sum.
λⱼ,ᵢ = σ(W₅ xⱼ,ᵢ + U₅ sⱼ₋₁,ᵢ + V₅ sⱼ,ᵢ₋₁)
λⱼ,ᵢ is the additional lambda gate at source position j and target step i. W₅, U₅ and V₅ are its learned matrices for the cell input xⱼ,ᵢ, the hidden state sⱼ₋₁,ᵢ from the left and the hidden state sⱼ,ᵢ₋₁ from the preceding row. The sigmoid σ converts the sum of the transformed inputs into elementwise mixing weights. This is the step that gives the cell control over the relative contributions of the two predecessor memories.
cⱼ,ᵢ = fⱼ,ᵢ ◦ [λⱼ,ᵢ ◦ cⱼ₋₁,ᵢ + (1 − λⱼ,ᵢ) ◦ cⱼ,ᵢ₋₁] + c̃ⱼ,ᵢ ◦ iⱼ,ᵢ
cⱼ,ᵢ is the memory at source position j and target step i. cⱼ₋₁,ᵢ and cⱼ,ᵢ₋₁ are its horizontal and vertical predecessor memories. The operator ◦ multiplies vectors element by element. λⱼ,ᵢ weights the horizontal contribution, and 1 − λⱼ,ᵢ is its elementwise complement for the vertical contribution. The square brackets enclose the sum of those contributions. The forget gate fⱼ,ᵢ controls how much of this combined memory passes through. The addition at the end incorporates the candidate content c̃ⱼ,ᵢ, scaled by the input gate iⱼ,ᵢ.
sⱼ,ᵢ = g(cⱼ,ᵢ) ◦ oⱼ,ᵢ
sⱼ,ᵢ is the hidden state exposed at source position j and target step i. The function g applies the hyperbolic tangent to the cell memory cⱼ,ᵢ. The result is multiplied element by element, using ◦, by the output gate oⱼ,ᵢ. This state can influence the next source position, the next target row, or the prediction if the architecture reads this position out.
The lambda and forget gates answer separate questions. Lambda controls the mixture of the two memories, and the forget gate controls the amount retained from that mixture. By forming the mixture with complementary weights, the update can draw differently on each direction for each memory component. It can retain a contribution from an earlier source position in one component and favor the preceding target row in another. Those choices are inferred from the current input and predecessor states. This is the stable cell variant the authors adopt from earlier work on multidimensional recurrence.
The difference between hidden state and memory also explains why the recurrence has two types of connection. The gate equations read information already exposed by the neighboring cells, so the cell can make a context-dependent choice about what to retain. The memory equation then acts directly on what those cells stored. This gives the network a way to carry information through the grid while varying how readily the next computation can use it.
Turning a row into a word distribution
The paper gives a compact expression for how the translation architecture uses the cell. Here h is the fixed bidirectional source encoding, and y in the cell input denotes the embedding of a target token.
sⱼ,ᵢ = ψ(W[hⱼ; yᵢ₋₁], U sⱼ₋₁,ᵢ, V sⱼ,ᵢ₋₁)
sⱼ,ᵢ is the grid hidden state at source position j and target step i. ψ denotes the two-dimensional LSTM computation, with the memory connections understood from the cell equations. hⱼ is the bidirectional encoder’s vector for the current source position, and yᵢ₋₁ is the embedding of the preceding target token. The semicolon inside the brackets denotes concatenation. W denotes the learned input transformation in this compact expression. U and V denote the learned transformations of the left hidden state sⱼ₋₁,ᵢ and the preceding-row hidden state sⱼ,ᵢ₋₁. The commas separate the arguments of the cell computation.
The distinction between h and s locates the architectural change precisely. The source encoder can compute every h before target generation starts. The states s are calculated during target generation and can change at a source position as the target history changes. When the authors describe the system as updating the source representation, it is the grid’s target-dependent sequence of states that supplies the updated representation. The precomputed vectors continue to provide the source input to each row.
tᵢ = sⱼ,ᵢ at j = J
tᵢ is the context vector at target step i. Its value is the grid hidden state sⱼ,ᵢ at source index j equal to J, the final source position. The design makes this position the point where the entire current pass is available for the prediction. Earlier source positions can affect it via the horizontal recurrence, and earlier translation decisions can affect it via the recurrence between rows.
pᵢ(yᵢ = w | y₁,…,yᵢ₋₁, x₁,…,xⱼ with j = J)
= exp((Wₒ tᵢ)w) / Σᵥ₌₁…|Vₜ| exp((Wₒ tᵢ)v)
pᵢ is the probability distribution for the target at step i. yᵢ = w is the event that the token at this step is candidate w. The vertical bar after w means conditioning on the preceding target tokens y₁,…,yᵢ₋₁ and the source tokens x₁,…,xⱼ through the final source position J. The token notation x here names the source sequence. Wₒ is the learned output matrix, and tᵢ is the context vector. The trailing w or v after the parentheses selects the score for that vocabulary entry. exp is the exponential function. Σ sums over indices v from the first entry through |Vₜ|, the size of the target vocabulary Vₜ. Division by that sum implements the softmax over target candidates.
The prediction is conditional on the partial translation because the grid computation leading to tᵢ has used that history. At the current row it directly uses the preceding token’s embedding. Previous rows have received earlier tokens in turn and can feed their effect forward. The vocabulary softmax comes after that entire process. It is the place where the translation system converts the representation into a decision about the next token.
Alternative ways to read the grid and track coverage
In the basic grid the final state has to serve every prediction. The authors test a version that can gather information directly from all positions in the row. The cells still compute their states with the same two-dimensional recurrence. A learned scoring function then assigns a weight to each position for the current target step.
γⱼ,ᵢ = softmaxⱼ(vᵀ tanh(W sⱼ,ᵢ))
γⱼ,ᵢ is the normalized weight of source position j at target step i. sⱼ,ᵢ is the grid hidden state there. W is a learned matrix for the readout, tanh is the hyperbolic tangent, and v is a learned scoring vector. The superscript ᵀ transposes v so that it can give a scalar score to the transformed state. softmaxⱼ normalizes these scores across source positions for the same target step. This softmax distributes weight across the row. The one that produces a token distribution acts later and normalizes over the vocabulary.
tᵢ = Σⱼ₌₁…ⱼ₌ⱼₘₐₓ γⱼ,ᵢ sⱼ,ᵢ
tᵢ is the resulting context for target step i. Σ sums over source positions j from 1 through jₘₐₓ, the last source position denoted elsewhere by J. Each summand is the state sⱼ,ᵢ multiplied by its scalar weight γⱼ,ᵢ. The resulting vector replaces the final state as the input to the vocabulary prediction. This variant tests whether a selective readout helps once the underlying source-position states already incorporate the target history.
The paper’s explicit coverage baseline changes a different part of the system. Its source vectors come from an encoder as in the standard attention approach. The decoder’s attention calculation receives the weight it assigned to the same source position on the previous target step.
αᵢ,ⱼ = a(sᵢ₋₁, hⱼ, αᵢ₋₁,ⱼ)
αᵢ,ⱼ is the attention weight at target step i for source position j. a represents the attention computation followed by softmax normalization over source positions. The authors use additive attention, in which the scoring operation combines information from the inputs before producing the attention score. sᵢ₋₁ is the previous decoder state of the attention system, hⱼ is the encoder state at the source position, and αᵢ₋₁,ⱼ is the attention weight at that position on the preceding step. The most recent alignment is thus available at the point where the new alignment is computed.
The fertility baseline gives attention a measure of the longer history. It adds previous alignment weights at a source position, then scales that accumulation by a context-dependent estimate of how much attention the position should receive.
βᵢ,ⱼ = (Σₖ₌₁…ᵢ₋₁ αₖ,ⱼ) / (N · σ(υφᵀ hⱼ))
βᵢ,ⱼ is the normalized attention history for source position j before target step i. Σ sums the old attention weights αₖ,ⱼ, where k ranges from the first target step through the step immediately before i. The numerator follows the paper’s description of summing across past steps. hⱼ is the encoder state at the source position. υφ denotes the learned fertility weight vector, and ᵀ indicates its transpose for the product with hⱼ. The sigmoid σ turns that product into a scale which is multiplied by N, the fertility ceiling set to 2 in the experiments. The dot denotes scalar multiplication. The denominator is the estimated fertility, and the slash divides the accumulated attention by that estimate.
αᵢ,ⱼ = a(sᵢ₋₁, hⱼ, βᵢ,ⱼ)
αᵢ,ⱼ is the new attention weight at target step i for source position j. As in the previous attention equation, a denotes attention scoring and the ensuing softmax, sᵢ₋₁ is the previous decoder state, and hⱼ is the source encoder state. βᵢ,ⱼ is the scaled accumulation of preceding attention. The decoder can therefore respond to the accumulated use of a position in relation to the expected amount of attention for that position in its sentence context.
These alternatives test different interventions. The weighted grid changes which grid states the predictor reads at the end of a row. The coverage and fertility systems change what the attention function knows about earlier alignments. In the grid, the history arriving at a source position is a learned hidden state and memory. In the explicit baselines, the feedback has a specified meaning derived from attention weights. The comparisons can reveal whether these designs produce competitive translations, even if an aggregate score alone cannot identify what the grid stores.
Training over the grid and decoding row by row
Training has access to the target sentence. The system can supply the known preceding target token to each row and prepare the grid states needed for the forward and backward computations. Gradients propagate through the recurrent links in both dimensions. In the paper’s description of back-propagation through time, the backward traversal runs from the far corner (J, I) towards (1, 1). J and I are the source and target lengths, and the latter coordinate marks the beginning of both dimensions. The backward computation follows the dependencies of cells that influence subsequent source positions and target steps.
The paper gives the theoretical training complexity as O(JI), where O expresses the growth in work with sequence lengths and JI is their product. The grid requires work across pairs of positions. With all the training inputs available, cells whose dependencies have already been satisfied can be processed in parallel. The authors cite the possibility of a schedule with linear time under optimal parallelization. That observation concerns how work can be scheduled. It leaves the amount and organization of work relevant to achieved throughput on the hardware used in the experiments.
When generating translations, the target inputs to later rows depend on earlier predictions. After a target token has been chosen for a continuation, the decoder can compute the next row for that continuation. Within the row it still needs to progress through the source positions. The states from the preceding row supply the vertical inputs. Earlier target decisions have already had a chance to affect those states, so retaining the preceding row gives the next computation access to its recurrent history.
The tested decoder rebuilt states from earlier target steps whenever it advanced. The authors identify this repeated work as an implementation choice. The recurrence instead permits extending the grid by keeping the previous row’s states and using them for the next one. Training can still exploit the target sequence being known, whereas decoding still depends on tokens becoming available in order. Reusing states addresses the repeated work, while the requirement to await the preceding target token remains.
The training protocol uses source and target text processed with Moses and split into sub-word units. Byte pair encoding, or BPE, determines the units jointly across the two languages. A token supplied to the network can therefore be a whole written word or part of one, although the architecture is described in terms of source and target words. The segmentation permits the same grid procedure to operate on the resulting token sequences. This preprocessing follows Neural Machine Translation of Rare Words with Subword Units.
All systems start training from scratch. The optimizer is Adam, which updates the learned parameters using gradients. The reported dropout rate is 30%. Dropout is a training technique that suppresses a portion of activations to reduce dependence on particular activations, as described in Dropout. The authors clip the gradient norm at a threshold of 1 to constrain large updates. The grid uses a learning rate of 0.0005, and the standard attention system uses 0.001.
The final parameters are averaged across the 4 best checkpoints from a single run, selected by development perplexity. A checkpoint records the learned parameters at a stage of training, so this operation yields one parameter set for decoding. The decoder uses beam search of size 12. Beam search keeps a limited set of promising partial translations while proposing further tokens. The reported systems decode with their checkpoint-averaged parameters and without an ensemble of separately trained networks.
Experiments and results
Data, comparison systems and metrics
The experiments are on the German→English and English→German directions of the WMT 2017 news translation task. The training collection has 4.6M samples gathered from Europarl-v7, News-Commentary-v10 and Common-Crawl. The authors use newstest2015 for development, with 2169 sentences. The test sets are newstest2016, with 2999 sentences, and newstest2017, with 3004 sentences. Development data guide checkpoint selection. Test data are used to compare the translations produced by the resulting systems.
Before sub-word segmentation, the Moses toolkit tokenizes the text and applies truecasing, a normalization of capitalization. The joint BPE procedure uses 20k merge operations. The authors filter out sentences longer than 50 sub-words for training and use a batch size of 50. The corpus setup uses the collected data without synthetic examples or added features. The comparison is designed around a standard attention system and changes to its architecture under this data regime.
The baseline uses a bidirectional source encoder with one layer and a unidirectional target decoder with additive attention. The source and target embeddings have 500 dimensions. The authors test LSTM hidden widths of 500 and 1000. In the corresponding grid systems, the bidirectional encoder and the grid layer use the chosen hidden width, and the embeddings have the same width as in the standard attention baseline. The additional coverage and fertility baselines use embeddings of size 620, a difference to keep in view when comparing those results.
The translation implementation is built with Blocks and Theano. The grid implementation incorporates adapted CUDA code from earlier work. This matters especially for interpreting speed, since the timings reflect that implementation and its decoding procedure. The experiment compares the resulting systems under a concrete software and training setup.
The translation results use case-sensitive BLEU, computed with mteval-v13a, and case-sensitive translation edit rate, or TER, computed with tercom. BLEU assesses correspondence with reference wording, and higher scores are preferred. TER measures the amount of editing needed to bring the translation into agreement with the reference, so lower scores are preferred. Both are reported as percentages. Development perplexity evaluates how well the system predicts the observed target sequence on newstest2015. Lower perplexity indicates better prediction of that observed text. It is measured on the reference sequence, while the test metrics evaluate outputs produced by the decoder. The paper uses BLEU alongside TER because the metrics can favor different outputs.
German→English
At the 500-unit hidden width, the grid wins the plain architecture comparison on both test metrics and both splits. On newstest2016, attention has 31.9 BLEU and 48.6 TER, while the grid has 32.6 BLEU and 47.8 TER. On newstest2017, the corresponding attention scores are 27.5 BLEU and 53.1 TER, and the grid reaches 28.2 BLEU and 52.7 TER. Development perplexity is 7.3 with attention and 6.5 with the grid. The authors report average improvements of 0.7% BLEU and 0.6% TER for this width and direction.
At the 1000-unit width, attention scores 33.1 BLEU and 47.5 TER on newstest2016. The grid scores 33.7 BLEU and 46.9 TER. On newstest2017, BLEU is 29.0 for attention and 29.3 for the grid, with both systems at 51.9 TER. Development perplexity comes down from 6.4 with attention to 5.7 with the grid. The authors report average gains of 0.5% BLEU and 0.3% TER at this width. For the wider pair, the BLEU and perplexity gains therefore coexist with a test split on which edit rate is unchanged.
The wider German→English comparison also includes the tagged alternatives in the chart below. The grid’s highest BLEU on newstest2017 comes from reading the last state of the row. The explicit fertility and coverage systems both come close to the standard attention baseline on this measure. These differences describe how closely the generated text matches the references under BLEU. The corresponding edit rates give a separate view of the same outputs.
German→English newstest2017 BLEU at the 1000-unit hidden width
The plain grid leads on BLEU, with each explicit attention feedback system scoring below it.
The numbers
| System or setting | BLEU % |
|---|---|
| Standard attention | 29.0 |
| Two-dimensional sequence to sequence (this paper) | 29.3 |
| Grid with weighted readout | 28.0 |
| Attention with coverage | 28.7 |
| Attention with fertility | 28.9 |
English→German
At 500 hidden units, attention records 27.0 BLEU on newstest2016 and 22.1 BLEU on newstest2017. The grid records 27.5 and 22.4, respectively. The authors summarize this as an average gain of 0.4% BLEU. The edit-rate differences are small and go in opposite directions. On newstest2016, TER is 53.9 for attention and 53.8 for the grid. On newstest2017, it is 60.5 for attention and 60.6 for the grid. The authors describe the comparison as showing no TER improvement overall at this width. Development perplexity favors the grid at 6.1 compared with 7.0.
At 1000 units, the stronger BLEU result for the grid appears on newstest2016, as shown below. On that split, TER is 52.6 for the grid and 53.9 for standard attention. On newstest2017, grid BLEU is 23.2 against 22.9 for attention, and TER is 59.5 against 60.2. Development perplexity is 5.3 for the grid and 6.5 for attention. The authors report average gains of 0.9% BLEU and 1.0% TER for the wider systems in this direction.
English→German newstest2016 BLEU at the 1000-unit hidden width
The plain grid has the strongest BLEU, followed by the explicit coverage and fertility systems.
The numbers
| System or setting | BLEU % |
|---|---|
| Standard attention | 27.4 |
| Two-dimensional sequence to sequence (this paper) | 28.9 |
| Grid with weighted readout | 27.8 |
| Attention with coverage | 28.6 |
| Attention with fertility | 28.4 |
Taken together, these matched-width results show a recurring BLEU advantage over the standard attention baseline, with the size depending on the direction, width and split. Development perplexity has the same ordering as BLEU for each of the basic architecture comparisons. TER supplies qualifications. At the narrower English→German width, better BLEU and lower perplexity accompany a small TER regression on newstest2017. At the wider German→English width, the test metrics also disagree about whether the architectures are distinct on that split. This is why an average or a single headline score cannot convey the full comparison.
The results also show how the baseline and the grid respond to widening. The wider plain grid has better BLEU than the narrower plain grid on each test in both directions. Standard attention also benefits in BLEU when widened. The comparison of interest is therefore between the two systems at a given width. A larger grid score by itself would mix the effect of choosing the grid architecture with the effect of adding capacity. The reported matched widths let the reader see the grid advantage under both size settings.
The cost in throughput
The single-GPU speed comparison gives the grid a training throughput of 791 words/s and standard attention 2944 words/s. At decoding time, the grid reaches 0.7 words/s, while standard attention reaches 48 words/s. These measurements describe a substantial throughput cost for the tested implementation. The effects of adding the weighted readout are reported to be negligible in this comparison. The recurrent grid and the way its states are recomputed are the salient costs in the authors’ account.
Decoding throughput in the authors’ speed comparison
Standard attention decodes much faster than the grid implementation.
The numbers
| System or setting | words/s |
|---|---|
| Standard attention | 48 |
| Two-dimensional sequence to sequence (this paper) | 0.7 |
Training and decoding lead to different computational schedules. A known target sentence gives the training computation access to inputs across the grid. During translation, the decoder has to obtain the next token before supplying it to a new row. The implementation adds work on top of that dependency by recomputing earlier rows. The authors propose retaining the preceding row as a practical improvement. The reported throughput belongs to the recomputing decoder, so it answers how fast the tested system ran under these conditions.
What the ablations show
Reading a whole row with learned weights
The weighted readout is the closest test of a component added to the proposed architecture. All grid positions already combine source information with the target history. The question is whether the prediction improves when it can choose among those positions directly. In principle, a weighted sum gives useful source positions a shorter path to the predictor than relying entirely on information propagated to the end of the row. It also changes the representation the predictor receives. A mixture of states can emphasize local features, while the final state is the culmination of the sequential pass.
At 500 units in German→English, the weighted grid scores 32.3 BLEU on newstest2016 and 27.9 on newstest2017, compared with 32.6 and 28.2 for the plain grid. TER moves in the other direction, from 47.8 to 47.1 on newstest2016 and from 52.7 to 51.7 on newstest2017. The variants share a development perplexity of 6.5. This case gives the clearest reason to describe the extra readout in terms of the metric. It hurts BLEU in both tests, and it provides better TER in both.
At the same width in English→German, BLEU is unchanged at 27.5 on newstest2016 and 22.4 on newstest2017. The weighted readout improves TER from 53.8 to 53.3 on newstest2016 and from 60.6 to 60.0 on newstest2017. Its development perplexity is 6.3, versus 6.1 with the final-state readout. The output metric and the development prediction measure again capture distinct effects. The extra weighting can improve the editing metric for the produced translations while assigning lower probability to the observed development targets.
At 1000 units in German→English, the weighted variant has 32.7 BLEU on newstest2016 and 28.0 on newstest2017. Both are below the final-state grid. It also has worse TER on newstest2016 at 47.1 compared with 46.9, and matches the plain grid at 51.9 TER on newstest2017. Development perplexity is 6.1 for the weighted variant and 5.7 for the plain grid. In English→German at that width, weighting gives 27.8 BLEU and 53.0 TER on newstest2016. On newstest2017 it gives 22.7 BLEU and 60.0 TER. The unweighted system has better scores on both metrics on both of those splits. English→German development perplexity is 5.7 with the weighted readout and 5.3 with the final state.
The general result is that learned selection across the row adds no BLEU gain in these tests. Its TER advantages are confined to the narrower comparisons. This supports the narrower conclusion that the last state can serve as the prediction context in the tested grid. In particular, the grid’s advantage over the standard attention baseline does not require adding a source-position weighting layer on top of its recurrent states. Attention and recurrence have different possible uses throughout a translation system, so this experiment bears specifically on weighted readout after this grid layer.
Comparing implicit state with explicit feedback
The coverage and fertility systems offer ways to test whether the grid can compete with architectures that directly address translation history. They keep an attention-based structure and supply previous alignment information as an additional input. The grid provides no explicitly named coverage score at a source position. It can instead let that position’s state reflect earlier output tokens and the previous rows’ computations. Comparing them measures the overall effectiveness of these approaches under the tested settings.
The plain grid has at least as much BLEU as either explicit feedback system in the wider experiments. German→English newstest2016 gives 33.7 BLEU for the grid, 33.1 for coverage and 33.4 for fertility. On the corresponding newstest2017 split, the grid also leads. In English→German, the charted newstest2016 comparison favors the grid. On newstest2017, coverage has 23.0 BLEU, and fertility ties the grid at 23.2. This puts the grid in the same range as the explicitly coverage-aware systems while showing an advantage on most of these BLEU comparisons.
The TER ordering differs. For German→English newstest2016, the grid and fertility tie at 46.9 TER, and coverage has 47.5. On newstest2017, fertility has 51.6 TER, while the grid and coverage tie at 51.9. English→German newstest2016 gives 52.1 TER for fertility and 52.4 for coverage, compared with 52.6 for the grid. On newstest2017, fertility reaches 59.1, coverage 59.4 and the grid 59.5. The paper characterizes the aggregate comparison with fertility as a BLEU advantage for the grid and a TER disadvantage. The split-level scores show where those rankings arise and where the systems tie.
Development perplexity favors the grid across these feedback comparisons. For German→English it is 5.7 for the grid, 6.3 with coverage and 6.2 with fertility. In English→German it is 5.3 for the grid and 5.8 for each of the explicit feedback systems. This shows stronger prediction of development targets under the grid in these runs. The results on produced translations still depend on the metric. Fertility’s lower TER in several tests is compatible with the grid having higher BLEU and lower development perplexity.
These comparisons have a different interpretation from the weighted-readout test. They compare architectures with different kinds of state, different operations in the decoder and different embedding widths. They show that the grid can compete with explicit alignment feedback, especially by BLEU. They do not isolate how much of that performance comes from tracking coverage. The grid’s recurrent states could help with other aspects of the relationship between the source and target sequences at the same time.
What the repeated phrase illustrates
The paper’s qualitative example concerns a sentence about HP’s workforce at the close of a financial year. The reference translation conveys the time of the employment count once. Standard attention places the financial-year expression at the opening and then introduces it again later. The grid gives the employment statement with a single financial-year reference. The explicit coverage and fertility outputs also give the reference once. The example exposes a specific error that BLEU and TER summarize only as part of the overall translation.
The contrast fits the authors’ account of the architecture. The repeated time expression has a corresponding source region that can remain relevant as the decoder generates several words about the same event. If the decoder again uses that region to realize the time expression, the result sounds redundant. The grid can carry the effect of the earlier output into later states at the same source positions. The attention feedback variants have an explicit signal that the region has already drawn attention. Either mechanism could help guide the generation of later words away from repeating the expression.
What the example directly establishes is a difference in the resulting translations. It does not supply a record of what the grid’s cells stored at the relevant positions or which alignment choices caused the repeated wording. The architectures can each make errors for several reasons, and the translated sentence alone leaves their internal paths unresolved. The case is evidence that the grid can avoid the particular duplication seen in the standard attention output. Its relation to the aggregate scores remains qualitative.
The experiment also helps separate repetition from omission. The paper explains how attending too seldom to some positions could leave source content out. The displayed result instead shows repeated content. A system that repeats less could still omit material, and a system that preserves more content could still repeat some of it. Those are distinct effects that an overall translation metric can combine with many other changes. The case study gives direct evidence about duplication in that sentence and motivates the authors’ broader coverage interpretation.
Limitations
Limits the authors identify
The authors present the architecture as an initial design. Their experiments use a standard attention baseline to make the comparison comprehensible, with the aim of evaluating the architectural idea. The reported quality gains establish an advantage over that baseline on BLEU in the selected tests. A claim about the strongest translation systems would require comparisons against the more elaborate approaches the paper describes as context.
The authors identify speed as a practical limitation. The current decoder rebuilds grid states from earlier target steps, although the recurrent update can proceed from the states of the most recent row. They expect reuse to improve decoding speed and still expect decoding to be slower than training. The latter difference is tied to the generation process itself. At training time the known target gives the system access to the rows’ inputs in advance. At decoding time later rows have to await the appropriate target history.
The paper also suggests spreading computation over multiple GPUs and shortening the history through which training propagates gradients in the two dimensions. The latter proposal is truncated back-propagation through time. It would limit the backward traversal used for learning. The paper treats these as ways the implementation or training might be developed. The measured quality and speed concern the full setup that was tested, and the effect of those proposed changes remains an open question in the paper.
The authors also identify directions for changing the architecture. They propose making the grid layer bidirectional, stacking grid layers, and combining the approach with self-attention or with the recurrent design they call RNMT+. They discuss evaluation on additional language pairs and further tuning. The tested system uses the specific source and target traversal described in the method. A bidirectional source encoder already supplies whole-sentence source information. A bidirectional grid would be a separate change to the grid layer and its dependencies.
Limits of the evidence
The two directions share a language pair and a news translation setting. This tests the method with different source and target roles for German and English and on more than one news test set. Its reach is nonetheless specific. A broader claim about the recurrence across languages would require cases that vary the languages themselves. The training length filter also sets a boundary on the evidence. The study trains with a limit of 50 sub-words and reports aggregate test scores. How quality and cost change with sentence length is unresolved by those scores, even though the source and target lengths directly determine the extent of the grid.
The comparisons use selected settings for each system, including different learning rates for the grid and standard attention. The common preprocessing, shared embedding width for the main comparison and matched hidden widths make the results interpretable. Hidden width alone, however, does not establish matched capacity. The grid and a standard recurrent decoder have different connections and operations. The findings apply to the architectures as configured. A decomposition into the effects of parameter count, optimization settings and recurrence structure would require comparisons that vary those factors separately.
Checkpoint averaging selects several checkpoints from a single run. The table reports scores for that protocol. It therefore shows an ordering among the reported configurations but gives no estimate of how that ordering varies across independent training runs. This matters where the scores are close or tied. The consistency of the BLEU ordering across the plain-grid comparisons addresses a different question from whether any given margin is stable across training runs.
BLEU, TER and perplexity also leave some questions about coverage open. BLEU and TER compare outputs with references, and perplexity evaluates predictions of observed targets. Any of these can change because of effects other than omission or repetition. The displayed HP sentence directly illustrates a repetition difference, but the paper offers no corpus-level count of repeated and omitted source content. Consequently, the overall evidence is strongest for the reported translation scores and for the specific case illustrated in the example. The authors’ explanation that the grid internally handles coverage is a plausible interpretation of those observations and of the state connections.
The weighted-readout comparison gives evidence about where to read the grid, while the explicit feedback comparisons show how the system fares against coverage-aware alternatives. Neither directly measures the effect of transmitting previous-row memory at a single source position while holding the rest of the grid fixed. There is also no reported probe that recovers a coverage quantity from its cell states. A reader can connect the architecture to the intended mechanism through the paths it provides, while treating the actual content of the learned state as unresolved.
Finally, the speed measurement characterizes the system as implemented. The paper identifies exactly which past computation can be reused, but reports no timing for a decoder that does so. The measured gap therefore includes avoidable implementation work and the intrinsic sequential dependencies of prediction. The relative contribution of those costs remains undetermined. For an engineer assessing the design, the quality scores establish what the tested grid produced, while the speed scores establish what its particular decoder cost to run.
What came after
The follow-up proposals come from the authors themselves. They envisage replacing the initial grid layer with a deeper or bidirectional version, and using self-attention or recurrent components from other translation architectures around it. These proposals address different parts of the design. Depth would add processing within the architecture. A change in directionality would affect how information can travel through the grid. Combining it with self-attention would alter how some of the context supplied to or used around the recurrence is represented.
The authors also describe a more immediate follow-up for decoding. The recurrent dependency from one target row to the next gives a direct way to retain the latest states and extend the grid as output becomes available. That proposal follows from the existing equations and addresses the repeated recomputation in the reported implementation. Broader tests on additional language pairs and more extensive tuning would address the paper’s empirical scope.
No subsequent citing study is identified for tracing which of these directions was taken up or what results followed. The paper’s account ends with the distinction between the architecture it tested and the extensions it proposed.
Cite
Cite as Parnia Bahar, Christopher Brix and Hermann Ney. 2018. Towards Two-Dimensional Sequence to Sequence Model in Neural Machine Translation. Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing.
@inproceedings{bahar2018two,
title = {{Towards Two-Dimensional Sequence to Sequence Model in Neural Machine Translation}},
author = {Parnia Bahar, Christopher Brix and Hermann Ney},
booktitle = {Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing},
year = {2018},
doi = {10.18653/v1/d18-1335},
url = {https://doi.org/10.18653/v1/d18-1335}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/bahar-2018-two-dimensional-sequence-sequence-model/