Skip to content
View original post on X: Dongxi NLP
Published

Instruction tuning keeps next-token loss and masks non-target tokens

AIDongxi NLP says instruction tuning (SFT) uses the same objective as pretraining, predicting the next token with cross-entropy loss. The post says each data pair is converted to a chat-template token sequence, with a loss mask marking which tokens contribute to the loss.
Dongxi NLPVerified on X
@dongxi_nlp
View on X

Instruction Tuning 或者 SFT 沿用预训练的训练目标:

在每个位置预测下一个 token,用 cross-entropy loss 衡量预测和正确 token 之间的差距,通过训练提高正确 token 的概率。

其中,用模型的 chat template 把每对数据转换成对话格式的 token 序列,然后用 loss mask( 标出需要计算损失的 token,是 recipe 中重要的部分。

来看后训练系列第二篇,Instruction Tuning

Dongxi 东锡 NLP@dongxi_nlp
https://x.com/i/article/2113363792482480128
View quoted post on X
Source details

Dongxi NLP · x.comPublished · added here

Original title: Instruction Tuning 或者 SFT 沿用预训练的训练目标: