Perplexity

Creator
Creator
Seonglae Cho
Created
Created
2023 Mar 28 11:55
Editor
Edited
Edited
2025 Mar 13 16:17
Refs
Refs

PPL

Important metric for language modeling is validation perplexity, which is a representative of upstream quality. However, since it does not guarantee the performance of the downstream task, it should be checked separately. In other words, a low PPL value means high probability on data, but it does not necessarily mean a good language model.
Perplexity is defined as the exponentiated average negative log-likelihood of a sequence. If we have a tokenized sequence XX.
PPL(X)=exp{1titlogpθ(xix<i)}PPL(X) = exp\{-\frac{1}{t}\sum_i^t log p_\theta (x_i|x_{<i})\}
Calculating Perplexity for predetermined input text is more common. When measuring the context length limit to determine how much tolerance a model has for context length, it is assessed during generation.

Property

  • When perplexity is high, the model tends to have flat attention scores rather than focusing on specific tokens, while with low perplexity, it shows sharp attention patterns focused on relevant tokens
Perplexity Notion
notion image
 
 
 
 
 
 
 

Recommendations