Translation Evaluation Beyond BLEU › Do the Differences Matter? Paired Bootstrap

Michael BrenndoerferNovember 25, 20263 min read
Language AI HandbookAll chapters
Part 27 of 67Machine Translation and Speech Translation
Chapter 194Translation Evaluation Beyond BLEU › Do the Differences Matter? Paired Bootstrap
Reading section 12 of 16 · Do the Differences Matter? Paired Bootstrap · 3 minSection 12 of 16 · 3 min

Section 12 of 16 · 3 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

In this constructed A/B comparison, A copies the references and B emits the paired paraphrases. Both sets receive the same assigned quality scores. Paired resampling shows how consistently corpus BLEU separates them on this sample.

PythonIn [29]
CollapseExpand
sys_a = df[df["kind"] == "good"].sort_values("seg_id")
sys_b = df[df["kind"] == "paraphrase"].sort_values("seg_id")

refs = sys_a["reference"].tolist()
hyps_a = sys_a["hyp"].tolist()
hyps_b = sys_b["hyp"].tolist()

obs_a = corpus_bleu_metric.corpus_score(hyps_a, [refs]).score
obs_b = corpus_bleu_metric.corpus_score(hyps_b, [refs]).score
print(f"System A corpus BLEU: {obs_a:.2f}")
print(f"System B corpus BLEU: {obs_b:.2f}")
print(f"Observed difference : {obs_a - obs_b:.2f}")
ConsoleOut [30]
CollapseExpand
System A corpus BLEU: 100.00
System B corpus BLEU: 75.57
Observed difference : 24.43
System A mean toy MQM: 100.00
System B mean toy MQM: 100.00

Corpus BLEU favors the reference copies by 24.43 points. The toy MQM-style scores are both 100 by construction. The next cell recomputes the BLEU gap on paired resamples of the same eight source segments.

PythonIn [31]
CollapseExpand
def corpus_bleu(hyps, refs):
    return corpus_bleu_metric.corpus_score(hyps, [refs]).score


rng = np.random.default_rng(0)
n = len(refs)
n_boot = 2000
deltas = np.empty(n_boot)

for b in range(n_boot):
    idx = rng.integers(0, n, n)
    sample_refs = [refs[i] for i in idx]
    s_a = corpus_bleu([hyps_a[i] for i in idx], sample_refs)
    s_b = corpus_bleu([hyps_b[i] for i in idx], sample_refs)
    deltas[b] = s_a - s_b

nonpositive = int(np.count_nonzero(deltas <= 0))
ci_lo, ci_hi = np.percentile(deltas, [2.5, 97.5])
ConsoleOut [32]
CollapseExpand
Bootstrap resamples      : 2000
Observed BLEU difference : 24.43
95% percentile interval  : [20.05, 28.19]
Nonpositive resamples   : 0 of 2000

All 2,000 resamples in this seeded run put A ahead on BLEU, and the percentile interval is about 20.05–28.19 points. The resamples are drawn around the observed comparison, so the nonpositive count describes the bootstrap distribution. A population-level claim would need a sampling design beyond these eight constructed segments.

VisualizationOut [33]
CollapseExpand
Histogram of bootstrap BLEU differences, entirely positive, with observed value marked.
Paired bootstrap distribution of the BLEU gap on the eight constructed source segments. All sampled gaps favor the reference copies, while both variant sets have the same assigned quality scores.

The gap is stable under resampling these pairs. The toy protocol assigns reference copies and designed paraphrases the same quality score because neither receives a penalty. BLEU rewards their different degrees of reference overlap. Check sampling uncertainty and metric validity separately.

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