Views
No views yet
| Parameter | Value |
|---|---|
| Layers | 12 |
| Attention heads | 12 |
| Embedding dimension | 768 |
| FFN hidden dimension | 3072 (GELU) |
| Vocabulary size | 32000 |
| Positional encoding | rotary (rotary_dim=32, base=10000) |
| Normalization | Pre-LayerNorm (eps=1e-12); final-layer LayerNorm: No |
| Architecture | Pre-LayerNorm BERT with BigBird block-sparse attention (without a final-layer LayerNorm) |
| Block-sparse config | block size 64, 2 global + 3 sliding-window + 3 random blocks per head |
| Max sequence length | 4096 BPE tokens (~36864 nucleotides) |
[CLS], [SEP], [PAD],
[UNK], and [MASK].AIRI-Institute/gena-lm-bigbird-base-sparse(query-block, key-block) pairs, with softmax over
allowed keys only. The exact per-head checkpoint layout (master_layout) is consumed
directly, using its top-left nb x nb region for nb sequence blocks. No DeepSpeed is
required at inference.master_layout, and have rows that sum to 1. Verified
on GPU with PyTorch 2.7 / CUDA 12.9. This is mathematical source parity, distinct from
execution parity with the unavailable legacy DeepSpeed/Triton kernel.| Model | Parameters | Notes |
|---|---|---|
| GENA-LM-bert-base | 110M | 12L / 768d, 512 ctx |
| GENA-LM-t2t-bert-base | 110M | 12L / 768d, 512 ctx |
| GENA-LM-t2t-multi-species-bert-base | 110M | 12L / 768d, 512 ctx |
| GENA-LM-t2t-lastln-base | 110M | 12L / 768d, 512 ctx |
| GENA-LM-t2t-bert-large | 336M | 24L / 1024d, 512 ctx |
| GENA-LM-t2t-bigbird-base | 110M | 12L / 768d, 4096 ctx |
| GENA-LM-t2t-sparse-bigbird-base | 110M | 12L / 768d, 4096 ctx |
| GENA-LM-sparse-bigbird-base | 110M | 12L / 768d, 4096 ctx (this model) |
1import torch
2from transformers import AutoTokenizer, AutoModel
3
4tokenizer = AutoTokenizer.from_pretrained("Taykhoom/GENA-LM-sparse-bigbird-base", trust_remote_code=True)
5model = AutoModel.from_pretrained("Taykhoom/GENA-LM-sparse-bigbird-base", trust_remote_code=True)
6model.eval()
7
8sequences = ["ACGTACGTACGTACGT", "TTACGGGCATACGACGT"]
9enc = tokenizer(sequences, return_tensors="pt", padding=True)
10
11with torch.no_grad():
12 out = model(**enc)
13
14cls_emb = out.last_hidden_state[:, 0, :] # (batch, dim) -- CLS token
15token_emb = out.last_hidden_state # (batch, seq_len, dim)1from transformers import AutoTokenizer, AutoModelForMaskedLM
2
3tokenizer = AutoTokenizer.from_pretrained("Taykhoom/GENA-LM-sparse-bigbird-base", trust_remote_code=True)
4model = AutoModelForMaskedLM.from_pretrained("Taykhoom/GENA-LM-sparse-bigbird-base", trust_remote_code=True)
5model.eval()
6
7enc = tokenizer(["ACGT[MASK]CGTACGT"], return_tensors="pt")
8with torch.no_grad():
9 logits = model(**enc).logits # (1, seq_len, vocab_size)1# SDPA (PyTorch 2.0+) evaluates the masked block-sparse attention with a fused kernel
2model = AutoModel.from_pretrained("Taykhoom/GENA-LM-sparse-bigbird-base", trust_remote_code=True,
3 attn_implementation="sdpa")flash_attention_2 is not supported for the block-sparse checkpoints because Flash
Attention cannot express the checkpoint-specific arbitrary block mask. Requesting it
raises an explicit error rather than silently changing the attention pattern.[CLS] token embedding as input to a prediction head.AutoModel
returns the backbone without a pooler; use the [CLS] hidden state or masked mean pooling
for sequence embeddings. The input embeddings and MLM decoder are tied. Rotary cache outputs are cloned in the caller's execution mode, so inference-mode logits can safely be followed by a grad-enabled embedding forward.1@article{fishman2025_genalm,
2 title = {{GENA-LM}: a family of open-source foundational {DNA} language models for long sequences},
3 author = {Fishman, Veniamin and Kuratov, Yuri and Shmelev, Aleksei and Petrov, Maxim and Penzar, Dmitry and Shepelin, Denis and Chekanov, Nikolay and Kardymon, Olga and Burtsev, Mikhail},
4 journal = {Nucleic Acids Research},
5 volume = {53},
6 number = {2},
7 pages = {gkae1310},
8 year = {2025},
9 doi = {10.1093/nar/gkae1310}
10}