You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to confirm if unsloth implicitly calculates the label loss, i.e., it masks out the instruction and the input when you train, say LLaMA, for a completion task.
Formally, I want to implement the following objective function:
Here:
$$s_i$$ represents the source instance (instruction + input) from the dataset.
I am assuming that train_on_responses_only should take care of my requirement based on the documentation but wanted to confirm if it will, say, assign -100 to instruction and input and will only send logits corresponding to target tokens for loss calculation. In addition, how can we mask PAD_TOKENS from loss calculation?
If not, how one can go about implementing it ourselves?
The text was updated successfully, but these errors were encountered:
Hi,
Thank you for availing the awesome library.
I wanted to confirm if unsloth implicitly calculates the label loss, i.e., it masks out the instruction and the input when you train, say LLaMA, for a completion task.
Formally, I want to implement the following objective function:
Here:
Here is my current code:
I am assuming that
train_on_responses_only
should take care of my requirement based on the documentation but wanted to confirm if it will, say, assign -100 to instruction and input and will only send logits corresponding to target tokens for loss calculation. In addition, how can we mask PAD_TOKENS from loss calculation?If not, how one can go about implementing it ourselves?
The text was updated successfully, but these errors were encountered: