Skip to content

Is that correct to do sft without labels, course they mask the prompt sentence like <im_start><im_end> #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lixiangisdemon opened this issue Mar 2, 2025 · 1 comment

Comments

@lixiangisdemon
Copy link

Hello! I truly appreciate the blogs you've posted about LLMs. I've gained a great deal from them. I have a question to ask you. When reading the blog "2024 - 07 - 29_Finetune_Llama31.html", I noticed that when you processed the dataset, you only converted the data into the chat_template format, but there was no process of processing labels. In this case, will the LLM model also learn sentences like <im_start>..<im_end>? And will it reduce the learning accuracy?

@mlabonne
Copy link
Owner

mlabonne commented Mar 2, 2025

Hey, thanks! Yes, you want the model to learn the chat template, that's one of the main goals of SFT. The SFTTrainer handles these special tokens appropriately with the dataset_text_field parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants