Use DataCollatorForCompletionOnlyLM in order to train LLM to follow instructions · Issue #845 · huggingface/course · GitHub
More Web Proxy on the site http://driver.im/
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
In Chapter 11 of the course, in the file FineTuning with SFTTrainer (3.mdx), you explain how to fine-tune a DeepSeek model with SFTTrainer on an instruction dataset.
Why don't you use the DataCollatorForCompletionOnlyLM data collator in the SFTTrainer to avoid computing gradients and back-propagating on the user question tokens? The default data collator in the SFTTrainer is DataCollatorForLanguageModeling, which means that in your example the LLM will also learn to complete the user query, which is not intended as far as I understand.
The text was updated successfully, but these errors were encountered:
In Chapter 11 of the course, in the file FineTuning with SFTTrainer (
3.mdx
), you explain how to fine-tune a DeepSeek model withSFTTrainer
on an instruction dataset.Why don't you use the
DataCollatorForCompletionOnlyLM
data collator in theSFTTrainer
to avoid computing gradients and back-propagating on the user question tokens? The default data collator in theSFTTrainer
isDataCollatorForLanguageModeling
, which means that in your example the LLM will also learn to complete the user query, which is not intended as far as I understand.The text was updated successfully, but these errors were encountered: