Perplexity

Information theory · Formula · Appears in 2 lessons

PPL=exp⁡ ⁣(−1N∑i=1Nlog⁡p(xi∣x<i))\mathrm{PPL} = \exp\!\left(-\frac{1}{N} \sum_{i=1}^{N} \log p(x_i \mid x_{<i})\right)

The exponential of average cross-entropy, read as an effective number of choices. A perplexity of 20 means the model is about as uncertain as if it were picking uniformly among 20 tokens at every step.

Symbols

NN
The number of tokens scored.
p(xi∣x<i)p(x_i \mid x_{<i})
The probability the model gave the true next token.
exp⁡\exp
Converts average log-loss back into a count of choices.
Esc
↑↓ navigate↵ open? shortcuts

Keyboard shortcuts

Press Esc to close

Anywhere

⌘K
Search and commands
/
Search
?
This sheet
Esc
Close

Reading a lesson

J
Next lesson
K
Previous lesson
B
Bookmark