Nothing in the math changes — still predict the next token. Only the target changes: the words to predict are now a good answer to an instruction.
the same prompt — chapter 1
keep training on (instruction → good response) pairs
press instruction-tune — watch the same objective run on better targets
the fields become an instruction; the label becomes the good response — just another training pair.
A base model only knows how to continue whatever text it sees, so the prompt’s surface form leaks into the output. Keep training it on many (instruction → response) pairs — same loss, same gradient nudge, the target is now a good answer — and it learns to follow instructions in general, not memorize these tasks.