BigBird › Key Parameters

Michael BrenndoerferUpdated June 24, 20252 min read
Language AI HandbookAll chapters
Part 17 of 67Efficient Attention
Chapter 122BigBird › Key Parameters
Reading section 11 of 12 · Key Parameters · 2 minSection 11 of 12 · 2 min

Book contents

Section 11 of 12 · 2 min read

BigBird › Key ParametersOne section · Sections in this chapter11 / 12 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

When configuring BigBird attention, several parameters control the trade-off between efficiency and model expressiveness:

  • window_size: The one-sided sliding window size, determining how many neighbors each token attends to on each side. Larger windows capture more local context but increase computation. Typical values range from 64 to 256. For most NLP tasks, 128 provides a good balance.

  • num_global: The number of global tokens that attend to and are attended by all other tokens. These serve as information hubs for long-range communication. Common choices are 2-8 tokens. Using the [CLS] token plus sentence-start markers is a practical approach.

  • num_random: The number of random attention connections per non-global token. BigBird's theoretical guarantees depend on this parameter. Values of 3-5 are typically sufficient to achieve logarithmic graph diameter. Increasing beyond 5 has diminishing returns.

  • block_size: In optimized implementations, attention is computed in blocks for efficiency. Common values are 64 or 128. This should divide evenly into your sequence length.

  • attention_type: BigBird supports two modes: "original_full" computes full attention for short sequences (faster when n<1024n < 1024), while "block_sparse" uses the sparse pattern. Most libraries automatically select based on sequence length.

The interplay between these parameters determines the effective receptive field and computational cost. For a sequence of length nn with window size ww, gg global tokens, and rr random connections, the total attention operations scale as O(n⋅(2w+g+r))O(n \cdot (2w + g + r)), which remains linear as long as these hyperparameters are constants.