Talking to a Model
Who said what, and whose rules come first
Scroll
Who said what, and whose rules come first
A chat model does not receive one block of text. It receives a list of messages, each labeled with a role: a system message first, then alternating user and assistant turns.
The system message comes from whoever built the application and holds standing instructions: what the assistant is for, its tone, what it must not do. User messages are what people type. Assistant messages are the model's own earlier replies, sent back so it can see the conversation so far. In most setups the model keeps nothing between calls, and the application resends the whole list every turn. That is why long chats get slower and cost more.
Models are trained to give the system message more weight than the user's, which is how an app keeps an assistant on task. It is still only text in the same sequence, though. A user, or a document pasted into the chat, can sometimes talk the model out of it, so anything that must never happen needs a check outside the model. The page on prompt injection covers how that goes wrong.
Generation