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.