Skip to main content

Review — Sequence likelihood

Back to the lesson · Learning path plan

What to remember

  • Each observed token receives the probability the model assigns given its preceding prefix.
  • The product gives the likelihood of the continuation under the chosen model and prefix. The log of that product is the sum of the log probabilities.
  • Negative log-likelihood (NLL) sums the penalties for observed tokens. For different lengths, specify whether the comparison uses a sum or an average.
  • For a fixed observed sequence, maximizing its log-likelihood over parameters is equivalent to minimizing its NLL, which is the negative of the log-likelihood.

Recall from memory

A two-token continuation receives probabilities 0.5 and 0.2 in sequence. What is its likelihood?

Show the answer

0.5 × 0.2 = 0.1. Its natural log-likelihood is about −2.303 and its NLL is about 2.303 nats.

Choose the prefix that gives the probability of the second observed token.

Language · Français · English