Skip to main content

Research & Models · Explainer

Perplexity in AI: Meaning, Formula and Limits

Learn what perplexity in AI measures, how its score works, and why OpenAI wants to use it alongside other tests of AI skill.

Umair, Editor-in-chief
By · Editor-in-chief
· 6 min read · 13 sources

How this article was made: Researched and drafted with AI tools and checked against its sources. Umair reviews our articles and corrects them in public. How we work

A close-up view of measurement markings on a wooden ruler, with the label AI RESEARCH, the OpenAI logo and the words Understanding AI Perplexity in a navy band below
Photo illustration: A close-up view of measurement markings on a wooden ruler, with the OpenAI logo. Photo: Biking Nikon Maui from Sort of near San Francisco (photo), modified; logo: OpenAI, CC BY 2.0

The short answer

The score checks the odds an AI gave the text that really came next.

A text-prediction score can help track progress, but it cannot replace every test of AI skill. Comparisons depend on the test text and how the test is run.

In brief

The background
OpenAI put forward a plan to use this text-prediction score in shared limits for advanced AI.
Why it matters
Different ways of splitting and ordering text can change the result, making scores hard to compare across labs.
What to watch
The proposal calls for a first development limit and clear conditions for moving past it.

Key facts

  • The study Improving Pretraining Data Using Perplexity Correlations used a sample of 90 language models, according to its arXiv abstract.
  • Jason Wei and coauthors tested chain-of-thought prompting on three large language models, according to their arXiv paper, first submitted on January 28, 2022.
  • The arXiv submission history dates the first version of Perplexity Cannot Always Tell Right from Wrong to January 30, 2026.

Perplexity in AI scores how well a language model predicts test text. OpenAI has proposed using it, with other tests, to help set limits on advanced AI. But a low score does not mean a model does every task well.

What is perplexity in AI?

Perplexity is a score for how well a language model predicts the next piece of text in a test passage. Those pieces are called tokens. The score uses the chance the model gives each token that actually occurs. Lower scores mean better prediction of that test text.

Here, perplexity refers to the text-prediction measure. Tokens are the units of text a model processes. OpenAI’s help guide explains that a token can be a character, part of a word, a whole word or punctuation. Token counts are not word counts.

The key is the chance assigned to the actual next token, given the text before it. Confidence alone is not enough. A model can give a wrong prediction a high chance, so the score must account for what the test passage really contains.

How is perplexity calculated?

To find perplexity, start with the chance a model gives each actual next token. Take the negative natural log of each chance, then find the mean. This mean is called cross-entropy loss. Hugging Face’s guide says to apply the exponential function to that loss.

In short: PPL = exp(cross-entropy loss).

Cross-entropy loss measures prediction error on a log scale. Taking the natural log of perplexity returns that loss. They express the same underlying result on different scales, rather than testing two separate skills.

A simple example helps. Suppose a model narrows each next-token choice to two equally likely options, and the actual token is always one of them. Its perplexity is 2, as the ML Benchmarks guide explains. That is not a percentage of correct answers.

This math also links prediction to data compression. Grégoire Delétang and coauthors describe that link as long established in Language Modeling Is Compression. Their paper explains that predictive models can be turned into lossless compressors, and vice versa.

Another study, Scaling Laws for Neural Language Models, examined prediction loss as model size, data size and training work changed. Scaling laws describe patterns in how results change as those inputs grow. Our guide explains how AI scaling laws relate training resources to prediction loss.

What is a good perplexity score?

There is no single good perplexity score for all models or all text. ML Benchmarks explains that the number depends on the test passage, the way text is split into tokens, and the order of the data. A fair comparison needs those test conditions to be clear.

The theoretical minimum is 1. But a number alone tells readers little about the test’s difficulty. A score based on one set of text cannot be treated as the same result on a different set.

The tool that splits text into units is called a tokenizer. OpenAI’s help guide notes that the same text can produce different token counts across models. Hugging Face warns that this split directly affects the score, so raw numbers from different setups are not interchangeable.

Order matters because it changes the text available to help predict what follows. ML Benchmarks gives the example of grouping short posts by topic. Related posts may give the model useful context; random ordering may instead make that context misleading.

Scoring details matter too. The guide notes that teams may sample next-token probabilities at different intervals, changing the final number. IBM’s broader guidance is to choose tests based on what the model is meant to do.

Can perplexity measure intelligence?

Perplexity can track some gains in AI skill, but it is not a full test of intelligence. Research links training loss to later task results under set conditions. Other work shows that the score can miss wrong answers, failures on long texts and gains from step-by-step reasoning.

The study in the NeurIPS proceedings compared models with the same loss after pretraining, or initial training. It held the source texts, token-splitting method and model design fixed. Under those controls, the models achieved similar results on the later tasks tested.

The separate study on pretraining data found links between losses on many training texts and later benchmark scores. That supports a connection between prediction and task results, not a guarantee that every lower score means better answers.

Petar Veličković and coauthors presented analytic cases where the score fails to select the more accurate model. Lizhe Fang and coauthors identified another gap: averaging across all tokens can hide errors on crucial tokens in long passages.

Chain-of-thought means generating intermediate reasoning steps. Jason Wei and coauthors found that this improved performance on complex reasoning tasks. OpenAI says such gains do not reduce the pretraining perplexity score discussed in its post. A model can therefore gain useful skills without that measure showing the gain.

Why is OpenAI proposing perplexity limits?

OpenAI proposes using perplexity with other tests to set shared limits on future superintelligence, meaning hypothetical AI far smarter than people. The company argues that progress beyond each limit should depend on safeguards. It presents the score as one tool for this plan, not as a complete test of AI skill.

OpenAI calls it the closest approximation it has to model IQ, while stressing its use alongside other evaluations, or checks of what a model can do. The IQ comparison is the company’s framing. Our separate report covers OpenAI’s proposed limits on superintelligence.

The company’s discussion of the metric also lists problems with comparisons across labs. Developers use different test sets and training data mixes, it says. OpenAI adds that the score does not directly correspond to a task people care about.

OpenAI says it also does not know the inherent uncertainty in its data, which limits what it knows about the lowest possible loss. That is a further gap between tracking a score and knowing how much progress remains.

The company calls for agreement on a first development limit and concrete requirements for going beyond it. Its policy proposal says the first threshold should focus on whether more capable models can still be monitored.

Questions answered

Can perplexity test every type of language model?

No. Hugging Face says the usual measure applies to models that predict text in sequence. It is not well defined for masked language models such as BERT.

Can a perplexity score be infinite?

Yes. ML Benchmarks explains that this can happen when a model gives zero probability to a token that appears in the test text.

Does bits-per-byte solve the comparison problem?

Not fully. ML Benchmarks warns that this compression measure can mix the quality of the language model with the quality of the tool that splits text into tokens. Data order affects it too.

How does testing a model differ from testing an AI app?

IBM separates checks of a model's own skills from checks of a complete application. App testing also covers issues such as security and connections to other software.

Sources used

  1. Perplexity and Intelligence
  2. People must remain in control of the future
  3. Perplexity of fixed-length models
  4. Understanding and counting tokens
  5. Generative models
  6. LLM Evaluation
  7. Understanding Emergent Abilities of Language Models from the Loss Perspective
  8. Improving Pretraining Data Using Perplexity Correlations
  9. Perplexity Cannot Always Tell Right from Wrong
  10. What is Wrong with Perplexity for Long-context Language Modeling?
  11. Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  12. Language Modeling Is Compression
  13. Scaling Laws for Neural Language Models

Editorial standards

How this article was made: Researched and drafted with AI tools and checked against its sources. Umair reviews our articles and corrects them in public. See our editorial policy and corrections policy.

Umair, Editor-in-chief

· Editor-in-chief

Umair is the editor-in-chief of Superintelligence News. He holds a PhD in artificial intelligence, has three patents in AI and has worked in the field for more than 10 years.

Join the newsletter

New stories and explainers, free in your inbox.

By joining you agree to receive our email newsletter. Unsubscribe any time. Privacy policy

Read next

All articles →