Skip to content

documentation for modifying chat templates for assistant-only loss#4937

Open
jiosephlee wants to merge 2 commits intohuggingface:mainfrom
jiosephlee:chat_template_docs
Open

documentation for modifying chat templates for assistant-only loss#4937
jiosephlee wants to merge 2 commits intohuggingface:mainfrom
jiosephlee:chat_template_docs

Conversation

@jiosephlee
Copy link

@jiosephlee jiosephlee commented Jan 30, 2026

What does this PR do?

While this issue is not super prevalent (most datasets are single-turn interactions and can be addressed with completion-only fine-tuning), some users want to fine-tune on multi-turn interactions or responses with tool-calling.

To my knowledge, this issue can be easily addressed with a proper chat template that adds {% generation %} when appropriate, including executed tool responses, so that the tokenizer returns the masks automatically. If the chat template doesn't do this, there is an ongoing PR to automatically address the issue with chat templates (#4900), but this doesn't scale well imo.

An easy solution would be to provide sufficient documentation so users can edit chat templates themselves!

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

Successfully merging this pull request may close these issues.

1 participant

Comments