Prompt masking excludes prompt-token positions from the autoregressive training loss while retaining response-token positions. Instruction fine-tuning therefore optimizes the model to produce useful answers rather than to reproduce user queries, while preserving the same loss function used during pretraining. section 4.3
Multiturn training commonly applies one of two masking policies:
- Final-turn only: include only the final assistant response in the loss; mask earlier context, including earlier assistant turns. section 4.3
- User turns only: mask every user turn while training on every assistant response, including intermediate replies. section 4.3
- Unroll long conversations into shorter examples by predicting one assistant response while masking prior context and excluding future turns. section 4.3
Masked instruction sequence
For a sequence containing a user query followed by an assistant answer, mask the query positions and apply the loss only to the answer positions. In a multiturn example, final-turn masking trains only the last assistant reply, whereas user-turn masking trains every assistant reply. section 4.3
