Formula
Perplexity
Perplexity is a metric used to evaluate the quality of a language model. It is mathematically defined as the exponential of the average cross-entropy loss over a sequence of tokens: . Conceptually, perplexity represents the reciprocal of the geometric mean of the number of real choices available when deciding the next token. A lower perplexity indicates a better model that predicts the next token with higher accuracy.
0
1
Updated 2026-05-14
Tags
Data Science
D2L
Dive into Deep Learning @ D2L