What is a Perplexity (Metric)?

Perplexity is a measure of how well a language model predicts a sample of text, calculated as the exponential of the average negative log-likelihood the model assigns to each token, where lower perplexity means better prediction.

Intuitively, perplexity answers "how surprised was the model by this text?" A model with perplexity of, say, 20 on a dataset behaves, on average, as if it were choosing uniformly among 20 equally likely next tokens at each step; a perplexity of 2 means it was rarely surprised at all. It is computed directly from the model's own predicted probability distribution over the vocabulary at each position, compared against the actual next token. Perplexity is most useful as a relative, not absolute, signal: comparing two checkpoints of the same model on the same held-out dataset during pre-training tells you whether training is still improving the model, and comparing perplexity across domains tells you where a model is weakest (e.g., higher perplexity on legal text than on casual writing signals a knowledge gap). It is less useful for comparing across different tokenizers or vocabularies, since the token boundaries themselves change what "predicting the next token" even means. Critically, low perplexity does not guarantee a model is helpful, safe, or factually correct — it only measures how statistically predictable held-out text was to the model, which is why downstream task benchmarks and human evaluation remain necessary alongside it.

In practice with Neotask

Perplexity isn't something Neotask exposes to end users, but it's the kind of internal signal a model provider tracks during pre-training and fine-tuning of the underlying LLMs that power Neotask's agents — a rising perplexity on a held-out set is an early warning that a training run has gone off the rails before it ever reaches a released model.

Related terms

Start free

Plans

Free

$0/mo

Download without a card and start for free.

Individual

$50/mo

The full personal agent platform for one person.

Enterprise

$200/mo

Multiple workspaces and capacity for larger teams.

Continue