Chat Template
Domain: LLM Concepts
π― Motivation
Different LLMs expect different formats for conversations (system/user/assistant turns). Chat templates structure the conversation correctly for each model.
π Concrete Example
ChatML format: <|im_start|>system\nYou are helpful<|im_end|>\n<|im_start|>user\nHi<|im_end|>. Each model has its own template. Using the wrong one confuses the model.
π Analogy
Different schools have different uniform formats - one school requires blazers, another requires polo shirts. You must dress according to the schoolβs template. Same content, different packaging.