TECHNOLOGY

Perplexity depends on the tokenizer and its counting unit

In this article
THE QUICK TAKE

Perplexity is meaningful only with its evaluated events and denominator; different tokenizers can make superficially similar scores incomparable.

Perplexity summarizes how well a probability model predicts a reference sequence. It is often presented as a single score, but the unit behind that score is a tokenizer-defined event. Reading the denominator and the evaluation protocol is essential before using perplexity to compare checkpoints, architectures or training runs.

The exponent follows an averaged log loss

For a declared set of predicted reference tokens, sum their negative log probabilities and divide by the number of included events. With natural logarithms, exponentiating that mean gives perplexity. A model assigning greater probability to the reference events obtains a smaller value under the same protocol. This definition explains why a few very improbable events can matter: averaging occurs in log space. The score is not a count of factual mistakes, and a fluent but incorrect statement can still be probable under a language model.

Token boundaries change the unit

The same character string can become a different number and sequence of tokens under different vocabularies. Imagine one tokenizer treating a technical term as one token and another dividing it into several pieces. Their mean per-token losses have different denominators and event definitions. It is therefore unsafe to rank the models solely from those means without a comparable evaluation basis. Report the tokenizer and consider a declared text-based normalization when cross-tokenizer comparison is required, including exactly how that normalization is computed.

Context windows change available evidence

A long reference document must be evaluated according to a windowing policy. Independent chunks may lose context at boundaries, while overlapping or sliding windows can provide more preceding text. The resulting prediction events must be counted once according to the declared rule. An opening token with little context is not the same experiment as that token evaluated after a long prefix. Record document boundaries, beginning and ending symbols, ignored labels and effective context lengths together with the final score, rather than treating perplexity as an intrinsic checkpoint constant.

Use a ledger before interpreting improvements

A small evaluation ledger lists each target, its available prefix, its log probability and whether it enters the denominator. Reconstruct the aggregate from those entries on a miniature corpus before scaling up. Then keep held-out data, tokenizer, masking and aggregation fixed when comparing a training change. Lower perplexity under this controlled setup indicates improved reference likelihood. Broader claims about task correctness, reasoning or deployment usefulness require their own observations because the metric measures conditional text prediction rather than every application objective.

Primary research and implementation references

Reproducible inference stacks: preserving a GPU pilot’s result; A GPU inference benchmark you can trust.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles