Sub topic 15
Choosing and Reporting Metrics for Your Task
This chapter assumes you know basic Python, precision, recall, F1, and the rough idea behind word embeddings and transformer language models. The goal is not to find one perfect score. The goal is to measure the behavior that matters for your task and report enough detail for someone else to reproduce it.
Match the metric to the task
Automatic metrics compare a generated text with one or more reference texts. A reference-based metric is a proxy: it measures similarity to the references, not quality directly.
Use BLEU when exact wording and local word order matter, especially in machine translation. BLEU is usually reported at the corpus level and emphasizes modified n-gram precision.
Use ROUGE when the generated text should cover important content from a reference. ROUGE-1 and ROUGE-2 measure unigram and bigram overlap. ROUGE-L measures the longest common subsequence. Recall is often important for summarization because missing a key detail can matter more than using extra words.
Use BERTScore when a good answer may paraphrase the reference. It compares contextual token embeddings, so related words can receive credit even when their surface forms differ.
| Task | Useful primary metrics | Important companion checks |
|---|---|---|
| Translation | Corpus BLEU, BERTScore | Human adequacy, terminology accuracy |
| Summarization | ROUGE-1, ROUGE-2, ROUGE-L | Factuality, completeness, readability |
| Paraphrase generation | BERTScore, ROUGE-L | Meaning preservation, human judgments |
| Open-ended text | BERTScore or task-specific scores | Factuality, safety, diversity, human review |
Combine metrics instead of chasing one number
Metrics have different blind spots. BLEU can reward common phrases while missing meaning. ROUGE can favor copied text and penalize valid paraphrases. BERTScore can give high similarity to a fluent but factually wrong sentence because its words are semantically close.
A useful evaluation usually combines:
- One main metric that matches the task.
- One complementary metric with a different failure mode.
- Targeted checks for factuality, correctness, safety, or formatting.
- Human evaluation on a representative sample.
Do not assume that a higher score proves a better system. Inspect examples where systems disagree. These cases reveal whether a metric rewards the behavior you actually want.
Report results reproducibly
A score is incomplete without its evaluation recipe. Report the dataset and split, the number of examples, the reference count, preprocessing, metric variant, library version, model and language settings, and whether scores are sentence-level or corpus-level.
For BLEU, record the tokenizer and smoothing policy. SacreBLEU is useful because it applies a standardized tokenization and prints a signature describing important settings. For ROUGE, record stemming, the selected variants, and whether you used ROUGE-L or ROUGE-Lsum. For BERTScore, record the language, model, IDF setting, and baseline rescaling.
import sacrebleu
hypotheses = ["the cat sat on the mat"]
references = [["the cat is on the mat"]]
result = sacrebleu.corpus_bleu(hypotheses, references)
print(f"BLEU: {result.score:.2f}")
print(result.format())Compare systems on the same examples and references. Report uncertainty when possible, such as a bootstrap confidence interval. For small test sets, a difference of a few hundredths may not be meaningful.
Common reporting errors
- Averaging sentence BLEU values and calling the result corpus BLEU.
- Changing tokenization between systems.
- Passing BERTScore arguments in the wrong order. The package expects candidates first and references second.
- Comparing ROUGE results produced with different stemming or aggregation settings.
- Reporting only the best metric while hiding failures in factuality or fluency.
Exercise
You are evaluating a summarizer whose output often uses valid paraphrases but sometimes invents facts. Which metrics and checks would you report?
Show answer
Report ROUGE-1, ROUGE-2, or ROUGE-L for reference overlap and BERTScore for semantic similarity. Add a factuality check and human review, because none of these overlap metrics reliably detects invented facts.