Evaluation Metrics: Perplexity & Similarity
7 min read.
Compute cross-entropy and perplexity from a predicted probability, then run four adversarial reference/output pairs through exact match, lexical overlap and embedding similarity and watch the three metrics disagree with each other and with a human.
Think of it this way: Marking an essay by counting how many of the model answer's words appear in it. It works surprisingly often, fails completely on a good paraphrase, and fails silently — and dangerously — on an answer that says the exact opposite in the same vocabulary.
- Reference
- The refund will arrive in three to five business days.
- Model output
- You should see the money back within 3-5 working days.
- A person says
- Correct
| Metric | Score | Says | Agrees? |
|---|---|---|---|
| Exact match | 0.00 | Wrong | No |
| Word overlap F1 | 0.20 | Wrong | No |
| Embedding cosine | 0.91 | Correct | Yes |
Fooled: Exact match, Word overlap F1. A human marks this correct instantly. Exact match says 0. Word overlap is poor because every content word was swapped for a synonym. Only the embedding notices they mean the same thing.
Check your understanding
Answer from memory before you scroll back up. Pulling an idea out of your head is what makes it stay there.
What is this metric measuring?
Sort each metric by what it compares.
Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.
Token overlap with a reference
Drop items hereMeaning, via embeddings
Drop items hereThe model’s own confidence
Drop items hereQuiz
20 questionsPerplexity is defined as:
Done with this lesson?
Sign in free to keep your progress, streak and quiz scores.