Find the bug: a Llama deployment serves traffic without prepending the BOS token.
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Click any words you think contain an error. Click again to unmark.
BOS acts as the learned attention sink. Drop it and the first real token inherits the sink role, distorting its hidden state and degrading the opening tokens of generation.
Imagine a sports team where one player is designated to catch every ball nobody else can field. Lose that player and someone else has to do their job on top of their own. The replacement player tries to play their normal position and catch random balls at the same time, doing both badly. The first token of every prompt (called BOS) is that designated catcher for the model. The system always has to put its leftover focus somewhere, and during training it learns to dump it on BOS because that slot carries no real content to protect. Skip BOS at runtime and the first real word of your prompt has to play two positions at once. Quality drops, especially on the first few words the model writes back.
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.
6-8 min: softmax sum-to-1 invariant + attention sink phenomenon + BOS as learned sink + what happens when BOS is missing + symptoms in production + fix + connection to StreamingLLM.
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 BOS as a no-op marker. It is a learned attention sink whose absence forces the first real token to absorb softmax's leftover weight, degrading the opening of generation.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.