SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.15006 · ICLR · 2024

DNABERT-2: EFFICIENT FOUNDATION MODEL AND BENCHMARK FOR MULTI-SPECIES GENOMES

Zhihan Zhou, Han Liu, Weijian Li, Yanrong Ji, † Pratik, Dutta Ramana, V Davuluri

arXiv · PDF · Open in the Atlas

Code that ran

13 of 23 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 8 have no contract verdict; 4 failures of our instrument; 10 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, measured 2026-11-23; 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/2306.15006.json · badge: /api/ran/2306.15006.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
jerryji1993/dnabert community (classifier label)
classifier basis not recorded on the link
7 ran · 0 no recorded run
frederikkemarin/bend community
Papers with Code archive
6 ran · 10 no recorded run
FunctionStatusWhere it lives
swish Ran
ran; our contract draft was wrong, not the code
jerryji1993/dnabert/src/transformers/activations.py
code served (permissive licence) · get_code("0f786c407fb1ee4c")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-04T22:33:52Z). 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 torch

torch.manual_seed(0)

# The function swish takes a single parameter 'x' which is used with:
# - torch.sigmoid(x) - requires a tensor
# - x * ... - requires a tensor that supports multiplication
# So x should be a tensor

x = torch.randn(2, 4)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
BertGatedLinearUnitMLP Ran
ran on a synthesized input
frederikkemarin/bend/bend/utils/embedders.py
code served (permissive licence) · get_code("f1c7f50e43f8c65f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 4) 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 torch
import torch.nn as nn

class BertGatedLinearUnitMLP(nn.Module):
    """Applies the FFN at the end of each Mosaic BERT layer.

    Compared to the default BERT architecture, this block replaces :class:`~transformers.model.bert.modeling_bert.BertIntermediate`
    and :class:`~transformers.model.bert.modeling_bert.SelfOutput` with a single module that has similar functionality, but
    introduces Gated Linear Units.

    Note: Mosaic BERT adds parameters in order to implement Gated Linear Units. To keep parameter count consistent with that of a
    standard Hugging Face BERT, scale down `config.intermediate_size` by 2/3. For example, a Mosaic BERT constructed with
    `config.intermediate_size=2048` will have the same parameter footprint as its Hugging Face BERT counterpart constructed
    with the `config.intermediate_size=3072`.
    However, in most cases it will not be necessary to adjust `config.intermediate_size` since, despite the increased
    parameter size, Mosaic BERT typically offers a net higher throughput than a Hugging Face BERT built from the same `config`.
    """

    def __init__(self, config):
        super().__init__()
        self.config = config
        self.gated_layers = nn.Linear(config.hidden_size, config.intermediate_size * 2, bias=False)
        self.act = nn.GELU(approximate='none')
        self.wo = nn.Linear(config.intermediate_size, config.hidden_size)
        self.dropout = nn.Dropout(config.hidden_dropout_prob)
        self.layernorm = nn.LayerNorm(config.hidden_size, eps=config.layer_norm_eps)

    def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
        """Compute new hidden states from current hidden states.

        Args:
            hidden_states (torch.Tensor): The (unpadded) hidden states from
                the attention layer [nnz, dim].
        """
        residual_connection = hidden_states
        hidden_states = self.gated_layers(hidden_states)
        gated = hidden_states[:, :self.config.intermediate_size]
        non_gated = hidden_states[:, self.config.intermediate_size:]
        hidden_states = self.act(gated) * non_gated
        hidden_states = self.dropout(hidden_states)
        hidden_states = self.wo(hidden_states)
        hidden_states = self.layernorm(hidden_states + residual_connection)
        return hidden_states


class Config:
    def __init__(self):
        self.hidden_size = 4
        self.intermediate_size = 6
        self.hidden_dropout_prob = 0.1
        self.layer_norm_eps = 1e-12


INIT_ARGS = {
    'config': Config()
}

ARGS = {
    'hidden_states': torch.randn(2, 4)
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
BertPooler Ran
ran on a synthesized input
frederikkemarin/bend/bend/utils/embedders.py
code served (permissive licence) · get_code("82086191fd1b0dae")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 4) 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 torch
import torch.nn as nn

class Config:
    def __init__(self, hidden_size):
        self.hidden_size = hidden_size

INIT_ARGS = {
    'config': Config(hidden_size=4)
}

ARGS = {
    'hidden_states': torch.randn(2, 3, 4),
    'pool': True
}

if __name__ == '__main__':
    pooler = nn.Module.__new__(type('BertPooler', (nn.Module,), {
        '__init__': lambda self, config: (
            super(type(self), self).__init__(),
            setattr(self, 'dense', nn.Linear(config.hidden_size, config.hidden_size)),
            setattr(self, 'activation', nn.Tanh())
        ),
        'forward': lambda self, hidden_states, pool=True: (
            self.activation(self.dense(hidden_states[:, 0] if pool else hidden_states))
        )
    }))
    
    pooler.__init__(INIT_ARGS['config'])
    output = pooler(ARGS['hidden_states'], pool=ARGS['pool'])
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
BertPredictionHeadTransform Ran
ran on a synthesized input
frederikkemarin/bend/bend/utils/embedders.py
code served (permissive licence) · get_code("4c10b29b9932aaac")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 4) 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 torch
import torch.nn as nn
from transformers.activations import ACT2FN

class Config:
    def __init__(self, hidden_size, hidden_act):
        self.hidden_size = hidden_size
        self.hidden_act = hidden_act

INIT_ARGS = {
    "config": Config(hidden_size=4, hidden_act="gelu")
}

ARGS = {
    "hidden_states": torch.randn(2, 4)
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
contiguous_regions Ran
ran on a synthesized input
jerryji1993/dnabert/motif/motif_utils.py
code served (permissive licence) · get_code("0e02bf4a27dbaf92")
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 ndarray, ndim 2, dtype family int, shape (3, 2) 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 numpy as np

# Create a boolean array condition with some contiguous True regions
condition = np.array([
    False, False, True, True, True, True, True, False, 
    False, True, True, True, True, True, True, False,
    False, False, False, True, True, True, True, True, True, False
])

# Define ARGS with all parameters
ARGS = {
    "condition": condition,
    "len_thres": 5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family int, shape (3, 2) — shape (3, 2) 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
gelu_new Ran
ran, honoured the contract we drafted
jerryji1993/dnabert/src/transformers/activations.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from lonePatient/BERT-SDA, is pointer only (licence: NONE) · get_code("77601724cad03f95")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from lonePatient/BERT-SDA, and GitHub detected no licence in that repository when it was checked. 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.

get_activation Ran
ran on a synthesized input
jerryji1993/dnabert/src/transformers/activations.py
code served (permissive licence) · get_code("c91ea05b2f9c818a")
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 function. The image it ran in was not recorded. If your copy returns the same type 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 math
import torch
import torch.nn.functional as F

torch.manual_seed(0)

def swish(x):
    return x * torch.sigmoid(x)

def _gelu_python(x):
    return x * 0.5 * (1.0 + torch.erf(x / math.sqrt(2.0)))

gelu = getattr(F, 'gelu', _gelu_python)

def gelu_new(x):
    return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3))))

ACT2FN = {'relu': F.relu, 'swish': swish, 'gelu': gelu, 'tanh': F.tanh, 'gelu_new': gelu_new}

def get_activation(activation_string):
    if activation_string in ACT2FN:
        return ACT2FN[activation_string]
    else:
        raise KeyError('function {} not found in ACT2FN mapping {} or torch.nn.functional'.format(activation_string, list(ACT2FN.keys())))

ARGS = {
    'activation_string': 'relu'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
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
kmer2seq Ran
ran on a synthesized input
jerryji1993/dnabert/motif/motif_utils.py
code served (permissive licence) · get_code("2f94f1febf69f788")
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 str. The image it ran in was not recorded. If your copy returns the same type 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 torch
import numpy as np

# Set seed for reproducibility
torch.manual_seed(0)

# Analyze the function:
# - kmers parameter is a string with kmers separated by spaces
# - The function splits by space, extracts first character of each kmer except the last,
#   then appends the entire last kmer
# - It expects kmers to be DNA sequences (like "ATG", "TGC", etc.)

# Create a valid kmers string
# Example: if we have kmers "ATG TGC GCA", we should get "ATGCA"
# The function takes first char of each except last: A, T, then appends full last: GCA
# Result: ATGCA
kmers_input = "ATG TGC GCA CAT"

ARGS = {
    "kmers": kmers_input
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
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
mutate Ran
ran on a synthesized input
jerryji1993/dnabert/SNP/mutate_seqs.py
code served (permissive licence) · get_code("97526e4fc5605ed7")
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 str. The image it ran in was not recorded. If your copy returns the same type 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 numpy as np

# Test case 1: with target specified
seq1 = "ATGCATGC"
start1 = 2
end1 = 3
target1 = "T"

# Test case 2: without target (returns all 4 possibilities)
seq2 = "ATGCATGC"
start2 = 1
end2 = 2
target2 = None

# We'll use the first test case for ARGS
ARGS = {
    "seq": "ATGCATGC",
    "start": 2,
    "end": 3,
    "target": "T"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
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
pad_input Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
frederikkemarin/bend/bend/utils/embedders.py
code served (permissive licence) · get_code("dbf4ecb6112f8eef")
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) and returned Tensor, ndim 3, dtype family float, shape (2, 3, 4) 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 torch
from einops import rearrange

torch.manual_seed(0)

# Create small tensors for testing
batch = 2
seqlen = 3
hidden_dim = 4
total_nnz = 4  # number of non-zero tokens (less than batch * seqlen)

# hidden_states: (total_nnz, hidden_dim)
hidden_states = torch.randn(total_nnz, hidden_dim)

# indices: (total_nnz,) - indices into the flattened (batch, seqlen) space
# Valid indices should be in range [0, batch * seqlen)
indices = torch.tensor([0, 2, 3, 5], dtype=torch.long)

ARGS = {
    "hidden_states": hidden_states,
    "indices": indices,
    "batch": batch,
    "seqlen": seqlen,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 4) 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
seq2kmer Ran
ran on a synthesized input
jerryji1993/dnabert/motif/motif_utils.py
code served (permissive licence) · get_code("86ed11d1b2a6f597")
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 str. The image it ran in was not recorded. If your copy returns the same type 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.

ARGS = {
    'seq': 'ATCGATCGATCG',
    'k': 3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
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
unpad_input Ran
ran; our contract draft was wrong, not the code
frederikkemarin/bend/bend/utils/embedders.py
code served (permissive licence) · get_code("e819e759304fc70a")
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) and returned tuple. The image it ran in was not recorded. If your copy returns the same type 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 torch
import torch.nn.functional as F
from einops import rearrange, repeat

torch.manual_seed(0)

# Create small test tensors
batch_size = 2
seq_len = 3
hidden_dim = 4

# hidden_states: (batch, seqlen, hidden_dim)
hidden_states = torch.randn(batch_size, seq_len, hidden_dim)

# attention_mask: (batch, seqlen), bool or int where 1 means valid, 0 means padding
# Create a mask with some valid tokens and some padding
attention_mask = torch.tensor([
    [1, 1, 0],  # batch 0: 2 valid tokens, 1 padding
    [1, 0, 0]   # batch 1: 1 valid token, 2 padding
], dtype=torch.int32)

ARGS = {
    "hidden_states": hidden_states,
    "attention_mask": attention_mask
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
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
unpad_input_only Ran
ran; our contract draft was wrong, not the code
frederikkemarin/bend/bend/utils/embedders.py
code served (permissive licence) · get_code("9c99ec96528c0f00")
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) and returned Tensor, ndim 2, dtype family float, shape (4, 4) 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 torch
from einops import rearrange

torch.manual_seed(0)

# Create small tensors for testing
batch_size = 2
seq_len = 3
hidden_dim = 4

# hidden_states: (batch, seqlen, ...)
# Shape: (2, 3, 4) - batch=2, seqlen=3, hidden_dim=4
hidden_states = torch.randn(batch_size, seq_len, hidden_dim)

# attention_mask: (batch, seqlen), bool / int, 1 means valid and 0 means not valid
# Shape: (2, 3) - batch=2, seqlen=3
# Create a mask with some valid (1) and invalid (0) tokens
attention_mask = torch.tensor([
    [1, 0, 1],
    [1, 1, 0]
], dtype=torch.int64)

ARGS = {
    "hidden_states": hidden_states,
    "attention_mask": attention_mask,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (4, 4) — shape (4, 4) 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
BertEmbeddings Not yet run
unverified (harvested, no recorded run)
frederikkemarin/bend/bend/utils/embedders.py
code served (permissive licence) · get_code("48ac189cd4db0ad9")
How it ran

no invocation recorded.

BertEncoder Not yet run
unverified (harvested, no recorded run)
frederikkemarin/bend/bend/utils/embedders.py
code served (permissive licence) · get_code("3386604c83d5235b")
How it ran

no invocation recorded.

BertLMPredictionHead Not yet run
unverified (harvested, no recorded run)
frederikkemarin/bend/bend/utils/embedders.py
code served (permissive licence) · get_code("810c58679e40ef3e")
How it ran

no invocation recorded.

BertLayer Not yet run
unverified (harvested, no recorded run)
frederikkemarin/bend/bend/utils/embedders.py
code served (permissive licence) · get_code("f82f6d515d78b9fa")
How it ran

no invocation recorded.

BertModel Not yet run
unverified (harvested, no recorded run)
frederikkemarin/bend/bend/utils/embedders.py
code served (permissive licence) · get_code("f90d502733dc3fc8")
How it ran

no invocation recorded.

BertOnlyMLMHead Not yet run
unverified (harvested, no recorded run)
frederikkemarin/bend/bend/utils/embedders.py
code served (permissive licence) · get_code("d72aad474f62da31")
How it ran

no invocation recorded.

BertUnpadAttention Not yet run
unverified (harvested, no recorded run)
frederikkemarin/bend/bend/utils/embedders.py
code served (permissive licence) · get_code("ce7a1b8194d588f0")
How it ran

no invocation recorded.

BertUnpadSelfAttention Not yet run
unverified (harvested, no recorded run)
frederikkemarin/bend/bend/utils/embedders.py
code served (permissive licence) · get_code("6957915768d8a616")
How it ran

no invocation recorded.

DNABert2Embedder Not yet run
unverified (harvested, no recorded run)
frederikkemarin/bend/bend/utils/embedders.py
code served (permissive licence) · get_code("c4e9c025a630c701")
How it ran

no invocation recorded.

IndexFirstAxis Not yet run
unverified (harvested, no recorded run)
frederikkemarin/bend/bend/utils/embedders.py
code served (permissive licence) · get_code("2f4b4de6eea982fe")
How it ran

no invocation recorded.

Also present in other papers' code

Of 23 samples lifted from this paper's linked repositories, 23 carry a function identity and 0 do not. Of the 23 distinct functions with an identity, 6 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 1 the same month, 5 later) and 17 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
swish 206 other papers
145 dated earlier, 3 the same month, 58 later · 44 only as an assembly brick
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1805.12114 (2018-05)
Deep Reinforcement Learning in a Handful of Trials using Probabilistic Dynamics Models
1809.01357 (2018-09)
Zero Shot Learning for Code Education: Rubric Sampling with Deep Learning Inference
and 203 more not named here
gelu_new 23 other papers
21 dated earlier, 2 later
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1909.11942 (2019-09)
ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
1911.03631 (2019-11)
Hierarchical Graph Network for Multi-hop Question Answering
and 20 more not named here
pad_input
brick of this paper's assembly: helper
6 other papers
1 dated earlier, 5 later
2108.12409 (2021-08)
Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
2311.12570 (2023-11)
BEND: Benchmarking DNA Language Models on biologically meaningful tasks
2402.08777 (2024-02)
DNABERT-S: Pioneering Species Differentiation with Species-Aware DNA Embeddings
and 3 more not named here
unpad_input
brick of this paper's assembly: helper
5 other papers
5 later
2311.12570 (2023-11)
BEND: Benchmarking DNA Language Models on biologically meaningful tasks
2402.08777 (2024-02)
DNABERT-S: Pioneering Species Differentiation with Species-Aware DNA Embeddings
2407.09941 (2024-07)
Hydra: Bidirectional State Space Models Through Generalized Matrix Mixers
and 2 more not named here
unpad_input_only
brick of this paper's assembly: helper
3 other papers
3 later
2311.12570 (2023-11)
BEND: Benchmarking DNA Language Models on biologically meaningful tasks
2402.08777 (2024-02)
DNABERT-S: Pioneering Species Differentiation with Species-Aware DNA Embeddings
2505.00598 (2025-05)
Fast and Low-Cost Genomic Foundation Models via Outlier Removal
IndexFirstAxis
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2108.12409 (2021-08)
Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation

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-23.

Repositories linked to this paper

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

Abstract

Decoding the linguistic intricacies of the genome is a crucial problem in biology, and pre-trained foundational models such as DNABERT and Nucleotide Transformer have made significant strides in this area. Existing works have largely hinged on k-mer, fixed-length permutations of A, T, C, and G, as the token of the genome language due to its simplicity. However, we argue that the computation and sample inefficiencies introduced by k-mer tokenization are primary obstacles in developing large genome foundational models. We provide conceptual and empirical insights into genome tokenization, building on which we propose to replace k-mer tokenization with Byte Pair Encoding (BPE), a statistics-based data compression algorithm that constructs tokens by iteratively merging the most frequent co-occurring genome segment in the corpus. We demonstrate that BPE not only overcomes the limitations of k-mer tokenization but also benefits from the computational efficiency of non-overlapping tokenization. Based on these insights, we introduce DNABERT-2, a refined genome foundation model that adapts an efficient tokenizer and employs multiple strategies to overcome input length constraints, reduce time and memory expenditure, and enhance model capability. Furthermore, we identify the absence of a comprehensive and standardized benchmark for genome understanding as another significant impediment to fair comparative analysis. In response, we propose the Genome Understanding Evaluation, a comprehensive multi-species genome classification dataset that amalgamates 36 distinct datasets across 9 tasks, with input lengths ranging from 70 to 10000. Through comprehensive experiments on the GUE benchmark, we demonstrate that DNABERT-2 achieves comparable performance to the state-of-the-art model with 21× fewer parameters and approximately 92× less GPU time 1 in pre-training. Compared to DNABERT, while being 3× more efficient, DNABERT-2 outperforms it on 23 out of 28 datasets, with an average improvement of 6 absolute scores on GUE. The code, data, and pre-trained model are available at https://github.com/MAGICS-LAB/DNABERT_2.

For agents

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

get_harvested_code_for_paper("2306.15006")
get_code_for_paper("2306.15006")
have("2306.15006")

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

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

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

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

Connect an agent — have() is free.