Qwen 3.5 SFT data: fill the special tokens that wrap an assistant turn.
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
The two special tokens are <|im_start|> and <|im_end|>. Qwen uses the ChatML grammar: open with <|im_start|>assistant, content, close with <|im_end|>.
Picture a stage play script. Every spoken line has a clear opening cue, the actor's name with a colon, and a clear ending cue, a blank line before the next speaker. Without those cues the actors would never know when to stop talking. A chat-tuned model has the same problem. Each assistant turn starts with a small marker that tells the model a reply is beginning, and ends with another marker that tells it to stop. Forget the ending marker in the training data and the model never learns where its turn ends, so at run time it just keeps going. The two markers Qwen uses are short tags that the tokenizer treats as single special words.
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.
3 min: name the two tokens, sketch the ChatML grammar, explain the train versus inference flag distinction, then walk through the common labels-slicing bug that breaks stop behavior.
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.
Treating <|im_start|> or <|im_end|> as plain ASCII strings the tokenizer would split. They are single registered vocabulary entries; getting them wrong breaks stop behavior at inference.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.