Fill in the SFT JSONL: the three required fields of a typical chat example.
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Top-level key is `messages` (an array). Each message has `role` (system/user/assistant) and `content` (the text). One JSON object per JSONL line.
Imagine a script for a short scene. Each line of the script names the speaker and then their dialogue. That is exactly what an SFT chat example looks like on disk, a list of small speaker and line entries. The whole list is wrapped under one heading called messages because a conversation is a sequence of messages. Each message inside carries two fields, who is talking (role) and what they are saying (content). The trainer reads through the script and uses the speaker labels to figure out which lines it should grade the model on, the assistant lines, and which lines are just context.
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 fields (messages, role, content) + JSONL one line per example + why no prompt/completion split + role tags drive masking + how loaders consume the shape + Anthropic vs OpenAI variants.
| Field | Position | Purpose |
|---|---|---|
| messages | Top-level key | Wraps the array of conversation turns |
| role | Inside each message | Identifies the speaker (system/user/assistant/tool) |
| content | Inside each message | The actual text of that turn |
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.
Trying to add a separate `prompt` and `completion` split next to the messages array. The trainer derives which spans to grade from the role tags; no extra split is needed.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.