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.
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)
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 :
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 , compute the clipped precision — matched candidate -grams over all candidate -grams, where a gram can only match as many times as it appears in the reference — then combine with a brevity penalty :
with and 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 -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:
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 . 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 ("is" has no match; the duplicate "the" is clipped to the reference's count).
- , , and — none of the candidate's 4-grams occur in the reference.
- So BLEU-4 even though the sentence is nearly identical, while ROUGE-1 recall is and ROUGE-L is also .
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
Where next: the frontier chapter ends here — the interpretability chapter opens the model itself, starting with what models learn inside.