IBM alignment models
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] 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.[2]
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:
- Model 1: lexical translation
- Model 2: additional absolute alignment model
- Model 3: extra fertility model
- Model 4: added relative alignment model
- Model 5: fixed deficiency problem.
- Model 6: Model 4 combined with a HMM alignment model in a log linear way
Mathematical setup
[edit]The IBM alignment models translation as a conditional probability model. For each source-language ("foreign") sentence , we generate both a target-language ("English") sentence and an alignment . The problem then is to find a good statistical model for , the probability that we would generate English language sentence and an alignment given a foreign sentence .
The meaning of an alignment grows increasingly complicated as the model version number grew. See Model 1 for the most simple and understandable version.
Model 1
[edit]Word alignment
[edit]Given any foreign-English sentence pair , an alignment for the sentence pair is a function of type . That is, we assume that the English word at location is "explained" by the foreign word at location . 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 -> 明日
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 .
Future models will allow one English world to be aligned with multiple foreign words.
Statistical model
[edit]Given the above definition of alignment, we can define the statistical model used by Model 1:
- Start with a "dictionary". Its entries are of form , which can be interpreted as saying "the foreign word is translated to the English word with probability ".
- After being given a foreign sentence with length , we first generate an English sentence length uniformly in a range . In particular, it does not depend on or .
- Then, we generate an alignment uniformly in the set of all possible alignment functions .
- Finally, for each English word , generate each one independently of every other English word. For the word , generate it according to .
Together, we have the probabilityIBM Model 1 uses very simplistic assumptions on the statistical model, in order to allow the following algorithm to have closed-form solution.
Learning from a corpus
[edit]If a dictionary is not provided at the start, but we have a corpus of English-foreign language pairs (without alignment information), then the model can be cast into the following form:
- fixed parameters: the foreign sentences .
- learnable parameters: the entries of the dictionary .
- observable variables: the English sentences .
- latent variables: the alignments
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:This can be solved by Lagrangian multipliers, then simplified. For a detailed derivation of the algorithm, see [3] chapter 4 and.[4]
In short, the EM algorithm goes as follows:
INPUT. a corpus of English-foreign sentence pairs
INITIALIZE. matrix of translations probabilities .
This could either be uniform or random. It is only required that every entry is positive, and for each , the probability sums to one: .
LOOP. until converges:
where each is a normalization constant that makes sure each .
RETURN. .
In the above formula, is the Dirac delta function -- it equals 1 if the two entries are equal, and 0 otherwise. The index notation is as follows:
ranges over English-foreign sentence pairs in corpus;
ranges over words in English sentences;
ranges over words in foreign language sentences;
ranges over the entire vocabulary of English words in the corpus;
ranges over the entire vocabulary of foreign words in the corpus.
Limitations
[edit]There are several limitations to the IBM model 1.[3]
- No fluency: Given any sentence pair , any permutation of the English sentence is equally likely: for any permutation of the English sentence into .
- No length preference: The probability of each length of translation is equal: for any .
- Does not explicitly model fertility: some foreign words tend to produce a fixed number of English words. For example, for German-to-English translation, ja is usually omitted, and zum is usually translated to one of to the, for the, to a, for a.
Model 2
[edit]Model 2 allows alignment to be conditional on sentence lengths. That is, we have a probability distribution , meaning "the probability that English word is aligned to foreign word , when the English sentence is of length , and the foreign sentence is of length ".
The rest of Model 1 is unchanged. With that, we have The EM algorithm can still be solved in closed-form, giving the following algorithm:where are still normalization factors. See section 4.4.1[3] of for a derivation and an algorithm.
Model 3
[edit]The fertility problem is addressed in IBM Model 3. The fertility is modeled using probability distribution defined as:
For each foreign word , such distribution indicates to how many output words it usually translates. This model deals with dropping input words because it allows . 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:
![](http://up.wiki.x.io/wikipedia/commons/d/d7/IBM_models_03.jpg)
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:[5]
- ja NULL nie pôjde tak do do domu
- I do not go the to house
- I do not go to the house
IBM Model 3 can be mathematically expressed as:
where represents the fertility of , each source word is assigned a fertility distribution , and and refer to the absolute lengths of the target and source sentences, respectively.[6]
See section 4.4.2[3] of for a derivation and an algorithm.
Model 4
[edit]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:
For additional words:
where and functions map words to their word classes, and and are distortion probability distributions of the words. The cept is formed by aligning each input word to at least one output word.[7]
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).[7]
Model 5
[edit]IBM Model 5 reformulates IBM Model 4 by enhancing the alignment model with more training parameters in order to overcome the model deficiency.[8] 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 denotes the number of free positions in the output, the IBM Model 5 distortion probabilities would be defined as:[9]
For the initial word in the cept:
For additional words:
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:[10]
where the interpolation parameter 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 with as:
The log-linear combination is used instead of linear combination because the values are typically different in terms of their orders of magnitude for HMM and IBM Model 4.[11]
References
[edit]- ^ "IBM Models". SMT Research Survey Wiki. 11 September 2015. Retrieved 26 October 2015.
- ^ Yarin Gal; Phil Blunsom (12 June 2013). "A Systematic Bayesian Treatment of the IBM Alignment Models" (PDF). University of Cambridge. Archived from the original (PDF) on 4 Mar 2016. Retrieved 26 October 2015.
- ^ a b c d Koehn, Philipp (2010). "4. Word-Based Models". Statistical Machine Translation. Cambridge University Press. ISBN 978-0-521-87415-1.
- ^ "CS288, Spring 2020, Lectur 05: Statistical Machine Translation" (PDF). Archived (PDF) from the original on 24 Oct 2020.
- ^ Wołk K., Marasek K. (2014). Polish-English Speech Statistical Machine Translation Systems for the IWSLT 2014. Proceedings of the 11th International Workshop on Spoken Language Translation, Lake Tahoe, USA. arXiv:1509.08874.
- ^ FERNÁNDEZ, Pablo Malvar. Improving Word-to-word Alignments Using Morphological Information. 2008. PhD Thesis. San Diego State University.
- ^ a b Schoenemann, Thomas (2010). Computing optimal alignments for the IBM-3 translation model. Proceedings of the Fourteenth Conference on Computational Natural Language Learning. Association for Computational Linguistics. pp. 98–106.
- ^ KNIGHT, Kevin. A statistical MT tutorial workbook. Manuscript prepared for the 1999 JHU Summer Workshop, 1999.
- ^ Brown, Peter F. (1993). "The mathematics of statistical machine translation: Parameter estimation". Computational Linguistics (19): 263–311.
- ^ Vulić I. (2010). "Term Alignment. State of the Art Overview" (PDF). Katholieke Universiteit Leuven. Retrieved 26 October 2015.[permanent dead link]
- ^ Wołk, K. (2015). "Noisy-Parallel and Comparable Corpora Filtering Methodology for the Extraction of Bi-Lingual Equivalent Data at Sentence Level". Computer Science. 16 (2): 169–184. arXiv:1510.04500. Bibcode:2015arXiv151004500W. doi:10.7494/csci.2015.16.2.169. S2CID 12860633.