Short version
The “angle‑bracket” tags—, , , etc.—are just special tokens added to the model’s vocabulary during the instruction‑tuning / RLHF stage so the model can tell who is talking and what is expected next. They act like traffic signs in the prompt:
code
<system> = global rules ("You are ChatGPT…")
<user> = the human’s turn
<assistant> = the model’s turn (predict tokens after this)
Because these tags were present in the data the model was fine‑tuned on, it has learned to ❶ keep the dialogue structure intact, ❷ follow the “system” instruction, and ❸ stop talking when it sees again.
Deeper dive
Where in the training pipeline?
• Base pre‑training (hundreds of billions of tokens) is usually raw text with no such tags.
• Instruction‑tuning / SFT: humans (or scripts) wrap Q‑A pairs with these tags, and the model is further trained to predict the assistant’s part.
• RLHF: the same format is kept so reward models and policy‑gradient steps know which chunk is “assistant output” vs. “user prompt.”
Why not just rely on newlines?
• Ambiguity: a newline could be inside a poem, code block, e‑mail header, etc.
• Unbounded turns: With explicit tags the model can handle arbitrarily long multi‑turn chats without losing track of who said what.
• Controllability: The framework can inject different roles (, , …) or system messages without changing tokenization logic.
Implementation details
• Each tag is added as a single “special token” in the tokenizer so it never gets split into subtokens.
• During inference the serving stack sees a UI message → wraps it → feeds to the model. When the model generates, you throw away everything until it outputs the next “role tag” or the end‑of‑text token.
• If you omit the tags in a raw prompt the model still works (because it was also exposed to plain text during pre‑training) but you lose the safety rails and may get broken formatting.
Browsers ignore plain whitespace but respect the tags; likewise the LLM ignores random newlines but respects the special tokens.
Bottom line
Yes—those separator tokens are introduced in the post‑training (instruction/RLHF) phase. They give the model an unambiguous, learnable protocol for:
• state management (who is speaking)
• following system policies
• stopping and starting at the right place
…and that’s why every serious chat LLM (GPT‑3.5/4, Claude, Llama 2‑Chat, etc.) has them under the hood.