Perplexity › Perplexity

Michael BrenndoerferMarch 26, 20251 min read
Language AI HandbookAll chapters
Part 2 of 67Classical Text Representations
Chapter 10Perplexity › Perplexity
Reading section 1 of 17 · Perplexity · 1 minSection 1 of 17 · 1 min

Book contents

Section 1 of 17 · 1 min read

Perplexity › PerplexityOne section · Sections in this chapter1 / 17 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

You've built an n-gram language model and applied smoothing techniques. Now comes the critical question: how good is your model? Perplexity provides the answer. It's the standard metric for evaluating language models, used everywhere from academic papers to production systems. Understanding perplexity shows how to measure model quality and what it means for a model to "understand" language.

This chapter develops perplexity from first principles. We'll derive it from information theory, connect it to intuitive concepts like the "branching factor," implement it from scratch, and explore both its power and its limitations. Along the way, we'll see why perplexity has remained the dominant language model evaluation metric for over four decades, why that staying power is justified, and where the metric falls short.