What's the structural limitation of pure sliding window attention, and how does BigBird address it?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Sliding window attention is local-only; long range info crawls layer by layer. BigBird adds global tokens so any pair is reachable in two hops.
Picture a long line of people passing notes, where each person can only talk to their immediate neighbors. A note from one end takes many small steps to reach the other end, and it can get garbled along the way. BigBird gives a few people in the line megaphones. Anyone in the line can shout to a megaphone holder, and that megaphone holder can shout back to anyone. Now a message from any position can reach any other in one quick step through a megaphone. You still keep the local chatter, which is cheap, and you also get the broadcast capability for the important stuff.
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.
Explain sliding window's O(n·W) complexity and the multi-hop propagation limitation, walk through BigBird's three components (local + global + random) with the expressivity theorem, distinguish from Longformer, mention Mistral 7B's pure sliding window design, and discuss why dense attention + FlashAttention has largely replaced sparse designs for modern long context LLMs.
| Pattern | Complexity | Long range flow | Examples |
|---|---|---|---|
| Full attention | O(n²) | Direct any to any | Standard transformer |
| Sliding window only | O(n·W) | Multi-hop through layers (lossy) | Mistral 7B |
| Local + global (Longformer) | O(n·W + n·G) | 2-hop via global tokens | Longformer |
| Local + global + random (BigBird) | O(n·(W+G+R)) | 2-hop via global, more connectivity | BigBird |
| Dilated (LongNet) | O(n log n) | Multi-scale dilation | LongNet |
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 sliding window as a drop in efficient replacement for full attention. It is, until you need long range dependencies, and then the multi-hop information path through intermediate tokens becomes the new bottleneck.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.