Sub topic 1
Why Generated Text Is Hard to Score
Generated text is difficult to evaluate because quality has several dimensions, while any automatic metric usually measures only one or two. A response can be fluent but factually wrong, accurate but incomplete, or semantically correct while sharing few words with a human-written reference.
Prerequisites
This chapter assumes that you know basic Python data structures, precision, recall, and F1 score. You should also have a rough understanding of word embeddings and transformer language models.
Quality Has Multiple Dimensions
Consider a summarization system that produces this output:
> The report says that sales increased by 12% after the product launch.
A good evaluation may need to ask:
- Is the statement factually supported by the source?
- Does it include the important information?
- Is it concise?
- Is it grammatical and readable?
- Does it answer the user's question?
- Does it avoid unsafe or biased claims?
A single numeric score cannot reliably answer all these questions. Automatic metrics are measurements of selected properties, not complete definitions of quality.
Reference-Based Evaluation Is a Proxy
Many traditional metrics compare a candidate, which is the generated text, with one or more references, which are human-written target texts. They count shared words, word sequences, or similar meanings.
This approach works well when the task has a relatively constrained answer. In machine translation, for example, a reference can show one acceptable rendering of a source sentence. However, natural language often has many valid ways to express the same idea.
Suppose the reference is:
> The child placed the book on the table.
A candidate such as this may be equally correct:
> The book was put on the table by the child.
A metric based on consecutive word sequences may give the candidate a lower score even though its meaning is almost identical. Conversely, a candidate can copy common words from the reference while making a factual error.
Different Metrics Make Different Trade-Offs
| Evaluation signal | What it can capture | What it can miss |
|---|---|---|
| Exact word or n-gram overlap | Shared wording and local phrase order | Paraphrases, factual correctness, deeper meaning |
| Recall of reference content | Whether reference terms or ideas appear | Whether extra generated content is wrong or irrelevant |
| Embedding similarity | Related meanings and paraphrases | Subtle negation, unsupported facts, reasoning quality |
| Human judgment | Task-specific usefulness and correctness | Cost, rater disagreement, and inconsistent procedures |
A strong evaluation therefore combines metrics with inspection of examples. For summarization, you might measure lexical overlap, semantic similarity, factual consistency, and human-rated usefulness. For dialogue, relevance and safety may matter more than reference similarity.
Why the Dataset Matters
Metric values depend on the evaluation set. A test set with short, formulaic answers may make overlap scores look strong. A test set with many valid paraphrases may make those same scores look weak. Scores also change with tokenization, punctuation handling, case normalization, language, and the number of references.
For this reason, a reported result should identify the dataset, preprocessing rules, references, metric implementation, and aggregation method. Comparing scores from different pipelines without these details can lead to false conclusions.
The next chapters examine how overlap and embedding-based metrics compute their scores. Understanding their mechanisms makes it easier to interpret both high scores and surprising failures.
Exercise
Why can a candidate receive a low reference-based score even when it is correct?
Show answer
The candidate may express the same meaning with different words or word order, so it shares few surface patterns with the reference.