EasyDeepLearn

How do Longformer / BigBird combine sparse and global attention?

hard

Answer

  • Combine local sliding-window attention (each token sees a window of size w) with a handful of 'global' tokens (e.g., [CLS], question tokens in QA) that attend to every position and are attended by every position.
  • BigBird adds a random-attention pattern for provably close approximation of full attention.
  • Enables 4k-16k context on hardware where full attention would OOM.
Check yourself — multiple choice
  • Only local windows
  • Local windows + a few global tokens (+ random in BigBird) → linear-ish scaling, provably close to full attention
  • Removes attention
  • Same as MoE

Longformer/BigBird: local + global (+ random) attention → long-context scaling.

#attention#efficient-attention#transformers

Practise Deep Learning

214 interview questions in this topic.

Related questions