SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2007.14062 · 2020

Big Bird: Transformers for Longer Sequences

Manzil Zaheer, Li Yang, Chris Alberti, Joshua Ainslie, Guru Guruganesh, Avinava Dubey, Qifan Wang, Santiago Ontanon, Amr Ahmed, Anirudh Ravula, Philip Pham

arXiv · PDF · Open in the Atlas

Code that ran

10 of 15 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 8 failures of our instrument; 5 no recorded run), measured 2026-11-21; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2007.14062.json · badge: /api/ran/2007.14062.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
mim-solutions/bert_for_longer_texts community
Papers with Code archive
8 ran · 3 no recorded run
google-research/bigbird marked official in Papers with Code
Papers with Code archive
1 ran · 1 no recorded run
monologg/kobigbird community
Papers with Code archive
1 ran · 1 no recorded run
FunctionStatusWhere it lives
InconsistentSplittingParamsException Ran
ran on a synthesized input · constructed an object; no result was computed
mim-solutions/bert_for_longer_texts/belt_nlp/splitting.py
pointer only (licence: NOASSERTION) · get_code("e4b0ec678a1f3059")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, mim-solutions/bert_for_longer_texts (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

create_rand_mask_from_inputs Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
google-research/bigbird/bigbird/core/attention.py
code served (permissive licence) · get_code("44d0dd1eff48b3db")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned EagerTensor, ndim 5, dtype family float, shape (2, 3, 2, 4, 8) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tensorflow.compat.v2 as tf
import numpy as np

tf.enable_v2_behavior()

# Set up parameters
batch_size = 2
from_seq_length = 16
from_block_size = 4
to_seq_length = 16
to_block_size = 4
num_attention_heads = 3
num_rand_blocks = 2

# Calculate derived dimensions
num_windows = from_seq_length // from_block_size - 2  # 4 - 2 = 2
num_blocks_from = from_seq_length // from_block_size  # 4
num_blocks_to = to_seq_length // to_block_size  # 4

# Create from_blocked_mask: [batch_size, from_seq_length//from_block_size, from_block_size]
# Shape: [2, 4, 4]
from_blocked_mask = tf.constant(
    np.random.randn(batch_size, num_blocks_from, from_block_size).astype(np.float32)
)

# Create to_blocked_mask: [batch_size, to_seq_length//to_block_size, to_block_size]
# Shape: [2, 4, 4]
to_blocked_mask = tf.constant(
    np.random.randn(batch_size, num_blocks_to, to_block_size).astype(np.float32)
)

# Create rand_attn: [batch_size, num_attention_heads, from_seq_length//from_block_size-2, num_rand_blocks]
# Shape: [2, 3, 2, 2] - contains indices into to_blocked_mask blocks
rand_attn = tf.constant(
    np.random.randint(0, num_blocks_to, size=(batch_size, num_attention_heads, num_windows, num_rand_blocks)),
    dtype=tf.int32
)

ARGS = {
    "from_blocked_mask": from_blocked_mask,
    "to_blocked_mask": to_blocked_mask,
    "rand_attn": rand_attn,
    "num_attention_heads": num_attention_heads,
    "num_rand_blocks": num_rand_blocks,
    "from_seq_length": from_seq_length,
    "from_block_size": from_block_size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 5, dtype family float, shape (2, 3, 2, 4, 8) — shape (2, 3, 2, 4, 8) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
create_rand_mask_from_inputs Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
monologg/kobigbird/pretrain/kobigbird/attention.py
code served (permissive licence) · get_code("2c5945c3b5a80279")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned EagerTensor, ndim 5, dtype family float, shape (2, 3, 1, 4, 8) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tensorflow.compat.v2 as tf
import numpy as np

# Enable eager execution for TensorFlow 2
tf.enable_v2_behavior()

# Set seeds for reproducibility
tf.random.set_seed(0)
np.random.seed(0)

# Define parameters
batch_size = 2
num_attention_heads = 3
from_seq_length = 12
from_block_size = 4
num_rand_blocks = 2
to_seq_length = 12
to_block_size = 4

# Calculate derived dimensions
num_windows = from_seq_length // from_block_size - 2  # Should be 1 (12//4 - 2 = 1)

# Create from_blocked_mask: [batch_size, from_seq_length//from_block_size, from_block_size]
# Shape: [2, 3, 4]
from_blocked_mask = tf.constant(
    np.random.randint(0, 2, (batch_size, from_seq_length // from_block_size, from_block_size)),
    dtype=tf.float32
)

# Create to_blocked_mask: [batch_size, to_seq_length//to_block_size, to_block_size]
# Shape: [2, 3, 4]
to_blocked_mask = tf.constant(
    np.random.randint(0, 2, (batch_size, to_seq_length // to_block_size, to_block_size)),
    dtype=tf.float32
)

# Create rand_attn: [batch_size, num_attention_heads, from_seq_length//from_block_size-2, num_rand_blocks]
# Shape: [2, 3, 1, 2]
rand_attn = tf.constant(
    np.random.randint(0, to_seq_length // to_block_size, (batch_size, num_attention_heads, num_windows, num_rand_blocks)),
    dtype=tf.int32
)

ARGS = {
    "from_blocked_mask": from_blocked_mask,
    "to_blocked_mask": to_blocked_mask,
    "rand_attn": rand_attn,
    "num_attention_heads": num_attention_heads,
    "num_rand_blocks": num_rand_blocks,
    "from_seq_length": from_seq_length,
    "from_block_size": from_block_size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 5, dtype family float, shape (2, 3, 1, 4, 8) — shape (2, 3, 1, 4, 8) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
split_overlapping Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mim-solutions/bert_for_longer_texts/belt_nlp/splitting.py
pointer only (licence: NOASSERTION) · get_code("c91a4a5114716579")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, mim-solutions/bert_for_longer_texts (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

split_tokens_into_smaller_chunks Ran
ran; our contract draft was wrong, not the code
mim-solutions/bert_for_longer_texts/belt_nlp/splitting.py
pointer only (licence: NOASSERTION) · get_code("0ce3135e26fafb14")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, mim-solutions/bert_for_longer_texts (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

stack_tokens_from_all_chunks Ran
ran; our contract draft was wrong, not the code
mim-solutions/bert_for_longer_texts/belt_nlp/splitting.py
pointer only (licence: NOASSERTION) · get_code("15b2fccc82d0a62a")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, mim-solutions/bert_for_longer_texts (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

tokenize_text_with_truncation Ran
ran; our contract draft was wrong, not the code
mim-solutions/bert_for_longer_texts/belt_nlp/splitting.py
pointer only (licence: NOASSERTION) · get_code("4123d6b63df245f2")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, mim-solutions/bert_for_longer_texts (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

tokenize_whole_text Ran
ran; our contract draft was wrong, not the code
mim-solutions/bert_for_longer_texts/belt_nlp/splitting.py
pointer only (licence: NOASSERTION) · get_code("316d08e3b6936972")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, mim-solutions/bert_for_longer_texts (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

transform_list_of_texts Ran
ran; our contract draft was wrong, not the code
mim-solutions/bert_for_longer_texts/belt_nlp/splitting.py
pointer only (licence: NOASSERTION) · get_code("41d96f44b38351ac")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, mim-solutions/bert_for_longer_texts (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

transform_single_text Ran
ran, honoured the contract we drafted
mim-solutions/bert_for_longer_texts/belt_nlp/splitting.py
pointer only (licence: NOASSERTION) · get_code("4d240665f4cb4490")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, mim-solutions/bert_for_longer_texts (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

add_padding_tokens Not yet run
unverified (harvested, no recorded run)
mim-solutions/bert_for_longer_texts/belt_nlp/splitting.py
pointer only (licence: NOASSERTION) · get_code("4603a2fe10eb193d")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, mim-solutions/bert_for_longer_texts (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

add_special_tokens_at_beginning_and_end Not yet run
unverified (harvested, no recorded run)
mim-solutions/bert_for_longer_texts/belt_nlp/splitting.py
pointer only (licence: NOASSERTION) · get_code("dd7b545b8b9f7fed")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, mim-solutions/bert_for_longer_texts (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

bigbird_block_sparse_attention Not yet run
unverified (harvested, no recorded run)
google-research/bigbird/bigbird/core/attention.py
code served (permissive licence) · get_code("0d09b5689924a10b")
How it ran

no invocation recorded.

bigbird_block_sparse_attention Not yet run
unverified (harvested, no recorded run)
monologg/kobigbird/pretrain/kobigbird/attention.py
code served (permissive licence) · get_code("b18d818e15d8f5f2")
How it ran

no invocation recorded.

check_split_parameters_consistency Not yet run
unverified (harvested, no recorded run)
mim-solutions/bert_for_longer_texts/belt_nlp/splitting.py
pointer only (licence: NOASSERTION) · get_code("e219be299ea45b2d")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, mim-solutions/bert_for_longer_texts (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 0 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
InconsistentSplittingParamsException
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
2004.05150 (2020-04)
Longformer: The Long-Document Transformer
check_split_parameters_consistency
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
2004.05150 (2020-04)
Longformer: The Long-Document Transformer
split_overlapping
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
2004.05150 (2020-04)
Longformer: The Long-Document Transformer
split_tokens_into_smaller_chunks
brick of this paper's assembly: data_transform
1 other paper
1 dated earlier · 1 only as an assembly brick
2004.05150 (2020-04)
Longformer: The Long-Document Transformer

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Transformers-based models, such as BERT, have been one of the most successful deep learning models for NLP. Unfortunately, one of their core limitations is the quadratic dependency (mainly in terms of memory) on the sequence length due to their full attention mechanism. To remedy this, we propose, BIGBIRD, a sparse attention mechanism that reduces this quadratic dependency to linear. We show that BIGBIRD is a universal approximator of sequence functions and is Turing complete, thereby preserving these properties of the quadratic, full attention model. Along the way, our theoretical analysis reveals some of the benefits of having O(1) global tokens (such as CLS), that attend to the entire sequence as part of the sparse attention mechanism. The proposed sparse attention can handle sequences of length up to 8x of what was previously possible using similar hardware. As a consequence of the capability to handle longer context, BIGBIRD drastically improves performance on various NLP tasks such as question answering and summarization. We also propose novel applications to genomics data.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2007.14062")
get_code_for_paper("2007.14062")
have("2007.14062")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2007.14062.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2007.14062.svg)](https://syntology.ai/paper/2007.14062)

Connect an agent — have() is free.