How a chat reaches the model
For both
Roles, system prompts and chat templates turn a conversation into one token stream that a stateless model reads fresh every turn
110 questions across four stages: Understand, Apply, Solve and Judge.
Try 5 questions
Practice items, not counted towards your mastery. No account needed.
Check yourself · 1 of 5
What does a chat template do before the model sees a conversation?
Check yourself · 2 of 5
Why does a brand new chat not know what you discussed yesterday?
Check yourself · 3 of 5
Why can the same model act very differently in two apps?
Check yourself · 4 of 5
What is indirect prompt injection?
Check yourself · 5 of 5
Which role holds a web search result that the model asked an app to fetch?
Topics
- Roles and chat templates3 min read · System, user, assistant and tool messages are joined with special tokens into one sequence the model reads
- Models remember nothing between calls3 min read · Every turn resends the whole history; memory features and projects work by re-inserting saved text
- System prompts and instruction priority3 min read · Hidden app system prompts and the instruction hierarchy explain why one model behaves differently in two apps
- Pasted text the model may obey3 min read · Web pages, emails and tool results are just more tokens, so instructions hidden in them can be followed
Start here
- Chat templates (Hugging Face Transformers docs) (opens in a new tab)DocsFree
Shows how a list of role-tagged messages is rendered into the single text a model reads, with special tokens.
- Working with messages (Claude docs) (opens in a new tab)DocsFree
Shows that each API call carries the full conversation and that the API keeps no state for you.
- System prompts release notes (Claude docs) (opens in a new tab)DocsFree
Anthropic publishes the real system prompts used in its apps, so you can read what a hidden prompt looks like.
Helps to know first
110 questions · last verified 2026-12