Zenaique

BLEU score comes up in a meeting. What does it measure and when does it still make sense?

Flashcard·Easy·4.0 · 0·~30s·Asked atCognizantComet MlNeptune Ai·Relevant atAnthropicAnyscaleDatadogScale Ai
Attempt it
TL;DR

BLEU measures n-gram precision between generated and reference text, designed for machine translation where valid outputs share phrasing. Misleading for open-ended generation.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Imagine you asked ten translators to translate the same paragraph from French to English. Their translations would use mostly the same words in mostly the same order, because there are only so many natural ways to say the same thing in English. BLEU takes advantage of this. It looks at the machine's translation and checks how many of its word sequences (single words, pairs, triples, groups of four) also appear in the human reference translation. The more matches, the higher the score. There is also a penalty for outputs that are too short, since a very short translation could get all its words right but miss half the meaning. This works well for translation because the outputs are constrained. But if you asked ten people to write a creative story about a cat, they would use completely different words. BLEU would score all of them poorly against any single reference, even though they are all good stories.

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

BLEU is one of the oldest and most widely cited metrics in NLP. It was introduced in 2002 specifically for machine translation evaluation, and it remains the standard metric for that task two decades later.

Understanding BLEU matters for LLM evaluation interviews because it is the metric everyone has heard of, yet it is also the metric most commonly misapplied. Knowing when BLEU works and when it fails signals that you understand evaluation at a conceptual level, not just a tooling level.

How BLEU works mechanically

BLEU computes modified n-gram precision at four levels (n = 1, 2, 3, 4) and combines them into a single score.

For each n-gram size, the algorithm counts how many n-grams in the candidate text also appear in the reference. The key word is 'modified': standard precision would let a candidate that repeats 'the the the the' get perfect unigram precision if 'the' appears in the reference. Modified precision clips each n-gram's count to its maximum occurrence in any single reference. If 'the' appears three times in the reference, only three of the candidate's 'the' tokens count as matches, no matter how many times the candidate repeats it.

The four precision values are combined using a geometric mean with equal weights. The geometric mean is harsh: if any single n-gram level has zero precision (no matching n-grams at that size), the entire score is zero.

Finally, a brevity penalty is applied. If the candidate is shorter than the reference, the score is multiplied by a factor less than 1. The formula is exp(1 - reference_length / candidate_length) when the candidate is shorter, and 1 otherwise. This prevents a model from gaming precision by producing only a few high-confidence words.

Why BLEU works for translation
Where BLEU fails and why
Modern replacements for non-translation tasks
Reading and reporting BLEU scores correctly
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.

Real products, models, and research that use this idea.

  • Google Translate reports BLEU scores internally on its translation benchmarks, and BLEU improvements correlate with user preference gains for the translation use case.
  • The WMT (Workshop on Machine Translation) annual shared task uses BLEU as one of its primary evaluation metrics alongside human evaluation.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QHow does modified n-gram precision differ from standard n-gram precision, and why does the modification matter?
A

Standard precision counts every matching n-gram, so a candidate that repeats 'the the the' gets perfect unigram precision if 'the' appears in the reference. Modified precision clips each n-gram count to its maximum occurrence in any reference, preventing this degenerate behavior.

1 more follow-up an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Applying BLEU to open-ended generation tasks like summarization or dialogue. BLEU penalizes valid paraphrases because it only counts exact n-gram matches, making it a poor proxy for quality on tasks with diverse valid outputs.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • Define BLEU as a metric that measures n-gram precision between output and reference

  • Explain the four n-gram levels (unigram through 4-gram) and the geometric mean

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
Which metric best measures whether a RAG answer is grounded in the retrieved context?
MCQ·Medium