Glossary

What is Perplexity?

In Turkish: Şaşkınlık değeri (perplexity metriği) · Topic: Data and evaluation

A metric for how “surprised” a language model is by the next word (token) in a text; the lower the value, the better the model predicts that text.

How does it work?

At each step a language model produces a probability distribution over the next token. On a test text, the probabilities the model gave to the tokens that actually appeared are averaged and converted into a number that reflects how many options the model was torn between at each step. A perplexity of ten roughly means the model hesitated between ten equally likely choices. The lower the value, the less surprised the model is. Comparisons are only meaningful when the same text and the same tokenization are used.

Why does it matter?

Perplexity is a common, cheap way to track progress while training a language model. It does not say whether the model’s answers are correct, useful or safe, so a low value does not prove a model makes a good chat assistant. Modern models are therefore judged with other tests as well.

Example

A researcher measures two small language models on the same Turkish news article; the one with the lower perplexity is better at predicting the next words in it.

FAQ

Does lower perplexity always mean a better model?

No. It only shows how well the model predicts that text. Answer quality, accuracy and safety need to be measured separately.

Can perplexity scores of different models be compared directly?

Only if the same test text and the same tokenization are used. If the models split text into tokens differently, the numbers are not equivalent.

All terms