# Perplexity (Metric)

> A score for how well a language model predicts text. Lower means less surprised.

**Field:** Artificial Intelligence  
**Category:** Evaluation & Benchmarks  
**Also known as:** Language Model Perplexity, Perplexity Score

## Think of it like

It is like how surprised you are by each next word in a story. Less surprise means you know the story well.

## Definition

Perplexity measures how well a language model predicts text it has not seen. At each step, the model gives a chance to the token that really comes next. Perplexity turns all those chances into one number. A perplexity of 10 means the model is as unsure as if it were picking from 10 equally likely words. Lower is better. It checks how well the model knows the language, not whether its answers are true.

## Formula

```
Perplexity = e to the power of (the average of -log(chance of each real next token))
```

## Example

A team trains two small models on news stories. On new stories, one has a perplexity of 18 and the other 25, so the first predicts the text better.

## Why it matters

It is cheap to work out and needs no human grader. So it is watched all through training to see if a model is learning.

## Common mistake

Comparing the score of two models that cut text in different ways. They count different pieces, so the numbers do not line up.

## Three principles

- **Chance of the real token.** How sure it was of what came.
- **Lower is better.** Less surprise, better fit.
- **Not truth.** Fluent is not the same as right.

## Related terms

- [Language Model](https://learn.benibix.com/term/ai/language-model)
- [Next-Token Prediction](https://learn.benibix.com/term/ai/next-token-prediction)
- [Token (AI)](https://learn.benibix.com/term/ai/token)
- [Tokenizer](https://learn.benibix.com/term/ai/tokenizer)
- [Log Probabilities (Logprobs)](https://learn.benibix.com/term/ai/logprobs)
- [Loss Function](https://learn.benibix.com/term/ai/loss-function)

## Told apart from

- [Perplexity (Metric) vs Perplexity](https://learn.benibix.com/compare/perplexity-metric-vs-perplexity): People think Perplexity the score and Perplexity the app are the same thing. They only share a name. One is a number that says how well a language model predicts text, and lower is better. The other is an AI search app that answers questions with links to its sources.

![The sentence 'The cat sat on the moon' with a bar above each word for the chance the model gave it. The bars grow from 0.20 to 0.80, and the last word, moon, gets only 0.01.](https://learn.benibix.com/diagrams/ai5-perplexity.svg)

---

Source: https://learn.benibix.com/term/ai/perplexity-metric
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
