BigBird is a sparse attention mechanism that computes only the cells of the attention matrix selected by three components: a window, global tokens, and random positions. Zaheer et al. at Google Research proposed it in 2020 in the paper "Big Bird: Transformers for Longer Sequences," presented at NeurIPS 2020.
Models such as BERT use standard multi-head attention, so memory grows with the square of the sequence length , and inputs were limited to around 512 tokens. BigBird restricts what each token attends to to the following three kinds.
- Window: the nearby tokens, on each side
- Global tokens: tokens (such as
[CLS]) that attend to all tokens and are attended to by all tokens - Random: tokens chosen at random for each token
Because the number of tokens attended to is a constant independent of , the complexity is . In the paper, this made it possible to handle sequences about 8 times longer than before on similar hardware.
What sets BigBird apart is that the pattern of attended positions was chosen from graph theory and backed by theory. If attention is viewed as a graph of "which token attends to which token," random connections have the property that any two nodes can be joined by a short path even with few edges. It is like a word-of-mouth contact network: on top of connections between neighbors, just a few connections to distant acquaintances let a message reach anyone through a handful of people (the so-called "small world").
The right side of the figure at the top of the article shows the computed positions. Overlaying the three components on the left gives the shape of BigBird.

