Example

Example of Loss Calculation in Instruction Fine-Tuning

In instruction fine-tuning, the loss is computed exclusively on the target output, not the input context. For instance, if a model is given the input context <s> Square this number . 2 . and is trained to predict the output The result is 4 ., the training loss and subsequent backpropagation are calculated only for the tokens making up The result is 4 ..

0

1

Updated 2026-04-19

Contributors are:

Who are from:

Tags

Foundations of Large Language Models

Ch.2 Generative Models - Foundations of Large Language Models

Foundations of Large Language Models Course

Computing Sciences