P(w1…wT)=∏tP(wt∣w<t)P(w_1 \dots w_T) = \prod_t P(w_t \mid w_{<t})

Chain rule of probability

The probability of a whole sentence equals the probability of each word given the words before it, all multiplied together.

This is exact, not an approximation. It is the chain rule of probability applied from left to right. Its consequence shapes the whole architecture: a model that can predict one next token can score or generate text of any length by repeating that step. A model that works this way is called autoregressive.

Example

P(the cat)=P(the)×P(cat∣the)P(\text{the cat}) = P(\text{the}) \times P(\text{cat} \mid \text{the})

Two words, two factors. A sentence of T words has T factors.

Where the course uses it

Related terms