Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion units/en/unit1/messages-and-special-tokens.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Up until now, we've discussed prompts as the sequence of tokens fed into the mod
</figcaption>
</figure>

This is where chat templates come in. They act as the **bridge between conversational messages (user and assistant turns) and the specific formatting requirements** of your chosen LLM. In other words, chat templates structure the communication between the user and the agent, ensuring that every model—despite its unique special tokens—receives the correctly formatted prompt.
This is where chat templates come in. They act as the **bridge between conversational messages (user and assistant turns) and the specific formatting requirements** of your chosen LLM. In other words, chat templates convert the conversation into a model-specific prompt, ensuring that every model—despite its unique special tokens—receives the input format it expects.

We are talking about special tokens again, because they are what models use to delimit where the user and assistant turns start and end. Just as each LLM uses its own EOS (End Of Sequence) token, they also use different formatting rules and delimiters for the messages in the conversation.

Expand Down
2 changes: 1 addition & 1 deletion units/zh-CN/unit1/messages-and-special-tokens.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</figcaption>
</figure>

这就是聊天模板的用武之地。它们充当**对话消息(用户和助手轮次)与所选 LLM 的特定格式要求之间的桥梁**。换句话说,聊天模板构建了用户与智能体之间的通信,确保每个模型——尽管有其独特的特殊 token——都能接收到正确格式化的提示
这就是聊天模板的用武之地。它们充当**对话消息(用户和助手轮次)与所选 LLM 的特定格式要求之间的桥梁**。换句话说,聊天模板会将对话转换为符合特定模型要求的提示,确保每个模型即使使用各自独有的特殊 token,也能接收到符合其预期格式的输入

我们再次谈到特殊 tokens (special tokens),因为它们是模型用来界定用户和助手轮次开始和结束的标记。正如每个 LLM 使用自己的 EOS(序列结束 token 一样,它们也对对话中的消息使用不同的格式规则和分隔符。

Expand Down