The IBM alignment models are a sequence of increasingly complex models used in statistical machine translation to train a translation model and an alignment model, starting with lexical translation probabilities and moving to reordering and word duplication.[1][2] They underpinned the majority of statistical machine translation systems for almost twenty years starting in the early 1990s, until neural machine translation began to dominate. These models offer principled probabilistic formulation and (mostly) tractable inference.[3]
The IBM alignment models were published in parts in 1988[4] and 1990,[5] and the entire series is published in 1993.[1] Every author of the 1993 paper subsequently went to the hedge fund Renaissance Technologies.[6]
The original work on statistical machine translation at IBM proposed five models, and a model 6 was proposed later. The sequence of the six models can be summarized as:
The IBM alignment models translation as a conditional probability model. For each source-language ("foreign") sentence f {\displaystyle f} , we generate both a target-language ("English") sentence e {\displaystyle e} and an alignment a {\displaystyle a} . The problem then is to find a good statistical model for p ( e , a | f ) {\displaystyle p(e,a|f)} , the probability that we would generate English language sentence e {\displaystyle e} and an alignment a {\displaystyle a} given a foreign sentence f {\displaystyle f} .
The meaning of an alignment grows increasingly complicated as the model version number grew. See Model 1 for the most simple and understandable version.
Given any foreign-English sentence pair ( e , f ) {\displaystyle (e,f)} , an alignment for the sentence pair is a function of type { 1 , . , . . . , l e } → { 0 , 1 , . , . . . , l f } {\displaystyle \{1,.,...,l_{e}\}\to \{0,1,.,...,l_{f}\}} . That is, we assume that the English word at location i {\displaystyle i} is "explained" by the foreign word at location a ( i ) {\displaystyle a(i)} . For example, consider the following pair of sentences
It will surely rain tomorrow -- 明日 は きっと 雨 だ
We can align some English words to corresponding Japanese words, but not everyone:
it -> ? will -> ? surely -> きっと rain -> 雨 tomorrow -> 明日
it -> ?
will -> ?
surely -> きっと
rain -> 雨
tomorrow -> 明日
This in general happens due to the different grammar and conventions of speech in different languages. English sentences require a subject, and when there is no subject available, it uses a dummy pronoun it. Japanese verbs do not have different forms for future and present tense, and the future tense is implied by the noun 明日 (tomorrow). Conversely, the topic-marker は and the grammar word だ (roughly "to be") do not correspond to any word in the English sentence. So, we can write the alignment as
1-> 0; 2 -> 0; 3 -> 3; 4 -> 4; 5 -> 1
where 0 means that there is no corresponding alignment.
Thus, we see that the alignment function is in general a function of type { 1 , . , . . . , l e } → { 0 , 1 , . , . . . , l f } {\displaystyle \{1,.,...,l_{e}\}\to \{0,1,.,...,l_{f}\}} .
Future models will allow one English world to be aligned with multiple foreign words.
Given the above definition of alignment, we can define the statistical model used by Model 1:
Together, we have the probability p ( e , a | f ) = 1 / N ( 1 + l f ) l e ∏ i = 1 l e t ( e i | f a ( i ) ) {\displaystyle p(e,a|f)={\frac {1/N}{(1+l_{f})^{l_{e}}}}\prod _{i=1}^{l_{e}}t(e_{i}|f_{a(i)})} IBM Model 1 uses very simplistic assumptions on the statistical model, in order to allow the following algorithm to have closed-form solution.
If a dictionary is not provided at the start, but we have a corpus of English-foreign language pairs { ( e ( k ) , f ( k ) ) } k {\displaystyle \{(e^{(k)},f^{(k)})\}_{k}} (without alignment information), then the model can be cast into the following form:
In this form, this is exactly the kind of problem solved by expectation–maximization algorithm. Due to the simplistic assumptions, the algorithm has a closed-form, efficiently computable solution, which is the solution to the following equations: { max t ′ ∑ k ∑ i ∑ a ( k ) t ( a ( k ) | e ( k ) , f ( k ) ) ln t ( e i ( k ) | f a ( k ) ( i ) ( k ) ) ∑ x t ′ ( e x | f y ) = 1 ∀ y {\displaystyle {\begin{cases}\max _{t'}\sum _{k}\sum _{i}\sum _{a^{(k)}}t(a^{(k)}|e^{(k)},f^{(k)})\ln t(e_{i}^{(k)}|f_{a^{(k)}(i)}^{(k)})\\\sum _{x}t'(e_{x}|f_{y})=1\quad \forall y\end{cases}}} This can be solved by Lagrangian multipliers, then simplified. For a detailed derivation of the algorithm, see [7] chapter 4 and.[8]
In short, the EM algorithm goes as follows:
INPUT. a corpus of English-foreign sentence pairs { ( e ( k ) , f ( k ) ) } k {\displaystyle \{(e^{(k)},f^{(k)})\}_{k}} INITIALIZE. matrix of translations probabilities t ( e x | f y ) {\displaystyle t(e_{x}|f_{y})} .This could either be uniform or random. It is only required that every entry is positive, and for each y {\displaystyle y} , the probability sums to one: ∑ x t ( e x | f y ) = 1 {\displaystyle \sum _{x}t(e_{x}|f_{y})=1} . LOOP. until t ( e x | f y ) {\displaystyle t(e_{x}|f_{y})} converges: t ( e x | f y ) ← t ( e x | f y ) λ y ∑ k , i , j δ ( e x , e i ( k ) ) δ ( f y , f j ( k ) ) ∑ j ′ t ( e i ( k ) | f j ′ ( k ) ) {\displaystyle t(e_{x}|f_{y})\leftarrow {\frac {t(e_{x}|f_{y})}{\lambda _{y}}}\sum _{k,i,j}{\frac {\delta (e_{x},e_{i}^{(k)})\delta (f_{y},f_{j}^{(k)})}{\sum _{j'}t(e_{i}^{(k)}|f_{j'}^{(k)})}}} where each λ y {\displaystyle \lambda _{y}} is a normalization constant that makes sure each ∑ x t ( e x | f y ) = 1 {\displaystyle \sum _{x}t(e_{x}|f_{y})=1} .RETURN. t ( e x | f y ) {\displaystyle t(e_{x}|f_{y})} .
INPUT. a corpus of English-foreign sentence pairs { ( e ( k ) , f ( k ) ) } k {\displaystyle \{(e^{(k)},f^{(k)})\}_{k}}
INITIALIZE. matrix of translations probabilities t ( e x | f y ) {\displaystyle t(e_{x}|f_{y})} .
This could either be uniform or random. It is only required that every entry is positive, and for each y {\displaystyle y} , the probability sums to one: ∑ x t ( e x | f y ) = 1 {\displaystyle \sum _{x}t(e_{x}|f_{y})=1} .
LOOP. until t ( e x | f y ) {\displaystyle t(e_{x}|f_{y})} converges:
t ( e x | f y ) ← t ( e x | f y ) λ y ∑ k , i , j δ ( e x , e i ( k ) ) δ ( f y , f j ( k ) ) ∑ j ′ t ( e i ( k ) | f j ′ ( k ) ) {\displaystyle t(e_{x}|f_{y})\leftarrow {\frac {t(e_{x}|f_{y})}{\lambda _{y}}}\sum _{k,i,j}{\frac {\delta (e_{x},e_{i}^{(k)})\delta (f_{y},f_{j}^{(k)})}{\sum _{j'}t(e_{i}^{(k)}|f_{j'}^{(k)})}}} where each λ y {\displaystyle \lambda _{y}} is a normalization constant that makes sure each ∑ x t ( e x | f y ) = 1 {\displaystyle \sum _{x}t(e_{x}|f_{y})=1} .
t ( e x | f y ) ← t ( e x | f y ) λ y ∑ k , i , j δ ( e x , e i ( k ) ) δ ( f y , f j ( k ) ) ∑ j ′ t ( e i ( k ) | f j ′ ( k ) ) {\displaystyle t(e_{x}|f_{y})\leftarrow {\frac {t(e_{x}|f_{y})}{\lambda _{y}}}\sum _{k,i,j}{\frac {\delta (e_{x},e_{i}^{(k)})\delta (f_{y},f_{j}^{(k)})}{\sum _{j'}t(e_{i}^{(k)}|f_{j'}^{(k)})}}}
where each λ y {\displaystyle \lambda _{y}} is a normalization constant that makes sure each ∑ x t ( e x | f y ) = 1 {\displaystyle \sum _{x}t(e_{x}|f_{y})=1} .
RETURN. t ( e x | f y ) {\displaystyle t(e_{x}|f_{y})} .
In the above formula, δ {\displaystyle \delta } is the Dirac delta function -- it equals 1 if the two entries are equal, and 0 otherwise. The index notation is as follows:
k {\displaystyle k} ranges over English-foreign sentence pairs in corpus; i {\displaystyle i} ranges over words in English sentences; j {\displaystyle j} ranges over words in foreign language sentences; x {\displaystyle x} ranges over the entire vocabulary of English words in the corpus; y {\displaystyle y} ranges over the entire vocabulary of foreign words in the corpus.
k {\displaystyle k} ranges over English-foreign sentence pairs in corpus;
i {\displaystyle i} ranges over words in English sentences;
j {\displaystyle j} ranges over words in foreign language sentences;
x {\displaystyle x} ranges over the entire vocabulary of English words in the corpus;
y {\displaystyle y} ranges over the entire vocabulary of foreign words in the corpus.
There are several limitations to the IBM model 1.[7]
Model 2 allows alignment to be conditional on sentence lengths. That is, we have a probability distribution p a ( j | i , l e , l f ) {\displaystyle p_{a}(j|i,l_{e},l_{f})} , meaning "the probability that English word i {\displaystyle i} is aligned to foreign word j {\displaystyle j} , when the English sentence is of length l e {\displaystyle l_{e}} , and the foreign sentence is of length l f {\displaystyle l_{f}} ".
The rest of Model 1 is unchanged. With that, we have p ( e , a | f ) = 1 / N ∏ i = 1 l e t ( e i | f a ( i ) ) p a ( a ( i ) | i , l e , l f ) {\displaystyle p(e,a|f)={1/N}\prod _{i=1}^{l_{e}}t(e_{i}|f_{a(i)})p_{a}(a(i)|i,l_{e},l_{f})} The EM algorithm can still be solved in closed-form, giving the following algorithm: t ( e x | f y ) ← 1 λ y ∑ k , i , j t ( e i ( k ) | f j ( k ) ) p a ( j | i , l e , l f ) δ ( e x , e i ( k ) ) δ ( f y , f j ( k ) ) ∑ j ′ t ( e i ( k ) | f j ′ ( k ) ) p a ( j ′ | i , l e , l f ) {\displaystyle t(e_{x}|f_{y})\leftarrow {\frac {1}{\lambda _{y}}}\sum _{k,i,j}{\frac {t(e_{i}^{(k)}|f_{j}^{(k)})p_{a}(j|i,l_{e},l_{f})\delta (e_{x},e_{i}^{(k)})\delta (f_{y},f_{j}^{(k)})}{\sum _{j'}t(e_{i}^{(k)}|f_{j'}^{(k)})p_{a}(j'|i,l_{e},l_{f})}}} p a ( j | i , l e , l f ) ← 1 λ i , l e , l f ∑ k t ( e i ( k ) | f j ( k ) ) p a ( j | i , l e , l f ) δ ( e x , e i ( k ) ) δ ( f y , f j ( k ) ) δ ( l e , l e ( k ) ) δ ( l f , l f ( k ) ) ∑ j ′ t ( e i ( k ) | f j ′ ( k ) ) p a ( j ′ | i , l e , l f ) {\displaystyle p_{a}(j|i,l_{e},l_{f})\leftarrow {\frac {1}{\lambda _{i,l_{e},l_{f}}}}\sum _{k}{\frac {t(e_{i}^{(k)}|f_{j}^{(k)})p_{a}(j|i,l_{e},l_{f})\delta (e_{x},e_{i}^{(k)})\delta (f_{y},f_{j}^{(k)})\delta (l_{e},l_{e}^{(k)})\delta (l_{f},l_{f}^{(k)})}{\sum _{j'}t(e_{i}^{(k)}|f_{j'}^{(k)})p_{a}(j'|i,l_{e},l_{f})}}} where λ {\displaystyle \lambda } are still normalization factors. See section 4.4.1[7] of for a derivation and an algorithm.
The fertility problem is addressed in IBM Model 3. The fertility is modeled using probability distribution defined as:
For each foreign word j {\displaystyle j} , such distribution indicates to how many output words ϕ {\displaystyle \phi } it usually translates. This model deals with dropping input words because it allows ϕ = 0 {\displaystyle \phi =0} . But there is still an issue when adding words. For example, the English word do is often inserted when negating. This issue generates a special NULL token that can also have its fertility modeled using a conditional distribution defined as:
The number of inserted words depends on sentence length. This is why the NULL token insertion is modeled as an additional step: the fertility step. It increases the IBM Model 3 translation process to four steps:
The last step is called distortion instead of alignment because it is possible to produce the same translation with the same alignment in different ways. For example, in the above example, we have another way to get the same alignment:[9]
IBM Model 3 can be mathematically expressed as:
where Φ i {\displaystyle \Phi _{i}} represents the fertility of e i {\displaystyle e_{i}} , each source word s {\displaystyle s} is assigned a fertility distribution n {\displaystyle n} , and I {\displaystyle I} and J {\displaystyle J} refer to the absolute lengths of the target and source sentences, respectively.[10]
See section 4.4.2[7] of for a derivation and an algorithm.
In IBM Model 4, each word is dependent on the previously aligned word and on the word classes of the surrounding words. Some words tend to get reordered during translation more than others (e.g. adjective–noun inversion when translating Polish to English). Adjectives often get moved before the noun that precedes them. The word classes introduced in Model 4 solve this problem by conditioning the probability distributions of these classes. The result of such distribution is a lexicalized model. Such a distribution can be defined as follows:
For the initial word in the cept: d 1 ( j − ⊙ [ i − 1 ] ∨ A ( f [ i − 1 ] ) , B ( e j ) ) {\displaystyle d_{1}(j-\odot _{[i-1]}\lor A(f_{[i-1]}),B(e_{j}))}
For additional words: d 1 ( j − π i , k − 1 ∨ B ( e j ) ) {\displaystyle d_{1}(j-\pi _{i,k-1}\lor B(e_{j}))}
where A ( f ) {\displaystyle A(f)} and B ( e ) {\displaystyle B(e)} functions map words to their word classes, and e j {\displaystyle e_{j}} and f [ i − 1 ] {\displaystyle f_{[i-1]}} are distortion probability distributions of the words. The cept is formed by aligning each input word f i {\displaystyle f_{i}} to at least one output word.[11]
Both Model 3 and Model 4 ignore if an input position was chosen and if the probability mass was reserved for the input positions outside the sentence boundaries. It is the reason for the probabilities of all correct alignments not sum up to unity in these two models (deficient models).[11]
IBM Model 5 reformulates IBM Model 4 by enhancing the alignment model with more training parameters in order to overcome the model deficiency.[12] During the translation in Model 3 and Model 4 there are no heuristics that would prohibit the placement of an output word in a position already taken. In Model 5 it is important to place words only in free positions. It is done by tracking the number of free positions and allowing placement only in such positions. The distortion model is similar to IBM Model 4, but it is based on free positions. If v j {\displaystyle v_{j}} denotes the number of free positions in the output, the IBM Model 5 distortion probabilities would be defined as:[1]
For the initial word in the cept: d 1 ( v j ∨ B ( e j ) , v ⊙ i − 1 , v m a x ) {\displaystyle d_{1}(v_{j}\lor B(e_{j}),v_{\odot i-1},v_{max})}
For additional words: d 1 ( v j − v π i , k − 1 ∨ B ( e j ) , v m a x ′ ) {\displaystyle d_{1}(v_{j}-v_{\pi _{i,k-1}}\lor B(e_{j}),v_{max'})}
The alignment models that use first-order dependencies like the HMM or IBM Models 4 and 5 produce better results than the other alignment methods. The main idea of HMM is to predict the distance between subsequent source language positions. On the other hand, IBM Model 4 tries to predict the distance between subsequent target language positions. Since it was expected to achieve better alignment quality when using both types of such dependencies, HMM and Model 4 were combined in a log-linear manner in Model 6 as follows:[13]
where the interpolation parameter α {\displaystyle \alpha } is used in order to count the weight of Model 4 relatively to the hidden Markov model. A log-linear combination of several models can be defined as p k ( f , a ∣ e ) {\displaystyle p_{k}(f,a\mid e)} with k = 1 , 2 , … , K {\displaystyle k=1,2,\dotsc ,K} as:
The log-linear combination is used instead of linear combination because the P r ( f , a ∣ e ) {\displaystyle P_{r}(f,a\mid e)} values are typically different in terms of their orders of magnitude for HMM and IBM Model 4.[14]