Before you can read the parent note, you need to be fluent in a small pile of symbols and pictures. This page builds every single one of them from zero, in the order they depend on each other. Nothing here assumes you have seen probability, logarithms, or subscripts before.
Think of a sentence being chopped into LEGO bricks. "Add 2 and 3" might become the bricks Add, 2, and, 3. Each brick is a token.
Why do we need this idea? Because every later symbol (xt, the product, the loss) is defined per token. If you don't picture the sentence as a row of numbered bricks, none of the subscripts will mean anything.
t is short for "time step" — it moves left to right like a clock ticking once per brick. So x1 is the first brick, x2 the second, and xT the last (we use a capitalT for the total number of tokens in the sequence — the final tick).
Order matters here — "dog bites man" and "man bites dog" are the same bricks in a different order and mean opposite things, so x<t is a sequence, never a shuffled pile. Picture a cursor blinking between two bricks. Everything to the left of the cursor, read in order, is x<t; the very next brick you are about to guess is xt.
Why the topic needs it: the whole job of a language model is "guess xtgivenx<t." That phrase — the next brick given all previous bricks in order — is the seed of every formula on the parent page.
Picture the model as a weather forecaster. It doesn't say "the next word IS the." It says "given everything so far, the has a 0.4 chance, a has 0.2, cheese has 0.001…" — a whole spread of guesses summing to 1.
The parameters θ (Greek "theta") are just all the tunable knobs inside the model — the billions of numbers that decide those probabilities. Writing pθ reminds us "this forecast depends on the current knob settings." Training = turning the θ knobs.
We need both: ∏ builds the probability of a whole sentence (multiply the guesses), and ∑ builds the loss (add up the surprises). Introducing them together now means no summation symbol will surprise you later.
The parent writes the sentence probability with ∏:
pθ(x1,…,xT)=∏t=1Tpθ(xt∣x<t).
Read it in plain words: "the chance of the whole sentence = (chance of brick 1) × (chance of brick 2 given brick 1) × (chance of brick 3 given bricks 1–2) × …". You build the sentence one guess at a time and multiply the guesses.
We said logp is always ≤0. If the model is confident and correct, p≈1 and logp≈0 — tiny loss. If it's confident and wrong, p≈0 and logp→−∞ — huge loss.
We want a number that is big when wrong, small when right, so we flip the sign. First the raw quantity, the total negative log-likelihood (NLL) — literally the summed surprise over every token:
a sum: add up the surprise at each tokenLtotal(θ)=−t=1∑Tlogpθ(xt∣x<t).
This total grows just because the sentence is long, which makes long and short examples hard to compare. So we usually report the average NLL — divide by the number of tokens counted:
Lavg(θ)=−T1∑t=1Tlogpθ(xt∣x<t).
Now the one idea that makes instruction tuning different from plain pretraining.
Picture a highlighter running over only the answer half of each example. Highlighted = graded. Un-highlighted = ignored.
The parent's boxed formula is now fully readable — it is the average NLL from Section 7, but averaged over only the highlighted tokens:
L(θ)=−∑tmt1∑tmtlogpθ(xt∣x<t).
mt⋅logpθ(…) — multiplying by 0 deletes prompt tokens from the sum; multiplying by 1 keeps response tokens.
∑tmt — just counts how many tokens got highlighted (how many response tokens). Dividing by it gives the average surprise per answer-token, so a long prompt can't drown out a short answer.
Everything on the left is a prerequisite for the parent topic, which lives at node I. The base guessing machine (nodes A–F) is exactly the Pretraining Objective (Next-token prediction); the mask (node H) is what turns that pretraining loss into instruction tuning.