ArticleslgStudy

science

BLEU

BLEU is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand BLEU rather than just read about it. In short: BLEU (bilingual evaluation understudy) is an algorithm for evaluating the quality of text which has been machine-translated from one natural language to another. Quality is considered to be the correspondence between a machine's output and that of a human: "the closer a machine translation is to a professional human translation, the better it is" – this is the central idea behind BLEU.[1] Invented at IBM in 2001, BL…

Key takeaways

  • BLEU belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect BLEU to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of BLEU from memory before moving on to harder problems.

Reference excerpt

BLEU (bilingual evaluation understudy) is an algorithm for evaluating the quality of text which has been machine-translated from one natural language to another. Quality is considered to be the correspondence between a machine's output and that of a human: "the closer a machine translation is to a professional human translation, the better it is" – this is the central idea behind BLEU.[1] Invented at IBM in 2001, BLEU was one of the first metrics to claim a high correlation with human judgements of quality,[2][3] and remains one of the most popular automated and inexpensive metrics. Scores are calculated for individual translated segments—generally sentences—by comparing them with a set of good quality reference translations. Those scores are then averaged over the whole corpus to reach an estimate of the translation's overall quality. Intelligibility or grammatical correctness are not taken into account.[4] BLEU's output is always a number between 0 and 1. This value indicates how similar the candidate text is to the reference texts, with values closer to 1 representing more similar texts. Few human translations will attain a score of 1, since this would indicate that the candidate is identical to one of the reference translations. For this reason, it is not necessary to attain a score of 1. Because there are more opportunities to match, adding additional reference translations will increase the BLEU score.[5]

Mathematical definition

Basic setup A basic, first attempt at defining the BLEU score would take two arguments: a candidate string ŷ and a list of reference strings (y(1),...,y(N)). The idea is that BLEU(ŷ;y(1),...,y(N)) should be close to 1 when ŷ is similar to y(1),...,y(N), and close to 0 if not. As an analogy, the BLEU score is like a language teacher trying to score the quality of a student translation ŷ by checking how closely it follows the reference answers y(1),...,y(N). Since in natural language processing, one should evaluate a large set of candidate strings, one must generalize the BLEU score to the case where one has a list of M candidate strings (called a "corpus") (ŷ(1),⋯,ŷ(M)), and for each candidate string ŷ(i), a list of reference candidate strings Si:=(y(i,1),...,y(i,Ni)). Given any string y=y1y2⋯yK, and any integer n≥1, we define the set of its n-grams to be Gn(y)={y1⋯yn,y2⋯yn+1,⋯,yK−n+1⋯yK}Note that it is a set of unique elements, not a multiset allowing redundant elements, so that, for example, G2(abab)={ab,ba}. Given any two strings s,y, define the substring count C(s,y) to be the number of appearances of s as a substring of y. For example, C(ab,abcbab)=2. Now, fix a candidate corpus Ŝ:=(ŷ(1),⋯,ŷ(M)), and reference candidate corpus S=(S1,⋯,SM), where each Si:=(y(i,1),...,y(i,Ni)).

Modified n-gram precision Define the modified n-gram precision function to be pn(Ŝ;S):=∑i=1M∑s∈Gn(ŷ(i))min⁡(C(s,ŷ(i)),maxy∈SiC(s,y))∑i=1M∑s∈Gn(ŷ(i))C(s,ŷ(i)) The modified n-gram, which looks complicated, is merely a straightforward generalization of the prototypical case: one candidate sentence and one reference sentence. In this case, it is pn({ŷ};{y})=∑s∈Gn(ŷ)min⁡(C(s,ŷ),C(s,y))∑s∈Gn(ŷ)C(s,ŷ)To work up to this expression, we start with the most obvious n-gram count summation:∑s∈Gn(ŷ)C(s,y)=number of n-substrings in ŷ that appear in y This quantity measures how many n-grams in the reference sentence are reproduced by the candidate sentence. Note that we count the n-substrings, not n-grams. For example, when ŷ=aba,y=abababa,n=2, all the 2-substrings in ŷ (ab and ba) appear in y 3 times each, so the count is 6, not 2. In the above situation, however, the candidate string is too short. Instead of 3 appearances of ab it contains only one, so we add a minimum function to correct for that: ∑s∈Gn(ŷ)min⁡(C(s,ŷ),C(s,y))This count summation cannot be used to compare between sentences, since it is not normalized. If both the reference and the candidate sentences are long, the count could be big, even if the candidate is of very poor quality. So we normalize it ∑s∈Gn(ŷ)min⁡(C(s,ŷ),C(s,y))∑s∈Gn(ŷ)C(s,ŷ) The normalization is such that it is always a number in [0,1], allowing meaningful comparisons between corpuses. It is zero if none of the n-substrings in candidate is in reference. It is one if every n-gram in the candidate appears in reference, for at least as many times as in candidate. In particular, if the candidate is a substring of the reference, then it is one.

Brevity penalty The modified n-gram precision unduly gives a high score for candidate strings that are "telegraphic", that is, containing all the n-grams of the reference strings, but for as few times as possible. In order to punish candidate strings that are too short, define the brevity penalty to be BP(Ŝ;S):=e−(r/c−1)+ where (r/c−1)+=max⁡(0,r/c−1) is the positive part of r/c−1.

When r≤c, the brevity penalty BP=1, meaning that we don't punish long candidates, and only punish short candidates. When r>c, the brevity penalty BP=e1−r/c c is the length of the candidate corpus, that is,c:=∑i=1M|ŷ(i)|where |y| is the length of y. r is the effective reference corpus length, that is, r:=∑i=1M|y(i,j)|where y(i,j)=arg⁡miny∈Si||y|−|ŷ(i)||, that is, the sentence from Si whose length is as close to |ŷ(i)| as possible.

Final formula There is not a single definition of BLEU, but a whole family of them, parametrized by the weighting vector w:=(w1,w2,⋯). It is a probability distribution on {1,2,3,⋯}, that is, ∑i=1∞wi=1, and ∀i∈{1,2,3,⋯},wi∈[0,1]. With a choice of w, the BLEU score isBLEUw(Ŝ;S):=BP(Ŝ;S)⋅exp⁡(∑n=1∞wnln⁡pn(Ŝ;S))In words, it is a weighted geometric mean of all the modified n-gram precisions, multiplied by the brevity penalty. We use the weighted geometric mean, rather than the weighted arithmetic mean, to strongly favor candidate corpuses that are simultaneously good according to multiple n-gram precisions. The most typical choice, the one recommended in the original paper, is w1=⋯=w4=14.

Algorithm This is illustrated in the following example from Papineni et al. (2002):

Of the seven words in the candidate translation, all of them appear in the reference translations. Thus the candidate text is given a unigram precision of,

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with BLEU

Start with the simplest possible case. Write down what BLEU claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to BLEU before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about BLEU ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of BLEU

In research
BLEU appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses BLEU in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
BLEU is common in secondary-school and first-year university syllabi. It links to neighbouring topics Evaluation of machine translation, so understanding it makes those chapters shorter.
In everyday life
Look for BLEU outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “BLEU” →

How to study BLEU in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what BLEU means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain BLEU out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is BLEU in simple terms?

BLEU (bilingual evaluation understudy) is an algorithm for evaluating the quality of text which has been machine-translated from one natural language to another. Quality is considered to be the correspondence between a machine's output and that of a human: "the closer a machine translation is to a…

Why does BLEU matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study BLEU?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on BLEU.

Tags

  • Evaluation of machine translation

Keep exploring