Translation Evaluation Beyond BLEU › The Limits of N-gram Overlap

Michael BrenndoerferNovember 25, 20265 min read
Language AI HandbookAll chapters
Part 27 of 67Machine Translation and Speech Translation
Chapter 194Translation Evaluation Beyond BLEU › The Limits of N-gram Overlap
Reading section 3 of 16 · The Limits of N-gram Overlap · 5 minSection 3 of 16 · 5 min

Section 3 of 16 · 5 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

BLEU in one paragraph

You have seen BLEU before in the machine translation chapters, so here is only what we need for the argument. BLEU computes clipped n-gram precision between hypothesis cc and reference rr for n∈{1,…,N}n \in \{1,\dots,N\} (with N=4N=4 by default), multiplies those precisions geometrically, and applies a brevity penalty:

BLEU=BP⋅exp⁡(1N∑n=1Nlog⁡pn),BP=min⁡(1, exp⁡(1−∣r∣∣c∣))\text{BLEU} = \text{BP} \cdot \exp\left(\frac{1}{N}\sum_{n=1}^{N} \log p_n\right), \qquad \text{BP} = \min\left(1,\ \exp\left(1 - \frac{|r|}{|c|}\right)\right)

where:

  • NN: the highest order used, with a default maximum of four
  • pnp_n: the sum of clipped counts for matched hypothesis nn-grams, divided by the number of hypothesis nn-grams at that order
  • ∣c∣|c|: the number of tokens in the hypothesis (candidate)
  • ∣r∣|r|: the number of tokens in the reference (or effective reference length when multiple references exist)
  • BP\text{BP}: the brevity penalty, which equals 1 when the hypothesis is at least as long as the reference and decays exponentially when it is shorter

The formula gives a fraction for a nonempty hypothesis with positive included precisions. An included zero gives zero unsmoothed BLEU, and SacreBLEU reports 100 times the fraction and scores an empty hypothesis as zero. With the exponential smoothing used here, effective order omits orders with no hypothesis n-grams. Clipping counts limits the benefit of repeating matching words. For corpus BLEU we add clipped counts and hypothesis totals over segments separately for each order, then divide to get the corpus precisions. The brevity penalty uses the sum of the effective reference lengths and the sum of candidate lengths. Averaging sentence BLEU generally gives a different value.

The geometric mean is sensitive to low precision at any order. That rewards longer sequences of overlapping words and can penalize a paraphrase that breaks those sequences even when the meaning survives.

A worked example that should bother you

Consider this reference about a corporate decision, and two hypotheses:

  • Reference: "The board of directors rejected the takeover offer at its extraordinary meeting."
  • Hypothesis A (a legitimate paraphrase): "The board of directors turned down the takeover offer at its extraordinary meeting."
  • Hypothesis B (meaning reversed): "The board of directors accepted the takeover offer at its extraordinary meeting."

Both hypotheses differ from the reference in one place. The following cell shows what BLEU produces for each.

PythonIn [5]
CollapseExpand
ref = "The board of directors rejected the takeover offer at its extraordinary meeting."
candidates = {
    "A: turned down": "The board of directors turned down the takeover offer at its extraordinary meeting.",
    "B: accepted": "The board of directors accepted the takeover offer at its extraordinary meeting.",
}

for name, hyp in candidates.items():
    score = bleu_metric.sentence_score(hyp, [ref]).score
    print(f"{name:<16} sentence BLEU = {score:5.1f}")
ConsoleOut [6]
CollapseExpand
A: turned down   sentence BLEU =  70.0
B: accepted      sentence BLEU =  76.1

For this example SacreBLEU gives A 70.0 and B 76.1. Both replacements break the reference nn-grams that span the verb. A adds an extra token, which raises the denominators for the precision terms while leaving the same set of surrounding matched spans. BLEU prefers B by about six points even though B reverses the decision and A preserves it.

Four structural problems

Surface changes have no severity weights. BLEU counts overlapping tokens and subsequences without distinguishing a change in meaning from a surface edit. The effect of a swap still depends on its position, tokenization, and the other words in the segment.

Legitimate variation can be penalized. The same meaning can have several valid renderings. A tokenization or inflection difference can remove matching nn-grams at multiple orders. Multiple references help when they represent the valid alternatives.

Precision does not measure source adequacy. BLEU has no direct recall term. It uses a brevity penalty, and adding unmatched words can lower precision. Neither mechanism identifies the meaning of an added clause. A source-aware quality estimation model has access to the source and can learn adequacy signals, though its behavior still needs validation on omissions and additions.

Segment scores are sensitive to individual edits. A single word in a short segment can account for a large share of its higher-order matches. Scores can take intermediate values, and the change depends on which word changed and where it occurred. Evaluate a segment-level routing decision on annotated examples at the same granularity.

The reference is not innocent

There is a fifth problem that lives outside the metric: reference quality. Freitag, Grangier, and Caswell made the point bluntly in their 2020 paper "BLEU might be Guilty but References are not Innocent." If the reference is itself a mediocre translation, or if it uses a style the target audience does not want, a metric that rewards agreement with it is measuring the wrong thing. Adding references can cover more valid alternatives. Check whether those references still favor one style or register.

A supervised metric is trained to predict particular human labels on particular data. The choice of labels matters. A model trained against scalar ratings targets a different judgment from a model trained to predict labeled error spans. Evaluate either model against the quality criteria and examples that matter for the intended use.

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!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy