Wiki
Core12 min read

Scoring generated text

Perplexity, BLEU, ROUGE, METEOR and BERTScore — what each metric actually measures, why overlap scores disagree with humans, and when to prefer learned or human evaluation.

A model that writes fluent English can be confidently wrong; a model that is correct can read awkwardly. Evaluation has to put a number on "how good is this output", and every number turns out to encode a theory of what good means. Two candidate outputs, one reference answer — which is better is partly a choice of metric.

The field splits into two questions. Is the model surprised by real text (perplexity, reference-free), and does its output match a reference (BLEU, ROUGE, METEOR, BERTScore, reference-based)? Pick the question first; the metric follows.

Two different questions

A reference-free metric asks "does this text look like language the model finds likely?" A reference-based metric asks "how much does this output overlap the gold answer?" Neither asks "is it true?" — which is why metrics are for iterating and regressions, while human review is for deciding whether to ship.

One reference, one editable candidate — the overlap scores update as you type. Try the presets, then change a single word.

Presets

BLEU-4

51.5%

precision, all 4 orders

ROUGE-1 F1

93.3%

unigram overlap

ROUGE-2 F1

76.9%

bigram overlap

ROUGE-L F1

93.3%

longest common subsequence

Clipped n-gram precision (BLEU components)

1-gram
100.0%
2-gram
83.3%
3-gram
60.0%
4-gram
25.0%

7 candidate tokens vs 8 reference tokens · brevity penalty 0.87 (candidate is shorter than the reference)

Dropping one token breaks contiguous n-grams, so strict BLEU-4 collapses even though the sentence still reads fine. BLEU and ROUGE move together here, but notice which one punishes word order (BLEU/ROUGE-2) and which forgives it (ROUGE-L).

The overlap scores are computed for real with a simplified, whitespace/alphanumeric tokenizer — close to BLEU and ROUGE, not identical to the reference implementations. Perplexity and BERTScore need a language model and are not simulated here.

Perplexity: reference-free likelihood

Perplexity asks how well a language model predicts held-out text, needing no reference answer at all. For a sequence x1,…,xNx_1, \dots, x_N:

PPL=exp⁡ ⁣(−1N∑i=1Nln⁡p(xi∣x<i))\text{PPL} = \exp\!\left(-\frac{1}{N}\sum_{i=1}^{N} \ln p(x_i \mid x_{<i})\right)

It is the exponentiated average negative log-likelihood per token, so it reads as "the model is about this unsure between this many equally likely next tokens". Lower is better. Three cautions matter in practice: perplexity is per token, so it depends on the tokenizer and is not comparable across models with different vocabularies; it measures likelihood, not correctness; and a model can have low perplexity on text it still fails to reason about.

Overlap metrics: reference-based

When you have a gold reference, the classic metrics score the surface overlap between it and the candidate.

BLEU (translation) is precision-oriented: for each order nn, compute the clipped precision pnp_n — matched candidate nn-grams over all candidate nn-grams, where a gram can only match as many times as it appears in the reference — then combine with a brevity penalty BP\text{BP}:

BLEU=BP⋅exp⁡ ⁣(∑n=1Nwnln⁡pn),BP=min⁡ ⁣(1, e1−r/c)\text{BLEU} = \text{BP} \cdot \exp\!\left(\sum_{n=1}^{N} w_n \ln p_n\right), \qquad \text{BP} = \min\!\left(1,\ e^{1 - r/c}\right)

with wn=1/Nw_n = 1/N and c,rc, r the candidate and reference lengths. The geometric mean means any zero precision zeroes the whole score.

ROUGE (summarization) is the recall-oriented mirror. ROUGE-N is the fraction of reference nn-grams present in the candidate; ROUGE-L uses the longest common subsequence, so it credits words in the right order without demanding they be contiguous:

ROUGE-N=#{matched reference n-grams}#{reference n-grams}\text{ROUGE-N} = \frac{\#\{\text{matched reference } n\text{-grams}\}}{\#\{\text{reference } n\text{-grams}\}}

METEOR aligns unigrams with stemming and synonym matching, then takes the harmonic mean of precision and recall with a penalty for fragmented alignments. It correlates better with human judgment than BLEU because it gives partial, meaning-aware credit.

BERTScore replaces exact matching with contextual embeddings: tokenize reference and candidate, embed each token, greedily match tokens by cosine similarity, and report precision, recall and their F1F_1. Because the matching is in embedding space, a correct paraphrase with no shared words can still score well.

The worked example, by hand

Reference: the cat sat on the mat. Candidate: the cat is on the mat.

  • Clipped unigram precision p1=5/6p_1 = 5/6 ("is" has no match; the duplicate "the" is clipped to the reference's count).
  • p2=3/5p_2 = 3/5, p3=1/4p_3 = 1/4, and p4=0p_4 = 0 — none of the candidate's 4-grams occur in the reference.
  • So BLEU-4 =0= 0 even though the sentence is nearly identical, while ROUGE-1 recall is 5/6≈0.8335/6 \approx 0.833 and ROUGE-L F1F_1 is also 5/65/6.

That single example is the case against treating any one number as truth.

Why overlap metrics disagree with humans

  • Surface form versus meaning. "Feline" is not "cat" to an n-gram counter. Paraphrases are punished; METEOR and BERTScore soften this.
  • All-or-nothing n-grams. One missing 4-gram can zero BLEU, hiding real improvement.
  • Tokenization dependence. Scores shift with the tokenizer, and tokenizers differ across languages and domains.
  • Reference bias. A valid answer that differs from the one gold reference is scored as wrong.
  • Recall suits extraction, not abstraction. ROUGE rewards copying reference phrases, so it underrates genuinely abstractive summaries.
  • No factuality, no discourse. Overlap says nothing about whether a claim is true or a paragraph is coherent.

Careful

Never report a single overlap score as "quality". State the metric, the tokenizer, the number of references, and the dataset; report several metrics together; and reserve human or learned evaluation for decisions that matter. A metric is a smoke detector, not a verdict.

Reference-free, reference-based, and when to reach for humans

  • Reference-free: perplexity, token-level likelihood, and model-based quality estimation. Use when no gold answer exists — open-ended chat, creative writing, live traffic.
  • Reference-based: BLEU, ROUGE, METEOR, BERTScore, learned metrics like COMET. Use when a gold answer exists and you are tracking a regression — translation, summarization, structured rewriting.
  • Human / judge evaluation: pairwise preference (the arena method), rubrics, error analysis. Slow and biased in its own ways, but the closest available proxy for "is this actually good?" Use it to calibrate the automatic metrics, then let the metrics run on every commit.

Illustrative vs real

The artifact above computes a simplified, single-reference overlap score with a plain alphanumeric tokenizer — close to BLEU and ROUGE, not a drop-in replacement. Production BLEU uses corpus-level statistics, multiple references and smoothing; BERTScore and METEOR require model weights or language resources and are not simulated here. Treat the numbers as a way to build intuition, not as benchmark results.

Check yourself

Eduspheria wiki · Large Language Models, Frontier

0 / 5 answered

  1. 1Reference: 'the cat sat on the mat'. Candidate: 'the cat is on the mat'. Report ROUGE-1 recall — matched reference unigrams divided by total reference unigrams.
    Numeric answer
  2. 2That same candidate scores BLEU-4 = 0 despite sharing most words with the reference. What is the direct cause?
    Multiple choice
  3. 3With clipped unigram precision 5/6 and bigram precision 3/5 (and a brevity penalty of 1), what is the geometric-mean BLEU-2?
    Numeric answer
  4. 4BERTScore matches tokens by contextual embeddings, so it can give partial credit to a correct paraphrase that shares no exact words with the reference.
    True / false
  5. 5Which of these metrics is reference-free?
    Multiple choice

Where next: the frontier chapter ends here — the interpretability chapter opens the model itself, starting with what models learn inside.