Skip to main content

Review — Predictive entropy

Back to the lesson · Learning path plan

What to remember

  • At fixed context, the model produces a distribution \(p\) over the vocabulary. Its entropy \(H(p)=-\sum_i p_i\log p_i\) is the average surprisal under that distribution.
  • On the same vocabulary, a uniform distribution has maximum entropy. A distribution concentrated on a single token has zero entropy.
  • For an observed token \(y\), surprisal is \(-\log p(y)\). The smaller the probability the model assigns to \(y\), the greater its surprisal.
  • The natural logarithm gives nats. The base-2 logarithm gives bits.

Recall from memory

Given the same context, two models assign probabilities to two tokens. The first assigns 90% and 10%, the second 50% and 50%. Which distribution has higher entropy? What is the second token’s surprisal under the first model if it is observed?

Show the answer

The uniform distribution has higher entropy, \(\log 2\approx 0.693\) nats. The second token has probability \(0.1\) under the first model, so its surprisal is \(-\log 0.1\approx 2.303\) nats.

Relate entropy to likelihood and loss

Language · Français · English