BigBird

BigBird replaces full self-attention with a sparse graph that combines local, global, and random links, giving long-sequence Transformers a linear-cost attention route.

Metadata

FieldValue
PaperBig Bird: Transformers for Longer Sequences
AuthorsManzil Zaheer, Guru Guruganesh, Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, Amr Ahmed
Year2020
VenueNeurIPS 2020
arXiv2007.14062
ProceedingsNeurIPS paper
Codegoogle-research/bigbird
Statusfull note started

One-Line Takeaway

BigBird changes the attention graph:

The key object is the neighbor set for each query position:

Question

Dense self-attention computes every pairwise token interaction:

This gives:

For long documents, protein-like sequences, or genome-scale sequences, the quadratic term is the bottleneck. BigBird asks whether sparse attention can keep enough long-range connectivity to be useful.

Architecture Contract

ItemContract
Inputlong sequence of tokens
Main operatorblock sparse self-attention
Local routeeach block attends to nearby blocks
Global routeselected tokens or blocks attend broadly
Random routeeach block attends to selected random blocks
Complexity targetlinear in sequence length when sparse degree is fixed
Main paper useslong-document QA, summarization, classification, genomics examples
Main risksparse graph may not match the task’s needed interactions

BigBird is an attention-pattern paper. It changes the information-flow graph inside a Transformer while leaving the broad Transformer stack recognizable.

Sparse Attention Graph

Let token positions be vertices:

Dense attention uses a complete directed graph:

BigBird uses:

For each query , attention is computed only over its neighbor set:

Equivalently, use a sparse mask:

Then:

This keeps BigBird inside the same Attention equation while changing which interactions exist.

Three Sparse Routes

Local Attention

Local attention handles nearby structure:

This is useful for phrase-level, sentence-level, motif-level, or local sequence patterns.

Global Attention

Global tokens or blocks provide an aggregation path:

For a global token :

For ordinary tokens, global tokens can act as routing hubs:

This resembles the task-token route in Longformer, but BigBird uses it as one part of a broader sparse graph.

Random Attention

Random links create non-local shortcuts:

Local windows alone pass information slowly across a long sequence:

Random edges shorten communication paths:

Block Sparse View

Split a sequence into blocks:

Attention is defined between blocks:

If each block attends to a fixed number of other blocks, the number of attended pairs grows linearly with sequence length:

This assumes block size and sparse degree are controlled. If the number of global or random links grows with , the cost changes.

Relation to Longformer

PaperSparse PatternMain Difference
Longformerlocal sliding window plus task global tokensemphasizes long-document practicality and task-specific global tokens
BigBirdlocal plus global plus random sparse blocksadds random links and stronger theoretical expressivity claims

Both are sparse-attention routes. Neither is the same as Performer, which approximates softmax attention, or FlashAttention, which computes exact dense attention more efficiently.

Expressivity Claim

The paper’s unusual contribution is that it does not only report an efficient sparse pattern. It argues that BigBird preserves important theoretical properties of full Transformer attention under its sparse construction.

The high-level claim is:

This matters because sparse attention can otherwise look like a pure engineering compromise:

BigBird’s argument is that a carefully designed sparse graph can reduce cost while retaining enough connectivity for broad sequence modeling.

Evidence to Read

ClaimEvidence TypeWhat It SupportsCaveat
sparse attention reduces quadratic costcomplexity analysis and implementationlong sequences can be processed with fixed sparse degreewall-clock gains depend on sparse kernel quality
local/global/random pattern works empiricallyQA, summarization, classification experimentssparse graph can support long-document tasksimprovements can depend on input length and baseline truncation
global tokens matter theoreticallytheoretical analysisglobal routes help preserve expressivity propertiestheory assumptions are not the same as practical benchmark coverage
genomics can benefit from long contextsequence experimentsnon-text long sequences are plausible targetsbroad genomics stays out of this wiki unless tied to a concrete modeling problem

Implementation Reading

Check:

  • block size and maximum sequence length;
  • number of random blocks per query block;
  • which tokens or blocks are global;
  • whether random attention is fixed, seeded, or resampled;
  • whether the implementation materializes dense masks before sparse computation;
  • padding behavior at document or sequence boundaries;
  • whether comparison baselines use truncation, chunking, retrieval, Longformer, Performer, or dense attention at shorter length.

The practical failure mode is treating “linear attention” as a single category. BigBird is sparse exact attention over selected positions, not kernelized softmax attention and not an IO-aware dense attention kernel.

Relation to Other Architecture Notes

PaperRelation
Attention Is All You Needdense Transformer baseline
Longformerclosest local/global sparse-attention neighbor
Reformerapproximate similarity buckets through LSH attention plus reversible layers
Transformer-XLlong context through segment recurrence rather than sparse attention
Linformerlong context through low-rank key/value sequence projection
Performerlinear attention through kernel feature approximation
FlashAttentionexact dense attention with IO-aware implementation
ALiBilength extrapolation by attention bias rather than sparse graph design

Limitations

  • Sparse graph design is a modeling assumption; missed edges can matter.
  • Random links make implementation and reproducibility details more important.
  • Linear asymptotic cost does not remove embedding, FFN, activation, or optimizer memory.
  • Strong theoretical statements do not automatically prove better task performance.
  • Long-context gains can be inflated if baselines are mostly truncation-limited.

Common Misreadings

MisreadingCorrection
”BigBird is just Longformer with a bigger window.”BigBird adds random sparse links and emphasizes theoretical properties.
”Linear attention always means the same method.”BigBird is sparse attention; Performer is kernelized attention; FlashAttention is exact dense attention.
”Random attention means unstructured noise.”The random links are a sparse graph design for non-local connectivity.
”The model fully reads all token pairs.”Only selected local, global, and random pairs are attended.

What to Remember

BigBird is the canonical paper for sparse attention as a graph-design problem:

Keep it next to Longformer when reading long-context sparse attention, and separate it from approximate attention, positional extrapolation, and kernel-level acceleration.