ResearchPublished ExplainedAll news from that day
How perplexity scores a language model, and why the test text matters
Perplexity measures how well a language model predicts the next token, and a Hugging Face example shows the same GPT-2 model scoring 19.44 or 16.44 depending on the evaluation method.
Check our sources · 18 facts from 2 sources
Drawing: notis. No AI in this picture.
Key points
- Perplexity is the exponentiated average negative log-likelihood of a token sequence, which Hugging Face's documentation says equals the exponentiated cross-entropy between the data and the model's predictions.
- On WikiText-2, GPT-2 large scored a perplexity of 19.44 with no overlap between windows and 16.44 with a stride of 512, Hugging Face's documentation reports.
- OpenAI says it tracks the log of perplexity, and reports about 0.99 for GPT-3.5 and about 0.91 for GPT-4 on its current main evaluation dataset.
What happened
On 22 November OpenAI's chief scientist, Jakub Pachocki, asked AI labs to compare progress and inform shared safety standards using a number called perplexity, and OpenAI published its own figures for it. Perplexity measures how well a language model predicts the next token in a text, on average, and lower perplexity means better predictions.
Hugging Face's Transformers documentation gives the exact definition. Perplexity is the exponentiated average negative log-likelihood of a sequence of tokens, where the log-likelihood of each token is taken given the tokens before it, according to the model. The page says this equals the exponentiation of the cross-entropy between the data and the model's predictions.
That link explains the numbers in OpenAI's post. OpenAI says that in practice it tracks the log of perplexity, also called cross-entropy loss. So its figures of about 0.99 for GPT-3.5 and about 0.91 for GPT-4 are log-perplexities, and a smaller number is a better predictor.
A fixed-length model such as GPT-2 can only read a fixed number of tokens at a time. The documentation's example is the largest GPT-2, which has a fixed length of 1024 tokens, so it cannot condition on everything before a token in a longer text. One shortcut is to cut the text into separate chunks and score each alone.
The page says this is quick but a poor approximation that typically gives a higher, worse, perplexity, because the model has less context at most steps.
The better method is a sliding window, which keeps moving the context so that the model has more to go on at each prediction. The page says it typically gives a more favourable score, but needs a separate forward pass for each token, so a strided window is a practical compromise.
The page shows how much the method matters. On the WikiText-2 test set, GPT-2 large scored a perplexity of 19.44 with no overlap between windows, about the same as the 19.93 reported in the GPT-2 paper. With a stride of 512 it scored 16.44. The same model on the same text scored 19.44 one way and 16.44 the other, because only the evaluation method changed.
The same page warns that tokenization has a direct impact on a model's perplexity, so it must be considered when comparing different models. It also says the metric applies to classical autoregressive, or causal, language models and is not well defined for masked language models such as BERT.
OpenAI lists its own limits on perplexity as a shared metric. Labs use different evaluation datasets and train on different data mixtures, so numbers are hard to compare. Perplexity is detached from actionable evaluations, and chain-of-thought reasoning does not lower it. The lowest possible value is also unknown, since a loss of zero is not expected.
OpenAI's figures come from a held-out dataset taken from its own internal codebase, for a fixed snapshot. When you read a perplexity claim, check which text it was measured on, which tokenizer the model uses, and how the context was handled.
Underlined sentences link to the facts we checked. Dotted words open a short explainer.
Fact 4 of 18 · from OpenAI, 22 Nov 2026
In practice, we generally track the log of perplexity, also called cross-entropy loss.
What it means for you
Our viewA perplexity figure says little until you know the text it was measured on, the tokeniser the model uses and how the context was handled.
Hugging Face's documentation says tokenisation affects the score and that the metric is not well defined for masked language models such as BERT. OpenAI says labs use different datasets and data mixtures, which makes comparison hard. Treat a lower number as better only when those match.
Before you repeat a perplexity comparison in a report or a vendor review, ask which dataset, tokeniser and windowing method produced each figure.
It adds no new facts.
Your reaction
We count reactions per story and day, never who reacted. The counts help us choose what goes in the monthly issue. If you are signed in, your own page shows yours too.
We count reactions per story and day, never who reacted. They help choose what goes in the monthly issue.
Check our sources
Every sentence above is checked against these 2 sources.
1 Perplexity and Intelligence
Open the source archived copy-
OpenAI's chief scientist Jakub Pachocki argues in a post dated 22 November 2026 for establishing perplexity, or equivalently cross-entropy loss, as a metric to compare between model developers and inform shared safety standards.
citeOpenAI November 22, 2026 ... In this post, I argue for establishing perplexity (or, equivalently, cross-entropy loss) as a metric to compare between model developers and inform shared safety standards.
-
OpenAI's post says perplexity measures how well a model predicts the next token on average, and that lower perplexity means better predictions.
citePerplexity measures how well a model predicts the next token on average; lower perplexity means better predictions.
-
OpenAI says in the post that it is providing more transparency into pretraining progress by publishing its internal perplexity measurements.
citeAs a first step, I provide more transparency into pretraining progress at OpenAI. Publishing our internal perplexity measurements took some consideration
-
OpenAI says in a footnote that in practice it generally tracks the log of perplexity, also called cross-entropy loss.
citeIn practice, we generally track the log of perplexity, also called cross-entropy loss.
-
OpenAI's post gives a log-perplexity of about 0.99 for GPT-3.5 and about 0.91 for GPT-4 on its current main evaluation dataset.
citeGPT-3.5, at a log-perplexity of ~0.99 on our current main evaluation dataset ... GPT-4, at ~0.91
-
OpenAI lists four challenges of perplexity as a shared metric: difficulty of comparison across labs because developers use different evaluation datasets and data mixtures, detachment from actionable evaluations, not accounting for advances outside pretraining such as chain-of-thought reasoning, which does not reduce perplexity, and an unknown floor.
citeDifficulty of comparison across labs. Different developers use different evaluation datasets and train on different data mixtures. ... Detachment from actionable evaluations. ... Not accounting for advances outside of pretraining. Most notably, chain-of-thought reasoning does not reduce perplexity ... Unknown floor.
-
OpenAI says it does not expect it is possible to achieve a loss of 0, and that it does not know the inherent entropy of the data.
citeWe do not expect it is possible to achieve a loss of 0 ... But we do not know what the inherent entropy of the data is.
-
OpenAI says the numbers it reports come from held-out datasets sourced from its internal codebase, for a fixed snapshot.
citeThe primary held-out datasets we've been using since GPT-3.5 are sourced from our internal codebase, and those are the numbers reported here (for a fixed snapshot).
2 Perplexity of fixed-length models
Open the source archived copy-
Hugging Face's Transformers documentation defines perplexity as the exponentiated average negative log-likelihood of a sequence.
citePerplexity is defined as the exponentiated average negative log-likelihood of a sequence.
-
The Hugging Face page defines the log-likelihood term as the log-likelihood of the ith token conditioned on the preceding tokens according to the model.
citeis the log-likelihood of the ith token conditioned on the preceding tokens x<i according to our model.
-
The Hugging Face page says perplexity is equivalent to the exponentiation of the cross-entropy between the data and the model predictions.
citeThis is also equivalent to the exponentiation of the cross-entropy between the data and model predictions.
-
The Hugging Face page says the largest version of GPT-2 has a fixed length of 1024 tokens, so the likelihood of a token cannot be calculated directly when its position is greater than 1024.
citeThe largest version of GPT-2, for example, has a fixed length of 1024 tokens, so we cannot calculate p(x_t|x<t) directly when t is greater than 1024.
-
The Hugging Face page says breaking a sequence into disjoint chunks and adding up their log-likelihoods is quick to compute but a poor approximation of the fully-factorized perplexity, and will typically yield a higher (worse) perplexity because the model has less context at most prediction steps.
citebreak the sequence into disjoint chunks and add up the decomposed log-likelihoods of each segment independently. This is quick to compute ... but serves as a poor approximation of the fully-factorized perplexity and will typically yield a higher (worse) PPL because the model will have less context at most of the prediction steps.
-
The Hugging Face page says a sliding-window strategy gives the model more context at each prediction and will typically yield a more favorable score, but requires a separate forward pass for each token, and that a strided sliding window is a good practical compromise.
citethe PPL of fixed-length models should be evaluated with a sliding-window strategy ... so that the model has more context when making each prediction ... favorable score. The downside is that it requires a separate forward pass for each token in the corpus. A good practical compromise is to employ a strided sliding window
-
The Hugging Face page reports that GPT-2 large evaluated on WikiText-2 with stride 1024, which means no overlap, gave a perplexity of 19.44, about the same as the 19.93 reported in the GPT-2 paper.
citemodel_id = "openai-community/gpt2-large" ... When we run the above with stride = 1024, i.e. no overlap, the resulting PPL is 19.44, which is about the same as the 19.93 reported in the GPT-2 paper.
-
The Hugging Face page reports that the same evaluation with stride 512 gave a perplexity of 16.44.
citeBy using stride = 512 and thereby employing our striding window strategy, this jumps down to 16.44.
-
The Hugging Face page says the tokenization procedure has a direct impact on a model's perplexity, which should always be taken into consideration when comparing different models.
citethis means that the tokenization procedure has a direct impact on a model's perplexity which should always be taken into consideration when comparing different models.
-
The Hugging Face page says perplexity applies specifically to classical (autoregressive or causal) language models and is not well defined for masked language models like BERT.
citethe metric applies specifically to classical language models (sometimes called autoregressive or causal language models) and is not well defined for masked language models like BERT.
Every sentence above is checked against these 2 sources. Each fact has its own address you can cite.
Source 1 · OpenAI · 22 Nov 2026
Perplexity and Intelligence
OpenAI's chief scientist Jakub Pachocki argues in a post dated 22 November 2026 for establishing perplexity, or equivalently cross-entropy loss, as a metric to compare between model developers and inform shared safety standards.
OpenAI November 22, 2026 ... In this post, I argue for establishing perplexity (or, equivalently, cross-entropy loss) as a metric to compare between model developers and inform shared safety standards.
OpenAI's post says perplexity measures how well a model predicts the next token on average, and that lower perplexity means better predictions.
Perplexity measures how well a model predicts the next token on average; lower perplexity means better predictions.
OpenAI says in the post that it is providing more transparency into pretraining progress by publishing its internal perplexity measurements.
As a first step, I provide more transparency into pretraining progress at OpenAI. Publishing our internal perplexity measurements took some consideration
Show all 8 factsShow fewer facts
OpenAI says in a footnote that in practice it generally tracks the log of perplexity, also called cross-entropy loss.
In practice, we generally track the log of perplexity, also called cross-entropy loss.
OpenAI's post gives a log-perplexity of about 0.99 for GPT-3.5 and about 0.91 for GPT-4 on its current main evaluation dataset.
GPT-3.5, at a log-perplexity of ~0.99 on our current main evaluation dataset ... GPT-4, at ~0.91
OpenAI lists four challenges of perplexity as a shared metric: difficulty of comparison across labs because developers use different evaluation datasets and data mixtures, detachment from actionable evaluations, not accounting for advances outside pretraining such as chain-of-thought reasoning, which does not reduce perplexity, and an unknown floor.
Difficulty of comparison across labs. Different developers use different evaluation datasets and train on different data mixtures. ... Detachment from actionable evaluations. ... Not accounting for advances outside of pretraining. Most notably, chain-of-thought reasoning does not reduce perplexity ... Unknown floor.
OpenAI says it does not expect it is possible to achieve a loss of 0, and that it does not know the inherent entropy of the data.
We do not expect it is possible to achieve a loss of 0 ... But we do not know what the inherent entropy of the data is.
OpenAI says the numbers it reports come from held-out datasets sourced from its internal codebase, for a fixed snapshot.
The primary held-out datasets we've been using since GPT-3.5 are sourced from our internal codebase, and those are the numbers reported here (for a fixed snapshot).
Source 2 · Hugging Face
Perplexity of fixed-length models
Hugging Face's Transformers documentation defines perplexity as the exponentiated average negative log-likelihood of a sequence.
Perplexity is defined as the exponentiated average negative log-likelihood of a sequence.
The Hugging Face page defines the log-likelihood term as the log-likelihood of the ith token conditioned on the preceding tokens according to the model.
is the log-likelihood of the ith token conditioned on the preceding tokens x<i according to our model.
The Hugging Face page says perplexity is equivalent to the exponentiation of the cross-entropy between the data and the model predictions.
This is also equivalent to the exponentiation of the cross-entropy between the data and model predictions.
Show all 10 factsShow fewer facts
The Hugging Face page says the largest version of GPT-2 has a fixed length of 1024 tokens, so the likelihood of a token cannot be calculated directly when its position is greater than 1024.
The largest version of GPT-2, for example, has a fixed length of 1024 tokens, so we cannot calculate p(x_t|x<t) directly when t is greater than 1024.
The Hugging Face page says breaking a sequence into disjoint chunks and adding up their log-likelihoods is quick to compute but a poor approximation of the fully-factorized perplexity, and will typically yield a higher (worse) perplexity because the model has less context at most prediction steps.
break the sequence into disjoint chunks and add up the decomposed log-likelihoods of each segment independently. This is quick to compute ... but serves as a poor approximation of the fully-factorized perplexity and will typically yield a higher (worse) PPL because the model will have less context at most of the prediction steps.
The Hugging Face page says a sliding-window strategy gives the model more context at each prediction and will typically yield a more favorable score, but requires a separate forward pass for each token, and that a strided sliding window is a good practical compromise.
the PPL of fixed-length models should be evaluated with a sliding-window strategy ... so that the model has more context when making each prediction ... favorable score. The downside is that it requires a separate forward pass for each token in the corpus. A good practical compromise is to employ a strided sliding window
The Hugging Face page reports that GPT-2 large evaluated on WikiText-2 with stride 1024, which means no overlap, gave a perplexity of 19.44, about the same as the 19.93 reported in the GPT-2 paper.
model_id = "openai-community/gpt2-large" ... When we run the above with stride = 1024, i.e. no overlap, the resulting PPL is 19.44, which is about the same as the 19.93 reported in the GPT-2 paper.
The Hugging Face page reports that the same evaluation with stride 512 gave a perplexity of 16.44.
By using stride = 512 and thereby employing our striding window strategy, this jumps down to 16.44.
The Hugging Face page says the tokenization procedure has a direct impact on a model's perplexity, which should always be taken into consideration when comparing different models.
this means that the tokenization procedure has a direct impact on a model's perplexity which should always be taken into consideration when comparing different models.
The Hugging Face page says perplexity applies specifically to classical (autoregressive or causal) language models and is not well defined for masked language models like BERT.
the metric applies specifically to classical language models (sometimes called autoregressive or causal language models) and is not well defined for masked language models like BERT.
Topics
The morning email
On the mornings we publish: the three top stories and up to four short ones. Free.
We email you a link to confirm. An issue may include one sponsor, always labelled Sponsored · Advertisement. Our emails count opens and clicks, not who made them. Unsubscribe in one click. What we keep