Chapter 11

Information Theory

Entropy, cross-entropy, KL divergence, mutual information, perplexity, and compression as prediction.

What this chapter does

Information theory connects probability to surprise and coding cost. This chapter explains entropy, cross-entropy, KL divergence, mutual information, perplexity, and why language-model training can be read as repeated prediction under uncertainty.

Lessons

Read these in order.

Start with the chapter introduction, then move through the topic lessons. The order is chosen so each page can reuse ideas from the pages before it.

  1. 01
    Introduction

    Why information theory is the mathematics of surprise.

  2. 02
    Entropy

    Average uncertainty in a probability distribution.

  3. 03
    Joint and Conditional Entropy

    Uncertainty together and uncertainty after context is known.

  4. 04
    Cross-Entropy

    The cost of encoding targets with predicted probabilities.

  5. 05
    KL Divergence

    Directional mismatch between probability distributions.

  6. 06
    Mutual Information

    How much knowing one variable reduces uncertainty about another.

  7. 07
    Negative Log-Likelihood

    Turning probability assigned to observed data into a loss.

  8. 08
    Perplexity

    A language-model metric that behaves like average choice count.

  9. 09
    Compression as Prediction

    Why better prediction usually means shorter descriptions.

  10. 10
    Classification and Language Modeling

    How cross-entropy appears in classes and next-token prediction.

Before moving on

  • Understand entropy, cross-entropy, KL divergence, and perplexity.
  • Connect prediction, surprise, compression, and loss.
  • Explain why cross-entropy is more informative than accuracy for probability predictions.
  • Read classification and language-modeling objectives with less mystery.

Where this leads

  • Language Modeling
  • Transformers

Chapter progress