Roles in a chat training example: pick the three that are standard.
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
The three core chat roles are system (behaviour), user (human turn), and assistant (model turn). Tool and function are optional extensions for tool calling.
Picture a script for a small play. The director has stage directions at the top describing how the actors should behave throughout the scene. The audience member speaks lines aloud. The actor on stage responds. Three speaking parts, each with its own role label. In a chat training example the director is the system message, the audience member is the user, and the actor is the assistant. The model is being trained to play one specific role, the actor, and to take direction from the system message while responding to the user. Some plays add a stagehand who reports results from off-stage; that is the optional tool role. The core trio always shows up.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
5 min: the three roles + the system / user / assistant trio + loss masking on assistant only + tool as the optional fourth role + chat templates + the Alpaca vs role-schema confusion.
| Role | Who it represents | Loss applied? |
|---|---|---|
| system | Behavioural setup / persona | No, conditioned on |
| user | Human turn | No, conditioned on |
| assistant | Model turn | Yes |
| tool (optional) | External tool output | Usually no |
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Confusing roles with dataset record field names. Alpaca-style instruction/input/output and old GPT-3 prompt/completion are flat record schemas, not message-role labels.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.