Skip to content
LiveNext 10:36:45

Definition

What is Perplexity?

Perplexity is Perplexity is a measure of how well a language model predicts text: the lower the number, the less surprised the model is by the words that actually come next.

Perplexity is one of the oldest scorecards for a language model. It answers a simple question: when the model reads real text, how surprised is it by each next word? A low score means the model usually expected what came next. A high score means it was often caught off guard.

(Not to be confused with the AI search product of the same name. This entry is about the measurement.)

How it works

A large language model reads text one token at a time and assigns a probability to every possible next token. Perplexity is built from the probability the model gave to the tokens that really appeared. Average the surprise across a whole passage, then convert it back to an easy scale, and you get the score.

A useful way to read it: a perplexity of 10 means the model is, on average, as uncertain as if it were choosing evenly among 10 equally likely tokens at each step. A perfect predictor would score 1.

Perplexity is closely tied to the loss function used in training. Perplexity is the exponential of the average cross-entropy loss, so the two move together. Labs often quote the loss itself, or its logarithm, because it behaves more smoothly as models improve.

Why it matters

Perplexity is cheap to compute and needs no human judges. You only need a body of text the model was not trained on, often called a held-out dataset. That makes it handy for comparing training runs and for charting how a model improves as it gets more data and compute, the pattern described in scaling laws.

What it does not tell you

Perplexity measures prediction, not usefulness. A model can score well and still be a poor assistant, and two models can only be compared fairly if they use the same tokenizer and the same test text, because the score depends on how text is split into tokens. A tokenizer that splits words differently changes the number without changing the model's quality.

It also says little about hallucination, reasoning or safety. For those, people use evals and benchmarks built around specific tasks.

A quick example

Take the sentence "The cat sat on the ___." A good model puts most of its probability on "mat," "floor" or "couch." If the real next word is "mat," the model was barely surprised, which pulls perplexity down. If the sentence ends in "tax return," the model was very surprised, which pushes it up. Average that over millions of sentences and you have the model's perplexity on that text.

Perplexity sits next to pretraining, where models learn to predict text, and overfitting, which shows up as a gap between perplexity on training text and on held-out text.

Questions people ask

What is a good perplexity score?

Lower is better, but there is no universal good number. It depends on the text and the tokenizer, so only compare scores measured on the same data in the same way.

How is perplexity related to loss?

Perplexity is the exponential of the average cross-entropy loss, so lowering the loss lowers perplexity.

Perplexity in the news

#04

Microsoft fences in Windows agents as Nvidia PCs ship

Microsoft made its agent containment layer generally available on Windows 11 and opened preorders for Nvidia RTX Spark PCs, from $2,599.99 for the Surface Laptop Ultra. The laptop gets the headlines, but the fence around your agents is the bigger change.

#01

Claude now builds live dashboards from your warehouse

Anthropic put Claude Dashboards into beta for paid plans on Thursday, connected to Snowflake, BigQuery, Databricks and Redshift, plus Motion explainer videos for Team and Enterprise. Dashboards is the one to try, because every number opens to the query behind it.

#02

Banks lock out AI agents as 1Password offers a key

Major US banks are blocking or limiting AI agents that sign in with customers' passwords, Axios reported, as 1Password unveiled a way for agents to log in without ever seeing one. Sharing your bank login with an agent is over. Delegated sign-in is next.