Asked about Supervised fine-tuning, hands on
Why mask the loss on prompt tokens during supervised fine-tuning?
An answer that works
The goal is to learn how to respond. Including prompt tokens spends capacity learning to generate user messages and system prompts, and can shift the model's behaviour in unwanted ways. Masking focuses learning on the assistant's tokens.
Then they push further
Your fine-tuned model got better at the task and worse at everything else. Why?
Too much training, too high a learning rate or too narrow data caused forgetting. Use fewer epochs, a lower rate or LoRA, and mix in some general instruction data.
What gets marked up
Marked up for loss masking, chat templates, and evaluating both the target task and general ability.
Reading an answer is not being able to give one. The section that teaches this is Supervised fine-tuning, hands on, 5 hours of Alignment & RLHF.
Learn this properlyAlso asked about Alignment & RLHF