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
The colabs/CLI script does not train models on conversation, I.E. given a prompt, train only on response.
Instead, the current code trains the model on the prompt as well. This leads to some problems in certain FT cases (e.g. RAFT)
There is a note in the colab: [NOTE] To train only on completions (ignoring the user's input) read TRL's docs here.
But I think that training on completions only is the more helpful option for most people, and should be the default.
EDIT: Just saw the train_on_responses_only feature. May I ask why not use TRL's DataCollator as per the TRL docs? instead of rewriting the masking code?
changed the title [-]Script/Colab not training on conversation, ambiguous wording [/-][+]Script/Colab not training on conversation, CompletionsOnly script[/+]on Aug 3, 2024
Only assistant spans get unmasked, multi turn is handled with one span per assistant turn, and the instruction / response markers auto detect from the chat template now so you don't have to pass them. We decided against making it the default, hope that's ok!
Please update Unsloth: uv pip install --upgrade unsloth unsloth_zoo --force-reinstall --no-cache-dir (if it's not in the current release yet it'll be in the next one). Reopen if it still happens!
Activity
[-]Script/Colab NOT training on conversation[/-][+]Script/Colab not training on conversation, ambiguous wording [/+][-]Script/Colab not training on conversation, ambiguous wording [/-][+]Script/Colab not training on conversation, CompletionsOnly script[/+][-]Script/Colab not training on conversation, CompletionsOnly script[/-][+]On train_on_responses_only[/+]Oseltamivir commentedon Aug 3, 2024
After poking and playing with _train_on_responses_only, it seems like it
I'm not sure why the instruction IDs are even required, shouldnt everything up to the last token of response ID be masked? thats what TRL does.
danielhanchen commentedon Aug 4, 2024
TRL's Data Collator does not work on multiple conversations, and only works on 1 conversation.
Oseltamivir commentedon Aug 6, 2024
Ok, I'll try to see how I can add on to the current code.
danielhanchen commentedon Sep 6, 2026
Only assistant spans get unmasked, multi turn is handled with one span per assistant turn, and the instruction / response markers auto detect from the chat template now so you don't have to pass them. We decided against making it the default, hope that's ok!
Please update Unsloth:
uv pip install --upgrade unsloth unsloth_zoo --force-reinstall --no-cache-dir(if it's not in the current release yet it'll be in the next one). Reopen if it still happens!