Dongxi NLP explains Instruction Tuning and SFT training objectives
English text is being prepared.
In "Post-Training Series Part 2", Dongxi NLP explains Instruction Tuning: SFT follows the pretraining training objective, i.e., predicting the next token at each position, using cross-entropy loss to measure the gap between the prediction and the correct token, and increasing the probability of the correct token. On the data side, the model's chat template is used to convert each pair of data into a token sequence in dialogue format, and then a loss mask is used to mark the tokens for which loss needs to be computed; this is an important part of the recipe.
View original posthttps://t.co/Y3AP0ziejN
View original
https://t.co/Y3AP0ziejN
Body
Instruction Tuning 或者 SFT 沿用预训练的训练目标:
在每个位置预测下一个 token,用 cross-entropy loss 衡量预测和正确 token 之间的差距,通过训练提高正确 token 的概率。
其中,用模型的 chat template 把每对数据转换成对话格式的 token 序列,然后用 loss mask( 标出需要计算损失的 token,是 recipe 中重要的部分。
来看后训练系列第二篇,Instruction Tuning