Reference: "the cat is on the mat" (6 words). Candidate 1: "the the the the the the the". Candidate 2: "the cat mat". (a) What is the clipped unigram precision of Candidate 1? (b) For Candidate 2, what are the unigram precision and the brevity penalty, so what is its unigram-only BLEU?

Sequence models and transformers, Evaluation
Level L2 Elementary. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you can apply BLEU's clipping and brevity penalty by hand and see what each one fixes.

Key idea

Clip each candidate word's count by its maximum count in the reference. BP=1 if c>r and e1−r/c if c≤r, where c is the candidate length and r the reference length.

Steps

  1. Candidate 1 has 7 copies of "the". The reference has "the" twice, so the count is clipped to 2.
  2. Clipped precision =2/7≈0.286. Without clipping it would be 7/7=1, which is why clipping is needed.
  3. Candidate 2: "the", "cat" and "mat" each appear in the reference (once for "the" clipped at 2), so precision =3/3=1.
  4. Candidate length c=3 and reference length r=6. Since c≤r, BP=e1−6/3=e−1≈0.368.
  5. Unigram BLEU =BP×p1=0.368×1=0.368.
  6. So precision alone would give Candidate 2 a perfect score; the brevity penalty punishes it for being too short.

Common mistakes

How long your answer should be

Short worked solution; 2–3 minutes.

Last checked on 4 December 2026.

Read this

Previous in Sequence models and transformers: A training corpus has three sentences: "⟨s⟩ i like tea ⟨/s⟩", "⟨s⟩ i like coffee ⟨/s⟩" and "⟨s⟩ you like tea ⟨/s⟩". The vocabulary of predicted words is {i, you, like, tea, coffee, ⟨/s⟩}, so V=6. Using add-one smoothing, what is the bigram probability of the sentence "⟨s⟩ you like coffee ⟨/s⟩", and what does the unsmoothed MLE give?
Next in Sequence models and transformers: Three tokens have embeddings x1=(1,0), x2=(0,1) and x3=(1,1). Take Q=K=V=X (no projection matrices) and dk=2. What are the attention weights and output for token 1 using scaled dot-product attention?