Statistical Machine Translation Foundations › The Log-Linear Model
Language AI HandbookAll chapters Och and Ney (2002) combined translation scores, language-model scores and other features in a log-linear model. Here we return to the decoding notation from the opening. The input is fixed, and ranges over possible translations.
where:
- is a candidate translation.
- is the fixed input sentence.
- : the -th feature function, scoring the pair
- : the tunable weight of feature
- : the number of features
- The denominator sums the exponential scores over candidate translations for the same input .
For a fixed input the denominator is shared by all candidates. Exponentiation preserves their ordering, so finding the most probable candidate amounts to maximizing its weighted feature sum.
Setting , and recovers the noisy-channel ranking. Summing the score exponentials over the full target support then gives by the law of total probability. A decoder needs only the weighted score to rank translations.
The Feature Set
A typical phrase-based system uses these features:
- Direct phrase translation score sums over phrase pairs.
- Inverse phrase translation score sums over phrase pairs.
- Direct lexical weighting sums over phrase pairs.
- Inverse lexical weighting sums over phrase pairs.
- Language model score: , possibly several LMs for different corpora.
- Distortion: a penalty on reordering, usually the sum of jump distances .
- Word penalty applies a tuned coefficient to the number of output words.
- Phrase count applies a tuned coefficient to the number of phrase pairs used.
Comparing two segmentations involves different numbers of phrase-score terms. A negative phrase-count coefficient favors fewer phrases when the other feature totals tie. A positive coefficient favors more phrases under the same condition.
Weight Tuning: MERT and Friends
Och and Ney estimated the weights of a conditional log-linear translation model by maximizing the likelihood of reference translations. Minimum error rate training (MERT) instead chooses weights to minimize an automatic translation error measure on held-out data, such as when BLEU is expressed on the unit scale. Och and Ney (2002), equation 11, Och (2003), sections 2–3.
The algorithm exploits a property of the log-linear form: if you fix everything except , each candidate translation's score is a linear function of . The best-scoring candidate therefore changes only at finitely many breakpoints, and the error as a function of is piecewise constant. In one dimension you can enumerate all breakpoints exactly; MERT does this, alternating between coordinate directions until convergence. Concretely, for a candidate pool of translations, the score of candidate is , so any two candidates cross at most once, giving at most breakpoints. Sort them, evaluate the metric on each interval, keep the best, and repeat for the next coordinate.
Coordinate descent on a piecewise-constant, non-convex objective has no global optimality guarantee. Results can depend on initialization, tuning examples, and the candidates retained. Pairwise ranking optimization is an alternative described by Hopkins and May (2011). When tuning to a corpus-level metric, measure performance on a separate test set.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!