/ Модель

Характеристики

Контекст
4 096 токенов
Параметры
138 млн
Лицензия
MIT
Архитектура
genalm · dense
Библиотека
transformers
Опубликована
25 авг 2026

GENA-LM-t2t-sparse-bigbird-base

Заполнение пропусковТекст → текст3 профессии

Модель GENA-LM на базе BigBird предсказывает замаскированные токены в длинных последовательностях человеческой ДНК и формирует их представления.

107скачиваний за 30 дней0лайковвеса обновлены26 авг 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Taykhoom Dalal поддерживает минимальный порт модели GENA-LM для анализа длинных последовательностей человеческой ДНК. Это плотная модель masked language modeling на архитектуре BigBird с блочно-разреженным вниманием и токенизацией BPE; в ней 137,8 млн параметров, а максимальная длина контекста составляет 4096 токенов. Исходный чекпойнт обучен AIRI Institute на сборке генома человека T2T с добавлением вариантов SNP из 1000 Genomes и gnomAD.

Модель предсказывает замаскированные токены ДНК и может создавать представления последовательностей для последующей тонкой настройки. Порт вычисляет блочно-разреженное внимание в чистом PyTorch без зависимости от DeepSpeed; для коротких последовательностей до 256 токенов внимание становится плотным. Репозиторий распространяется по лицензии MIT.

Модель предназначена для биологических последовательностей, а не для естественного языка. Исходный код не включает NSP-голову и pooler; точное совпадение исполнения с прежним ядром DeepSpeed/Triton не заявлено, хотя для длинных последовательностей проверено соответствие математической схеме разреженного внимания.

Сценарии применения

  • восстановление замаскированных участков последовательности ДНК
  • получение эмбеддингов длинных последовательностей человеческого генома
  • тонкая настройка для классификации геномных последовательностей
  • анализ последовательностей с вариантами SNP

Ограничения

Модель предназначена для последовательностей ДНК, а не для естественного языка. В порте отсутствуют NSP-голова и pooler, а совпадение исполнения с прежним ядром DeepSpeed/Triton не гарантируется.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

GENA-LM-t2t-sparse-bigbird-base

Minimal HuggingFace port of the bigbird-base-sparse-t2t variant of GENA-LM -- a BigBird block-sparse masked language model for long human DNA sequences (up to 4096 BPE tokens), using byte-pair (BPE) tokenization.

Architecture

ParameterValue
Layers12
Attention heads12
Embedding dimension768
FFN hidden dimension3072 (GELU)
Vocabulary size32000
Positional encodinglearned absolute
NormalizationPre-LayerNorm (eps=1e-5); final-layer LayerNorm: Yes
ArchitecturePre-LayerNorm BERT with BigBird block-sparse attention (with a final-layer LayerNorm)
Block-sparse configblock size 64, 2 global + 3 sliding-window + 3 random blocks per head
Max sequence length4096 BPE tokens (~36864 nucleotides)

Vocabulary: 32,000 BPE tokens trained on DNA, including [CLS], [SEP], [PAD], [UNK], and [MASK].

Pretraining

  • Objective: Masked language modeling (15% masking, BigBird-style).
  • Data: Human T2T genome assembly, augmented with 1000-genomes / gnomAD SNPs.
  • Pretraining iterations: 800,000 (batch size 256).
  • Source checkpoint: AIRI-Institute/gena-lm-bigbird-base-sparse-t2t

Block-sparse attention

The original model computes attention with DeepSpeed's block-sparse BigBird kernels. This port evaluates the same mathematical block-sparse equations in pure PyTorch: dense attention is restricted to allowed (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.

The upstream wrapper forces Q/K/V to fp16 because its legacy Triton kernel accepts only fp16. This port instead evaluates the equations in the model's requested activation dtype for numerical stability. A standalone source-tensor reference is bit-exact with this mathematical implementation at all layers; exact legacy-kernel rounding/execution parity is not claimed because that kernel cannot run on Hopper (sm90).

For short sequences (<= 256 tokens / 4 blocks) the layout is fully dense, so the model behaves as an ordinary pre-LayerNorm BERT.

Parity Verification

For short sequences (fully dense layout), all 13 representation levels and the masked-LM logits are bit-exact (max abs diff = 0.00) against the original GENA-LM code run with dense attention (no DeepSpeed), confirming weight loading, the pre-LayerNorm structure, and the block-sparse reduction. For long sequences, every layer's probabilities match an independently rebuilt masked-softmax reference exactly, are zero outside the checkpoint's 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.

Related Models

See the full GENA-LM collection.

ModelParametersNotes
GENA-LM-bert-base110M12L / 768d, 512 ctx
GENA-LM-t2t-bert-base110M12L / 768d, 512 ctx
GENA-LM-t2t-multi-species-bert-base110M12L / 768d, 512 ctx
GENA-LM-t2t-lastln-base110M12L / 768d, 512 ctx
GENA-LM-t2t-bert-large336M24L / 1024d, 512 ctx
GENA-LM-t2t-bigbird-base110M12L / 768d, 4096 ctx
GENA-LM-t2t-sparse-bigbird-base110M12L / 768d, 4096 ctx (this model)
GENA-LM-sparse-bigbird-base110M12L / 768d, 4096 ctx

Usage

Embedding generation

import torch
from transformers import AutoTokenizer, AutoModel

tokenizer = AutoTokenizer.from_pretrained("Taykhoom/GENA-LM-t2t-sparse-bigbird-base", trust_remote_code=True)
model = AutoModel.from_pretrained("Taykhoom/GENA-LM-t2t-sparse-bigbird-base", trust_remote_code=True)
model.eval()

sequences = ["ACGTACGTACGTACGT", "TTACGGGCATACGACGT"]
enc = tokenizer(sequences, return_tensors="pt", padding=True)

with torch.no_grad():
    out = model(**enc)

cls_emb   = out.last_hidden_state[:, 0, :]   # (batch, dim) -- CLS token
token_emb = out.last_hidden_state             # (batch, seq_len, dim)

MLM logits

from transformers import AutoTokenizer, AutoModelForMaskedLM

tokenizer = AutoTokenizer.from_pretrained("Taykhoom/GENA-LM-t2t-sparse-bigbird-base", trust_remote_code=True)
model = AutoModelForMaskedLM.from_pretrained("Taykhoom/GENA-LM-t2t-sparse-bigbird-base", trust_remote_code=True)
model.eval()

enc = tokenizer(["ACGT[MASK]CGTACGT"], return_tensors="pt")
with torch.no_grad():
    logits = model(**enc).logits   # (1, seq_len, vocab_size)

Faster attention backends

# SDPA (PyTorch 2.0+) evaluates the masked block-sparse attention with a fused kernel
model = AutoModel.from_pretrained("Taykhoom/GENA-LM-t2t-sparse-bigbird-base", trust_remote_code=True,
                                  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.

Fine-tuning

Standard HuggingFace conventions. For sequence-level tasks, pool over non-padding positions or use the [CLS] token embedding as input to a prediction head.

Implementation Notes

This is a minimal, self-contained reimplementation of the GENA-LM pre-LayerNorm BigBird backbone. The block-sparse attention is computed as masked dense attention in pure PyTorch using the checkpoint's stored layout and requested activation dtype, removing the DeepSpeed dependency. The original NSP head and pooler are not included. 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.

Citation

@article{fishman2025_genalm,
  title   = {{GENA-LM}: a family of open-source foundational {DNA} language models for long sequences},
  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},
  journal = {Nucleic Acids Research},
  volume  = {53},
  number  = {2},
  pages   = {gkae1310},
  year    = {2025},
  doi     = {10.1093/nar/gkae1310}
}

Credits

Original model and code by Fishman, Kuratov, et al. (AIRI Institute). Source: GitHub. Hugging Face port maintained by Taykhoom Dalal.

License

MIT, following the original repository.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers · fill-mask

Нельзя запустить

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

Класс архитектуры
GenaLMForMaskedLM
Ревизия весов
32b1cee

0 моделей