Chat Template
A formatting framework used during large language model inference to organize conversational structure. It defines how system prompts, user messages, and assistant replies are concatenated, including the specific special tokens and role labels employed. Different model families adopt different conventions, and the choice of chat template meaningfully affects model behavior and output style.
Timeline (last 90 days)
Chat templates are the rule layer by which inference frameworks convert multi-turn conversations, system prompts, and tool call sequences into model input tokens, usually distributed as Jinja2 templates together with the model weights.
The same prompt string does not equal the prompt the model actually sees, because chat templates inject system text and some SDKs add defaults.
The chat template is responsible for clearly marking who is speaking, where turns end, and who continues next; it is not the same thing as a prompt.
Applications typically apply the chat template automatically, and manually pasting an extra layer of special tokens can easily cause duplication or mismatches, creating role-confusion issues.
Using the officially recommended chat template that is consistent with training and maintaining template consistency across fine-tuning experiments is a prerequisite for ensuring reliable results.
The self-referential terms used by large language models (such as 'as a language model') change as the chat template is switched.
When the framework's default template is inconsistent with the format used during model training, model behavior drifts, including self-referential terms, refusal thresholds, response verbosity, and the way multi-turn conversational context is understood.
If chat templates are not unified in model comparison tests, the personality or style differences measured may stem from template differences rather than the models themselves.
blackfrost embeds a 1,457-character jailbreak prompt in the chat template, injecting hidden instructions into every user input, but this information is not disclosed in the README.
All Facts (8)
Chat templates are the rule layer by which inference frameworks convert multi-turn conversations, system prompts, and tool call sequences into model input tokens, usually distributed as Jinja2 templates together with the model weights.
50%UnverifiedThe same prompt string does not equal the prompt the model actually sees, because chat templates inject system text and some SDKs add defaults.
50%UnverifiedThe chat template is responsible for clearly marking who is speaking, where turns end, and who continues next; it is not the same thing as a prompt.
50%UnverifiedApplications typically apply the chat template automatically, and manually pasting an extra layer of special tokens can easily cause duplication or mismatches, creating role-confusion issues.
50%UnverifiedThe self-referential terms used by large language models (such as 'as a language model') change as the chat template is switched.
50%UnverifiedWhen the framework's default template is inconsistent with the format used during model training, model behavior drifts, including self-referential terms, refusal thresholds, response verbosity, and the way multi-turn conversational context is understood.
50%UnverifiedIf chat templates are not unified in model comparison tests, the personality or style differences measured may stem from template differences rather than the models themselves.
50%UnverifiedUsing the officially recommended chat template that is consistent with training and maintaining template consistency across fine-tuning experiments is a prerequisite for ensuring reliable results.
50%