Biasing Attention-Based Recurrent Neural Networks Using External Alignment Information
Paper · 2017 · Tamer Alkhouli and Hermann Ney
Summary
A translation can contain the expected words and still get the event wrong. If it exchanges the subject and object, the reader may understand the sentence perfectly and come away with the wrong account of who did what. Tamer Alkhouli and Hermann Ney investigate whether a recurrent system for machine translation can make better word choices when it receives an explicit suggestion about the source position associated with each target word. Ordinary attention learns to distribute weight across source positions as it translates. The authors give it an additional input that singles out a candidate position, while keeping the calculation that lets the rest of the sentence influence the output.
The translation process now evaluates a word and its proposed correspondence together. A recurrent alignment component scores a move from the preceding source position to the current one. The lexical component, which predicts words, uses that candidate position to modify its attention calculation. During training, the positions come from an external IBM/HMM alignment procedure. The two components are fitted separately, and the attention bias is switched on for a random 50% of training batches. The authors call this schedule block out. It gives the lexical component practice producing translations when it has to work from its ordinary attention inputs.
The complete system improves the case-insensitive BLEU score from 23.1 to 24.8 on English→Romanian newstest2016 and from 25.7 to 26.8 on German→English newstest2017. On a separate set of manually aligned German–English Europarl sentences, the alignment error rate is 44.9% for hard links extracted from ordinary attention and 29.7% for the proposed system. The two evaluations ask different questions. One compares translated text with a reference, while the other compares source–target links with human annotations.
The controlled comparisons show how much depends on the way the components are used. Keeping the attention bias active during decoding and removing the alignment scorer leads to degenerate output on both tasks. Removing both at decoding recovers baseline BLEU when training used block out, while the same removal produces degenerate output when training always supplied the bias. With the full decoding system in place, block out also improves the English→Romanian results more clearly than the German→English results. The paper’s evidence is thus about a particular way of using explicit correspondences in recurrent translation, with a trained scorer for the new search decisions and a lexical component that learns to work under both training conditions.
Deep dive: Biasing Attention-Based Recurrent Neural Networks Using External Alignment Information
How external word alignments guide recurrent translation, and what the experiments show about attention, alignment scoring, and training. · about 37 minutes to read
The problem and its context
What a source position tells the translator
A translator generates a sentence in the order required by the target language. That order can take it back and forth through the source. When the material corresponding to a much earlier source word is due in the target sentence, a system needs some way to make that material relevant again. Attention gives a recurrent translator a way to do this. At each output step it assigns weights to source positions and uses those weights to construct a source summary for the current prediction. The weights can change as the target sentence develops.
A word alignment records a more specific kind of information. In the setup used here, the alignment for a target word is an index into the source sentence. If the translator has already generated some target words, the associated indices describe where it has been in the source. Its next source choice can advance, return to an earlier position, or stay where it is. The ability to return matters because the order in which the source was read need not be the order in which corresponding words are generated.
A position index and an attention weight have different roles. An index records an explicit choice of position. An attention distribution tells the lexical predictor how to combine a set of source representations. The predictor can place particular emphasis on a position and still draw useful information from its neighbors or from a distant part of the sentence. Also, each source representation can already include information about other words through the source encoder. Even a high weight at a single position is therefore a weight on a contextual representation.
The authors ask whether a translator that already has this flexibility can use an explicit proposed correspondence. The proposal gives the attention calculation access to a fact about the current search hypothesis: which source position that hypothesis associates with the word being generated. The source position is a separate input, so it can vary even when the words generated so far stay the same. A useful way to understand the research question is to imagine holding the target prefix fixed and presenting two candidate source positions. Can the lexical predictor use the distinction, and can the decoder judge which proposal is plausible?
The underlying attention approach is attractive because the translation objective trains the attention calculation along with the rest of the network. A sentence pair supplies the source and the expected target, and the system learns to assign attention as part of learning to predict the target words. A separately estimated word alignment is optional in that setup. The paper takes this property seriously: an external source position has to add something to a system that already has a way to focus on the input. The attention baseline follows the approach associated with Bahdanau and colleagues’ attention-based translation work.
Why earlier translation systems separated links from words
The paper traces its decomposition to hidden Markov approaches to translation. In that account, a bilingual sentence pair contains observed words and an unobserved sequence of correspondences. The system assigns probabilities to both the lexical events and the alignment moves. A lexical probability concerns which word is produced. An alignment probability concerns which source position is visited as that word is produced. Even if the final translation is the only output a reader needs, the sequence of source positions gives the system a way to represent how it produced that translation.
The first-order assumption used in early hidden Markov work made each alignment transition depend on the immediately preceding position. This restriction matters computationally. If two partial paths end in the same relevant state, a dynamic program can combine their contributions to the probability of later choices. There is no need to carry each earlier path separately merely to evaluate the next transition. The paper connects these early word-based methods to the use of IBM and hidden Markov procedures for obtaining training alignments in phrase-based translation. That background is described in the cited comparison of statistical alignment methods.
Neural components had already been used with explicit alignments. The paper describes work in which alignment-dependent neural scoring was added to conventional phrase-based systems. That line of research put neural word or alignment predictions inside a larger translation system. It also describes standalone neural translation with a similar decomposition and with feedforward predictors. A feedforward component can inspect the particular source window and target history it is given. A recurrent component can accumulate information as it scans a sentence or extends a translation, without having to prescribe the same fixed-width history at every step. The relevant precedents include Devlin and colleagues’ joint neural scoring work and Alkhouli and colleagues’ alignment-based translation work.
Recurrence changes what it means to arrive at the same source position. Two partial translations that have reached that position by different routes can carry different information in their recurrent states. The authors want to preserve those differences. They use a bidirectional recurrent encoder for the source and recurrent states that can reflect the generated words and past alignment choices. This makes the earlier probability decomposition useful again, but with dependencies that are richer than those of the original alignment tables.
The paper also discusses earlier neural work that integrated over hidden alignments in a monotonic transduction setup. Under monotonicity, alignment moves follow the input order. The authors describe the cost of summing over hidden choices in that work. Their own translation framework allows movement in either direction and uses precomputed best alignments during training. They also describe an earlier inverse-direction translation approach that combines alignment and translation from target to source with an additional target-language scorer. Their experiments focus on the direct generation of target words from a source sentence, with the lexical and alignment scores providing the decoder’s evidence.
Where alignment information enters
Earlier changes to attention, as described in the paper, place extra information at different points in the translation process. Structural biases can incorporate notions from word alignment within the attention mechanism itself. Fertility concerns how much target material corresponds to a source word. Markov conditioning relates successive attention decisions. Such changes can encourage behavior associated with alignment while keeping the source of the information inside the translation system. The paper discusses these ideas through Cohn and colleagues’ structural biases for attention.
Lexical translation probabilities provide another kind of evidence. A translation lexicon supplies information about word pairs, which can affect attention through knowledge of likely lexical relationships. Alkhouli and Ney give attention information about a particular position in a particular hypothesis. That position can belong to a word whose representation already includes its sentence context. The distinction is between lexical correspondence information in general and a specific positional decision made as part of generating the current translation. The related lexicon approach is Arthur and colleagues’ work on discrete translation lexicons.
The paper also describes work that adds an alignment-dependent penalty or reward to the training objective. That method uses correspondence information to guide what attention learns from sentence pairs. Here the change is in the calculation executed when a word is predicted. It can therefore be used with a different positional proposal for each active decoding hypothesis. The difference matters once the decoder starts generating alignments itself, because a position can influence the current word score at the very moment the decoder considers it. The training-objective approach includes Mi and colleagues’ supervised attention work.
The method, step by step
From the source sentence to a joint hypothesis
The system first builds contextual representations for the words of the source sentence. When it starts to extend a partial translation, it has a target prefix and the alignment decisions associated with that prefix. It considers a candidate source position for the next word. The alignment component scores getting to that position from the previous one. The attention calculation then uses the candidate to locate an extra term in its scoring function. Given the resulting source summary and the target history, the lexical component can score candidate words.
This process gives the decoder a hypothesis that can be extended in more than one way. Two extensions can have the same proposed target word and different source positions. They can also have the same source position and different target words. Both choices affect subsequent steps. A new target word becomes part of the target history, and a new source position becomes the point from which the next alignment move is measured. An alignment-specific attention calculation also affects the recurrent state that carries information about previous source summaries.
The positions needed for training are available before the recurrent components are fitted. During translation, the words of the reference sentence are unavailable, so the decoder constructs both sequences from candidate moves and words. External alignment thus has a concrete meaning at each stage. In training it means a link obtained from a separate statistical alignment procedure. In decoding the input to attention comes from outside the lexical component, via a candidate in joint search.
Training and decoding with alignment-biased attention
The steps in order.
The probability of a translation and its alignments
The authors start from a probability for a target sentence given a source sentence. They introduce a hidden alignment sequence and express the translation probability using the joint probability of the target words and the alignment positions. The sum is the exact expression for a fixed target sentence in this formulation. The approximation evaluates the alignment path with the greatest joint probability.
p(e₁ᴵ | f₁ᴶ) = Σ[b₁ᴵ] p(e₁ᴵ, b₁ᴵ | f₁ᴶ)
≈ max[b₁ᴵ] ∏[i = 1 to I] p(eᵢ | bᵢ, b₁ⁱ⁻¹, e₁ⁱ⁻¹, f₁ᴶ) · p(bᵢ | b₁ⁱ⁻¹, e₁ⁱ⁻¹, f₁ᴶ)
The symbol p denotes a probability, and the vertical bar introduces the information on which it is conditioned. The source sequence f₁ᴶ runs from its first word to its last position J. The target sequence e₁ᴵ runs from its first word to its last position I. The alignment sequence b₁ᴵ contains a source index for each target step. At step i, eᵢ is the current target word, bᵢ is its proposed source position, and e₁ⁱ⁻¹ and b₁ⁱ⁻¹ are the earlier target words and earlier source choices. The sum Σ and the maximum max range over complete alignment sequences. The product ∏ goes through all target steps, and the dot multiplies the lexical and alignment probabilities at each step. The approximation sign ≈ marks the move from total probability over all paths to the probability attached to the strongest path.
The conditioning in the lexical factor captures the part of the architecture the authors change. When predicting eᵢ, the lexical component can use bᵢ as well as past choices. The alignment factor predicts bᵢ using information available before the current target word has been chosen. This gives the two factors a generative order: propose the position, then generate a word conditional on that proposal. Their probabilities play different roles even though both have access to target history and encoded source information.
Under a first-order alignment assumption, the previous position can be sufficient to determine the alignment part of the next transition. Here the recurrent state can depend on a sequence of earlier positions. Two paths can reach the same position with different histories, so the next score need not coincide. The lexical predictor can also carry consequences of earlier alignment choices. The maximum approximation lets the authors formulate a search over complete paths while keeping these dependencies. The practical search is narrower still because it prunes partial hypotheses.
Build a contextual representation of each word
The recurrent layers are long short-term memory layers, abbreviated LSTMs. In the equations, an LSTM takes a previous state and a new input and returns an updated state. The source encoder uses one recurrence in sentence order and another in reverse sentence order. At a given source position, each recurrence sees the same word embedding and brings in information from a different direction. The embedding is a learned vector associated with the word. Word embeddings
h⃗ⱼ = LSTM(h⃗ⱼ₋₁, F fⱼ)
Here j is the source position and h⃗ⱼ is its state in the forward pass. The right-pointing arrow marks the direction of that pass. The previous state h⃗ⱼ₋₁ belongs to the preceding position j − 1. The source word at j is represented by fⱼ, a vector whose vocabulary entry for that word is on and whose other entries are off. Multiplying by the source embedding matrix F supplies the embedding for the recurrent update. LSTM denotes that update.
h⃖ⱼ = LSTM(h⃖ⱼ₊₁, F fⱼ)
The left-pointing arrow identifies the reverse pass. Its state h⃖ⱼ at position j takes h⃖ⱼ₊₁, the state at position j + 1, as its recurrent input. The word indicator fⱼ and embedding matrix F give the same input word representation as in the forward pass. The LSTM now accumulates context by traveling from the end of the source towards the beginning.
hⱼ = Y h⃖ⱼ + Z h⃗ⱼ
The combined state hⱼ is the representation used at source position j. The vectors h⃖ⱼ and h⃗ⱼ come from the reverse and forward passes. The learned matrices Y and Z project the directional states, and + adds the projected vectors. The resulting hⱼ can reflect words that occurred on either side of j.
The target side also keeps a recurrent state. It is updated in the order in which target words are supplied during training or hypothesized during translation. Before scoring the next word, the system can already incorporate the word produced at the preceding step.
tᵢ₋₁ = LSTM(tᵢ₋₂, E eᵢ₋₁)
The target step under consideration is i. The state tᵢ₋₁ represents target history through step i − 1, and tᵢ₋₂ is its earlier state at step i − 2. The vector eᵢ₋₁ indicates the vocabulary entry for the preceding target word. The target embedding matrix E turns it into the input to the LSTM update. In the probability equations, e names a target word or a sequence of words, while here eᵢ₋₁ is that word in vector form.
This target recurrence is distinct from the state that tracks source information gathered during translation. Both can help predict a target word. A grammatical continuation depends on the words already produced, and a continuation faithful to the source depends on what source material is currently relevant. Separate recurrent inputs give the lexical component a way to represent both kinds of context.
Calculate attention and carry its context forward
At step i, the attention calculation needs a representation of what has happened on the decoder side so far. The paper builds this from a decoder state that incorporates previous attention and a state that incorporates the previous target word. The relevant decoder output at the preceding step is formed in the following way.
dᵢ₋₁ = LSTM(dᵢ₋₂, mᵢ₋₁)
The state dᵢ₋₁ carries the history of attended source summaries up to target step i − 1. The preceding state is dᵢ₋₂, and mᵢ₋₁ is the source summary computed at i − 1. The LSTM updates this part of the decoder state with that summary.
oᵢ₋₁ = A dᵢ₋₁ + B tᵢ₋₂
The vector oᵢ₋₁ is the decoder output at the previous target step. The matrices A and B are learned transformations of dᵢ₋₁, which includes the preceding source summary, and tᵢ₋₂, the target state available before predicting the preceding word. The plus sign joins the contributions by vector addition. The difference between the two time indices reflects the order of prediction. At the point when oᵢ₋₁ scores the word at i − 1, the target recurrence can use the word at i − 2.
rᵢ₋₁ = R oᵢ₋₁ + L tᵢ₋₁
The vector rᵢ₋₁ is the translation state passed to attention for the next target step. The learned matrix R acts on the previous output vector oᵢ₋₁, and the learned matrix L acts on the now updated target history tᵢ₋₁. Their sum can therefore use information associated with the previous attention decision and with the most recently selected target word.
The system can now assess each source position against that translation state. It does so by bringing both states into a common space, applying a nonlinear function, and mapping the result to a single score.
sᵢⱼ = vᵀ tanh(W hⱼ + M rᵢ₋₁ + a)
The scalar sᵢⱼ is the unnormalized attention score for source position j at target step i. The vector hⱼ is the contextual source representation. The same translation state rᵢ₋₁ is used when considering each source position. The learned matrices W and M transform the two inputs, a is a learned additive vector, and tanh applies the hyperbolic tangent to the resulting vector. The learned vector v is transposed, as indicated by ᵀ, so that its product with the transformed vector yields a scalar.
The scores need a common scale before they can be used to combine the source states. Softmax exponentiates each score and divides by the total across positions.
αᵢⱼ = exp(sᵢⱼ) / Σ[k = 1 to J] exp(sᵢₖ)
The attention weight αᵢⱼ belongs to j at target step i. The function exp turns the score sᵢⱼ into a positive quantity. In the denominator, the sum indexed by k uses the score sᵢₖ for every source position from 1 to J. The slash denotes division. Accordingly, a score change at one position can alter the normalized weights at other positions too.
mᵢ = Σ[j = 1 to J] αᵢⱼ hⱼ
The vector mᵢ is the source summary at target step i. The sum goes over source positions j up to J. Each contribution is the contextual state hⱼ scaled by its attention weight αᵢⱼ. The summary becomes the input to the attended-source recurrence for the current step. Applying the same state and output equations at i yields the decoder output for that step.
p(eᵢ = w | e₁ⁱ⁻¹, f₁ᴶ) = exp(oᵢw) / Σ[k = 1 to |Vₑ|] exp(oᵢk)
Here p is the probability that the word eᵢ at step i is vocabulary item w, given the target prefix e₁ⁱ⁻¹ and source sentence f₁ᴶ. The vertical bar marks that conditioning. The vocabulary is Vₑ, and the bars in |Vₑ| indicate its size. The output score for item w is oᵢw. The denominator uses k to index the output score oᵢk for each entry, with exp denoting exponentiation and Σ summation. The equation presents the ordinary attention predictor. The experiments use a class-factored lexical output layer to accommodate the large vocabularies.
Place the positional input inside the score
The attention calculation gives the authors a specific place to introduce a candidate alignment. For a proposed source position bᵢ, they add a learned vector to the input of tanh when the position being evaluated is bᵢ. The indicator that turns this vector on is the Kronecker delta.
δ[j, bᵢ] = 1 if j = bᵢ, and 0 otherwise
The symbol δ[j, bᵢ] is the indicator for a match between source position j and proposed position bᵢ at target step i. The value 1 includes the term at the chosen position, and the value 0 makes its contribution vanish elsewhere.
sᵢⱼ = vᵀ tanh(W hⱼ + M rᵢ₋₁ + a + δ[j, bᵢ] c)
The new parameter is the learned vector c. The score sᵢⱼ is still computed for source position j at step i. The source vector hⱼ and translation state rᵢ₋₁ enter through W and M, and a is the ordinary additive vector. The indicator δ[j, bᵢ] decides whether c contributes. The function tanh transforms the sum, and vᵀ projects it to a scalar.
The vector c is constant in the sense that the same learned parameter is available at each step and for each proposed alignment. Its effect on the score can vary with the other inputs because it goes inside the nonlinear transformation. The equation assigns neither a fixed attention weight nor a guaranteed score increment to the selected position. It makes the alignment visible to a learned function. The usual normalization and weighted sum still determine how that positional signal influences the source summary.
The second variant uses the contextual representation of the aligned source position to construct the additional vector. The gate works in exactly the same place in the calculation.
sᵢⱼ = vᵀ tanh(W hⱼ + M rᵢ₋₁ + a + δ[j, bᵢ] D h[bᵢ])
Here h[bᵢ] is the combined source state at proposed position bᵢ, and the learned matrix D transforms it. The indicator δ[j, bᵢ] admits this transformed vector at that position. The remaining terms have the same roles: W hⱼ supplies the source input at j, M rᵢ₋₁ supplies the current translation input, a contributes the ordinary bias, tanh applies the nonlinearity, and the transposed vector vᵀ gives score sᵢⱼ. The authors call this variant source alignment bias.
At the selected position, its source representation now has two routes into the score. It enters through the ordinary source transformation and through the extra alignment-specific transformation. At other positions, only the ordinary source transformation is active. The earlier alignment choices also have a route into future attention. An earlier bias can change the source summary, which can change the subsequent decoder state and the translation state used to score source positions. The authors retain this dependence. They describe a simplified lexical architecture that removes recurrence over the attended source and removes the preceding decoder output from the input to the next translation state.
Give the alignment proposals a score of their own
The alignment component predicts a displacement. This expresses a candidate source index relative to the preceding aligned position and allows movement in either direction.
Δᵢ = bᵢ − bᵢ₋₁
The quantity Δᵢ is the jump at target step i. The current position bᵢ and previous position bᵢ₋₁ are both indices into the same source sentence. The subtraction fixes the direction and distance of the move relative to the preceding choice. A candidate position determines the jump to score once that preceding choice is known.
The predictor uses the target state up through the previous word and the contextual source state at the previous alignment. These are paired before being passed into a recurrent alignment state.
qᵢ = U tᵢ₋₁ + h[bᵢ₋₁]
The vector qᵢ is the input pair in combined form at target step i. The learned matrix U transforms the previous target state tᵢ₋₁. The other contribution is h[bᵢ₋₁], the combined representation at the preceding aligned source position. The plus sign combines the vectors. The lexical and alignment descriptions use the same notation for the types of source and target state they compute, and the components are fitted separately.
zᵢ = LSTM(zᵢ₋₁, qᵢ)
The alignment state zᵢ is used to score the current jump. Its predecessor is zᵢ₋₁, and its new input is the source–target pair qᵢ. The LSTM permits earlier alignment history to affect the present score through that predecessor state. The paper’s first-order alternative for this component removes the recurrence over z, leaving the paired input with the immediately preceding alignment.
The distinction between the last position and the history of positions matters here. The last position determines the meaning of the candidate displacement. The history gives the predictor additional evidence for how plausible that displacement is. The preceding position used in training comes from the external links. During search it comes from the partial hypothesis being extended. As a consequence, two hypotheses with the same target prefix can still assign different probabilities to an extension because their paths through the source differ.
Fit the components and search over both sequences
The authors obtain training links with GIZA++ using IBM1/HMM/IBM4 alignment training. Each training target position is associated with a source position in their formulation. Since the alignments are supplied before fitting the recurrent components, the lexical predictor can receive a designated position on a training batch and the alignment predictor can use the designated path to learn the associated jumps. The estimation procedures for lexical and alignment prediction are separate.
When the lexical network sees the alignment term on every batch, a straightforward way to predict the training words is to rely heavily on the designated position. That creates a problem if the hints at search time are less reliable or the bias is turned off. To give attention experience using its ordinary signals, the authors randomly retain the term for 50% of batches. On batches where it is absent, source context and the evolving decoder state still enter the score, providing a route for learning to translate under that condition. Block out affects this extra input to lexical attention. The alignment component still learns to predict the jumps from the supplied paths.
Both components are fitted using stochastic gradient descent. The authors halve the learning rate when development perplexity increases. Perplexity here is a criterion derived from how well a fitted component predicts held-out data. The development sets are also used for a separate choice, the relative weight given to the two scores during decoding.
ê₁ᴵ = arg max[I, e₁ᴵ] { (1 / I) max[b₁ᴵ] Σ[i = 1 to I]
[ λ log p(eᵢ | b₁ⁱ, e₁ⁱ⁻¹, f₁ᴶ)
+ (1 − λ) log p(Δᵢ | b₁ⁱ⁻¹, e₁ⁱ⁻¹, f₁ᴶ) ] }
The accented ê₁ᴵ is the selected translation. The outer arg max chooses a target sequence e₁ᴵ and length I, and the inner max selects the strongest alignment path b₁ᴵ for that sequence. The sum Σ adds the step scores over target index i. The lexical probability p is for word eᵢ, conditioned on alignment choices through the current step b₁ⁱ, the preceding target prefix e₁ⁱ⁻¹, and the full source f₁ᴶ. The alignment probability is for the current jump Δᵢ and conditions on the alignment prefix b₁ⁱ⁻¹, the target prefix, and the full source. The function log takes each probability onto the logarithmic scale. The lexical weight is λ, and the alignment weight is 1 − λ. The factor 1 / I normalizes the accumulated score by target length.
This decoding rule uses the same order of dependencies as the probability decomposition, with weights fitted on development data and a length normalization for comparing different outputs. The paper reports a selected weight of 0.8 for lexical prediction and 0.2 for alignment. Thus a source position can matter in two ways. It can change the scores of words through the attention term, and it can incur a different score for the jump needed to reach it.
In practice, the decoder uses a beam of size 16. A beam keeps the most promising partial hypotheses available for further extension. With the bias active, those hypotheses include alignment choices as well as target words. For efficiency on long sentences, the implementation restricts candidate source positions to the window from i − 20 to i + 20 around the current target index i. This restriction compares absolute indices across the source and target sentences. It is distinct from the jump prediction, which compares successive source indices. With the attention bias off and no alignment component active, decoding only has to extend the lexical hypotheses.
Experiments and results
Training material, development sets, and capacity
The English→Romanian experiment uses the full bilingual data for the WMT 2016 task. The corpus statistics give 604K sentence pairs. They list 15.5M running words for English and 15.8M for Romanian, counting word occurrences in the two sides of the corpus. The corresponding vocabularies before neural vocabulary reduction have 92.3K English entries and 128.3K Romanian entries. Singletons are represented by an unknown token on both sides, yielding reported neural vocabularies of 56.1K entries for English and 80.9K for Romanian.
For its German-to-English experiment at WMT 2017, the study draws on bilingual data from Common Crawl, News Commentary, and the European Parliament. Its corpus statistics give 3.55M sentence pairs, 85M running German words, and 86M running English words. The vocabularies in the corpus statistics contain 671K German and 587K English entries. German words occurring fewer than 6 times and English words occurring fewer than 4 times are mapped to the unknown token. The corresponding neural vocabularies contain 188K entries for German and 131K for English.
The preprocessing discards sentences longer than 100 words. It also removes sentence pairs in which the external alignment leaves at least five consecutive source words unaligned. The authors use the latter rule to screen out noisy bilingual pairs, especially in Common Crawl. All the training material comes from bilingual data, with synthetic and back-translated material outside the experimental setup. These choices matter for interpreting the benchmarks because they define the corpus on which both the lexical and the structural decisions are learned.
The feedforward baselines use hidden layers with 1000 and 500 nodes. Their source input is a 9-word window, their target history uses a 5-gram setup, and their embeddings have 100 nodes. The bidirectional alignment network has 4 LSTM layers, including the directional source layers and the recurrent layers on the target and alignment side. Its recurrent layers and embeddings use 200 nodes. The attention systems use 200-node source and target embeddings and recurrent layers of the same size, with 200 nodes in the internal attention calculation. The feedforward and recurrent comparisons consequently differ in the context they can use and in the sizes of their layers.
All the lexical predictors use a class-factored output layer. The most frequent words occupy 1000 singleton classes, and the remaining words are placed among 1000 shared classes. The classes are fitted with a separate word-class tool using maximum likelihood under a bigram assumption, which evaluates class structure through successive units. This arrangement organizes a large lexical prediction space into class and word decisions. The alignment problem has a different output space. Its layer has 201 nodes, with a maximum jump length of 100 in either direction.
The authors use 1000 sentence pairs from newsdev2016 as development data for English→Romanian and use newstest2015 for German→English. These sets guide the learning-rate decisions and the choice of score weights. The test results concern newstest2016 for English→Romanian and newstest2017 for German→English. Training uses an extension of rwthlm and decoding an extension of Jane. The paper reports using 4-12 CPU cores with Intel MKL and an average convergence time of about 2–4 days for each trained component.
Which systems the comparisons put side by side
The fully feedforward baseline combines a lexical predictor with a feedforward alignment predictor. In the next baseline, the lexical predictor remains feedforward and the alignment predictor becomes bidirectional and recurrent. That comparison asks what the new alignment component contributes when word prediction still uses the limited-context architecture.
The ordinary attention baseline uses recurrent attention without an alignment term or a separate alignment scorer. It tests the proposed system against an architecture that already reads the entire source with a bidirectional encoder and can change its focus as it generates. The proposed configurations add a bidirectional alignment component and use either the constant vector or the transformed source state to condition attention. Both are trained with block out in the main comparison.
The translation metrics are computed without case distinctions. BLEU compares output with reference translations through matching word sequences, with higher scores preferred. The authors compute it with mteval from Moses. Translation edit rate, or TER, measures the editing needed to make output match the reference, with lower scores preferred. It is computed with TERCom. The reported numbers are on the paper’s percentage scales. The BLEU evaluation follows Papineni and colleagues’ automatic translation metric.
Translation on the WMT test sets
On English→Romanian, the progression from fully feedforward prediction to recurrent alignment and then to ordinary attention is visible in both metrics. The replacement of the feedforward alignment component helps even while the lexical predictor is unchanged. Ordinary attention then improves on that hybrid baseline. The alignment-aware attention systems give the highest BLEU scores in the comparison.
Case-insensitive BLEU on English→Romanian newstest2016
Alignment-biased attention with recurrent alignment leads the comparison.
The numbers
| System or setting | BLEU % |
|---|---|
| Feedforward words and feedforward alignments | 20.0 |
| Feedforward words and bidirectional alignments | 21.6 |
| Ordinary attention | 23.1 |
| Constant alignment bias with bidirectional alignments (this paper) | 24.8 |
| Source alignment bias with bidirectional alignments | 24.8 |
The English→Romanian newstest2016 TER scores are 64.2 for the fully feedforward baseline, 62.7 when its alignment component is recurrent, and 60.6 for ordinary attention. Each alignment-biased attention configuration records 58.1. In this direction, both metrics agree on the ordering of the baselines and on the tie between the proposed variants.
On German→English, changing the alignment predictor in the feedforward system again improves the scores. Recurrent alignment with feedforward word prediction is close to ordinary attention on this task, with the same TER. Combining recurrent alignment with either variant of biased attention gives the highest BLEU.
Case-insensitive BLEU on German→English newstest2017
Both positional bias variants score above ordinary attention and the feedforward baselines.
The numbers
| System or setting | BLEU % |
|---|---|
| Feedforward words and feedforward alignments | 24.2 |
| Feedforward words and bidirectional alignments | 25.5 |
| Ordinary attention | 25.7 |
| Constant alignment bias with bidirectional alignments (this paper) | 26.8 |
| Source alignment bias with bidirectional alignments | 26.8 |
The German→English newstest2017 TER score is 58.6 for the fully feedforward system and 57.6 for both recurrent alignment with a feedforward lexical predictor and ordinary attention. It is 55.6 for constant alignment bias with recurrent alignment and 55.5 for source alignment bias with recurrent alignment. The authors characterize the overall gains over ordinary attention as 1.7% BLEU on English→Romanian newstest2016 and 1.1% BLEU on German→English newstest2017. Both gains concern the combination used in decoding.
The paper suggests that the amount of German→English data may help explain why feedforward lexical prediction with recurrent alignment comes closer to ordinary attention on that task. It describes the German→English training data as about 5.7 times the English→Romanian training data size in its discussion and points to the larger hidden layers in the feedforward networks. This is an interpretation of the comparison. The experiments treat each corpus, its vocabulary, and its direction as a task together.
Agreement with manually marked links
The alignment evaluation uses 504 German–English sentence pairs from Europarl for which word correspondences were marked manually. The ordinary attention system produces a soft distribution, so the authors turn it into a hard decision for the comparison. For each target word they take the source position at which the attention weight is greatest. The alignment-aware system can supply an explicit position from its alignment decisions. Alignment error rate, abbreviated AER, gives the comparison with the manually marked links, with lower scores indicating closer agreement.
Alignment error rate on manually aligned German–English Europarl pairs
The explicit alignment system is closer to the manually marked links.
The numbers
| System or setting | AER % |
|---|---|
| Links extracted from ordinary attention | 44.9 |
| Constant alignment bias with bidirectional alignments (this paper) | 29.7 |
The alignment-aware system in this comparison is the same constant-bias configuration evaluated on the German→English translation test. Its lower AER shows that explicit structural prediction yields more agreement with the manual links in this sample. Its translation improvement is measured on newstest2017, a separate set. The pairing of those findings lets a reader assess the same system on two outcomes while preserving the distinction between reference translations and reference word links.
Ordinary attention is at a particular disadvantage under this extraction rule. Its weights help it construct a source summary, and their maximum is repurposed as a single predicted link. The recurrent alignment component, by contrast, has been fitted to predict a source jump for each step. As the authors note, that difference in training purpose helps explain why the maximum-weight links from ordinary attention have a high AER.
What the ablations show
Taking away the scorer while keeping alignment in search
The authors vary what the decoder uses after training a lexical component with the constant alignment term. In the first comparison of interest, the decoder still proposes source positions and applies the bias, but it no longer has the bidirectional alignment component to score the resulting jumps. Both English→Romanian newstest2016 and German→English newstest2017 are marked degenerate for this configuration. The paper gives that outcome as a qualitative label in the score table.
The division of labor in the full system explains why this removal is consequential. With the bias still on, particular alignment paths can make particular words look easier to predict. The lexical score measures a word’s plausibility conditional on the path. Once the separate jump score disappears, the decoder must effectively use this conditional word score to compare the paths themselves. The failure shows that the lexical evidence was insufficient for those extra search decisions in the tested setup. A hypothesis can gain lexical support under a proposed alignment without that support serving as a reliable judgment of the alignment.
Another comparison switches off the bias during decoding and leaves out the alignment scorer. The lexical component still comes from training with the bias and block out. On English→Romanian newstest2016 this configuration has BLEU 23.1 and TER 60.6, matching the ordinary attention baseline on both metrics. On German→English newstest2017 it has BLEU 25.7 and TER 59.4, compared with BLEU 25.7 and TER 57.6 for ordinary attention. Thus the remaining lexical component can translate at baseline BLEU under the unassisted condition, while German→English TER records a deterioration.
This comparison makes training exposure and use during search distinguishable. The word predictor in the unassisted condition had seen the supplied links during training. Its BLEU returns to the ordinary-attention level after that signal and its scorer are withdrawn from the decoder. The higher BLEU scores arise in the configuration that uses the trained word predictor together with scored alignment proposals at translation time.
What changes when every training batch carries the bias
The next comparison keeps the decoder intact and changes the lexical training schedule. For English→Romanian newstest2016, continuous exposure to the alignment bias produces BLEU 23.7 and TER 59.2 with the bidirectional alignment component still active at decoding. The block-out configuration yields BLEU 24.8 and TER 58.1 on the same test. The result is consistent with the authors’ concern that constant access to the external hint can lead attention to rely on it too heavily, even when the decoder later supplies alignment information.
On German→English newstest2017, the complete system trained with continuous exposure has BLEU 26.7 and TER 55.8. The constant-bias system trained with block out has BLEU 26.8 and TER 55.6 there. The change in training schedule is much more apparent on the English→Romanian task. The authors emphasize the smaller amount of English→Romanian training material in interpreting that contrast. The test is a comparison of the schedules within each task, with data size and language direction varying together across tasks.
A more direct test of reliance comes from taking the bias and alignment scorer away at decoding time after continuous exposure in training. In that condition, the paper reports degenerate outputs on both tasks. With block out, the corresponding experiment produces the baseline BLEU results described above. This is the evidence behind the authors’ claim that intermittently removing the external term allows ordinary attention to remain operational.
There are two distinct routes to a degenerate result in these tests. One keeps the alignment choice in search and removes the component responsible for evaluating the move. The other removes the choice at decoding time from a lexical predictor trained with continuous access to it. The first exposes a weakness in ranking joint hypotheses using only conditional word scores. The second exposes dependence on the training input. The distinction explains why a successful complete decoder can coexist with severe failures in more than one incomplete configuration.
How much information the bias needs to contain
The two bias variants preserve the same form of joint search and put the additional input at the active source position. The constant-vector version gives the attention calculation a way to recognize which position is proposed. The source-dependent version also transforms the content of that position along a separate learned route. Since ordinary attention already sees a contextual source vector, the latter comparison tests the value of an additional transformation of information available at the selected location.
On English→Romanian newstest2016, the variants tie on BLEU and TER. On German→English newstest2017, they tie on BLEU, and the source-dependent variant records TER 55.5 compared with 55.6 for the constant vector. The authors treat their performance as comparable on these tasks. The useful positive result is that the simple alignment flag, expressed through a learned constant vector, is enough to realize the reported BLEU improvement when combined with the recurrent alignment scorer. The availability of a richer form yields a comparison of how the signal is encoded, separate from the comparison with ordinary attention.
An example of what source order can change
To examine generation in more detail, the authors pick a German-to-English example from newstest2015, their development set. The German sentence concerns a distressing experience that continues to affect the speaker and others. Translating that event requires keeping track of the experience as the subject and the people as those affected. The source and reference allow a reader to follow those roles even when English expresses the lasting effect in a different way.
The paper displays the winning translation hypotheses and their attention weights, with darkness indicating the weight at each source–target position. In the ordinary attention system, the beginning of the generated sentence draws attention towards the latter portion of the German input. The authors connect that pattern with an output that confuses subject and object. They observe that wording with a passive construction could at least have made better sense of the reordered material, although it would still have been an inaccurate rendering of the reference. The system fails to produce that repair.
The comparison uses the system with source-dependent bias, which gives a better rendering and a source traversal the authors judge more appropriate for the sentence. This is a case where reading the words alone and reading the attention display together offer different diagnostic information. The text reveals that the relationship between the participants changed. The attention display shows which source region was receiving weight while the wrong part of the translation was being generated. The example illustrates one way correspondence can matter, while the aggregate metrics count a wider range of translation and alignment outcomes.
How the balance was chosen
The weight of 0.8 for lexical prediction comes from a grid search on development data. The paper shows the curve for the constant-bias system on the English→Romanian development set. The plotted comparison favors that setting for BLEU, and the authors describe the curve as stable under small changes around the chosen weight. German→English weights are also tuned on that task’s development data.
The role of this comparison is narrower than that of the scorer-removal experiment. The curve examines how to balance lexical and alignment evidence when both scores are present. Scorer removal asks what happens when the source choices lose their own learned evaluation altogether. Together they show why it is useful to report both the selected setting and the behavior of the decoder when that part of its scoring rule changes.
Limitations
Limits the authors identify
The reported training pipeline depends on precomputed alignments. This adds an estimation step to a translation architecture whose conventional appeal is that its attention can be learned from the translation objective. It also means the neural predictors inherit a choice about which source positions to treat as training correspondences. Their training can make use of those links, but the fitting procedure in the paper keeps their supervision fixed.
The authors distinguish this dependence of the reported experiments from the requirements of the architecture. They envisage alternating between generating alignments and estimating parameters. In the forced-alignment step of that proposal, the reference target words would be fixed and a beam would explore source positions. The newly generated alignments could then serve as training input in a later estimation step. Such a process would retain neural recurrence and replace the separately obtained alignments with paths produced by the translation system itself. It is proposed as future work, so the reported training behavior belongs to the fixed-alignment procedure.
The authors also discuss integrated estimation by summing over alignments with a Baum–Welch procedure. They explain that this would require simplifying how the components depend on alignment history. The recurrent states in the reported system can distinguish different histories that arrive at the same source position. A simpler dependency structure would make it easier to combine the probability contributions of paths. The paper therefore leaves a tradeoff open between keeping its richer history and using a summed training procedure.
A further problem the authors identify is overreliance on the bias. Block out addresses this empirically for the schedule they choose, and the comparison with continuous bias makes the concern concrete. The paper presents the 50% batch schedule in its implemented setup. Its account of overfitting is supported by observed performance when the bias is removed and by the larger improvement with block out on the smaller task. Other schedules and ways of assigning the supplied positions are outside that comparison.
Finally, the authors qualify what can be inferred from the ordinary attention system’s alignment error. A soft distribution over contextual source states is learned for predicting a word. The evaluation converts it to a hard link by taking its maximum. The alignment component is explicitly fitted to choose moves between positions. A difference in agreement with manual word links is meaningful, but part of its interpretation depends on this asymmetry in training and extraction.
Limits visible in the evaluation
The results cover the two reported translation directions, with the particular corpora, vocabularies, and recurrent networks chosen for them. The two directions offer evidence under different conditions, but they also bundle those conditions together. Corpus size, vocabulary cutoffs, language direction, and training material all change between tasks. The larger effect of block out on English→Romanian supports a difference between these experiments. Establishing how strongly that effect depends on corpus size would call for a comparison in which the amount of data varies within a common task.
Some architectural comparisons also change the capacity of the components along with their access to context. The feedforward networks use larger hidden layers, and the recurrent networks have their own dimensions and histories. The score differences describe those concrete systems. The comparison that changes the alignment predictor while retaining a feedforward lexical predictor is especially informative about that replacement, while a comprehensive study of layer size and history would require additional conditions.
There is a difference between the formal decoding objective and the candidates the practical decoder can examine. The objective maximizes over complete target and alignment sequences. A finite beam decides which partial hypotheses survive, and the window for long sentences restricts proposed source positions relative to the target index. Accordingly, the reported results reflect the learned factors and the search policy together. The experiments leave open how frequently a better-scoring complete path has a weak prefix and how frequently the useful source position lies outside the window. They likewise leave open the effect of replacing the best-path approximation with a sum in an otherwise comparable system.
The hard alignment representation specifies a source index for each target position. Several target positions can choose the same source position, and the path can go back and forth. A single target position still has only one designated source index in this setup. Its lexical prediction can reflect a distributed source summary, but the recorded alignment itself has a narrower form. An expression whose translation depends jointly on material at several positions can benefit from that summary even though the hard link records just one of them. The observed AER therefore concerns this concrete representation and the extraction rule used for the baseline.
The manually aligned sample is from Europarl and covers German–English. The paper’s translation scores for German→English are from newstest2017, and its other translation direction has no corresponding manual-alignment result in the experiments. The lower AER and higher BLEU characterize the same proposed system on separate evaluations. A claim that changes in alignment accuracy cause changes in translation quality would need evidence linking the outcomes more directly, for instance by showing which changes in links accompany which changes in translated sentences. The reported comparison establishes that both metrics favor the system under their respective conditions.
The table entries give point scores, and the paper supplies a development curve for the lexical weight and a qualitative example of a role error. The scores come without estimates of sampling uncertainty, and the example comes without a count of how frequently similar errors occur. The clearest claims are about the direction and size of the reported differences, the conditions under which decoding becomes degenerate, and the kind of mistake seen in the selected sentence. The distribution of linguistic improvements across the test sets remains open.
What came after
Later papers cite Alkhouli and Ney in work on translation representations, alignment, and decoding. The citation links establish that the earlier paper entered these discussions. The later works’ stated subjects show how the underlying questions can be pursued from different starting points, with the details of technical inheritance left open.
A paper from 2018 examines encoder representations in Transformer-based translation. This brings the investigation to the source representations a translation system builds. Alkhouli and Ney also rely on contextual source vectors, but study what happens when attention is given an explicit source-position hypothesis. Taken together, the subjects distinguish examining what the encoder represents from intervening in how source representations are used to predict target words. Analysis of Encoder Representations in Transformer-Based Machine Translation
A 2019 paper takes alignment and translation as joint learning tasks in a Transformer setting. This directly revisits the relationship between learning to translate and learning to align. Alkhouli and Ney train the components separately and join their decisions at decoding, leaving integrated estimation for future work. The later title points to a different training arrangement for the broader problem and leaves open the relationship to the specific forced-alignment procedure proposed in the recurrent paper. Jointly Learning to Align and Translate
SimAlign, from 2020, uses static and contextualized embeddings to obtain word alignments without parallel training data. Its stated focus makes the links themselves the output of interest. That connects to a different part of Alkhouli and Ney’s pipeline, where a bilingual statistical procedure supplies the correspondences before training begins. The connection is the problem of obtaining word links. The recurrent paper’s jump scorer and block-out schedule concern what happens when a translator subsequently learns from and decodes with such links. SimAlign
Another paper from 2018 addresses terminology constraints during neural translation decoding. The shared point of interest is the search stage, where a translation system has to reconcile word prediction with additional requirements or evidence. Alkhouli and Ney’s search adds a proposed source position and a score for reaching it. The later work’s stated subject concerns the use of terminology in decoding. The citation leaves the precise role of alignment in that later system unspecified. Neural Translation Decoding with Terminology Constraints
Cite
Cite as Tamer Alkhouli and Hermann Ney. 2017. Biasing Attention-Based Recurrent Neural Networks Using External Alignment Information. Proceedings of the Second Conference on Machine Translation.
@inproceedings{alkhouli2017biasing,
title = {{Biasing Attention-Based Recurrent Neural Networks Using External Alignment Information}},
author = {Tamer Alkhouli and Hermann Ney},
booktitle = {Proceedings of the Second Conference on Machine Translation},
year = {2017},
doi = {10.18653/v1/w17-4711},
url = {https://doi.org/10.18653/v1/w17-4711}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/alkhouli-2017-biasing-attention-based-recurrent-neural/