Spot the errors in this KV-eviction strategy for long-running generation
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.
Naive sliding-window eviction drops the first tokens, which are attention sinks, so quality collapses. StreamingLLM fixes it by pinning a few sink tokens plus the recent window.
Imagine a long meeting where everyone keeps glancing at the chairperson before they speak, almost out of habit, even when the chair is not the topic. That quick glance steadies them. Now imagine the chair quietly leaves. Suddenly everyone's instinct misfires, glances land on random people, and the conversation falls apart. A transformer behaves the same way. The very first tokens act like that chairperson: the model learned to dump leftover attention onto them so the math stays balanced. If you evict those first tokens to save memory, the balance breaks and the output turns to garbage. The fix is simple. Keep the first few tokens forever, slide a window over the rest, and the meeting keeps running smoothly.
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: softmax must sum to one creating sinks on early tokens, why naive eviction collapses abruptly, the StreamingLLM pin sinks plus window fix, and the streaming vs context extension distinction.
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.
Assuming attention concentrates on recent tokens, so the oldest KV is safe to drop. The first few tokens are sinks, and evicting them collapses quality abruptly.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.