AI engineering glossary · LLM training alignment
What is chat template?
Chat template: The exact text format that wraps system, user and assistant messages with special role tokens before they are fed to a chat model. Training and inference must use the same template, otherwise the model sees an unfamiliar format and quality drops.
Chat template: an example
A template may render a conversation as '<|user|> Hi <|end|> <|assistant|>', and the model continues after the assistant marker.
Related terms
More LLM training alignment terms
- Chinchilla scaling
- Chosen and rejected responses
- Clipped surrogate objective
- Common Crawl
- Compute-optimal training
- Constitutional AI
- Continued pretraining
- Critical batch size
Where you learn it
Chat template is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.