Views
No views yet
| Parameter | Value |
|---|---|
| Layers | 24 |
| Attention heads | 16 |
| Embedding dimension | 1024 |
| FFN hidden dimension | 2688 (SwiGLU) |
| Vocabulary size | 16 |
| Positional encoding | RoPE (rotary_percent=1.0) |
| Normalization | LayerNorm |
| MLP activation | SwiGLU |
| Architecture | Pre-LN Transformer (BERT-style encoder) |
| Max sequence length | 4000 (training context; RoPE has no hard limit) |
[PAD], [MASK], [CLS], [SEP], [UNK], A, G, C, T, U, N,
[BOS], [EOS], [UNUSED1], [UNUSED2], [UNUSED3]A, C, G, T, N. Each sequence is
wrapped as [CLS] ... [SEP].Note onU: the vocabulary is the shared AIDO RNABert vocabulary, so aUtoken exists (id 9) and the tokenizer will accept it. However, AIDO.DNA was pretrained on DNA (A, C, G, T, N) and never sawUduring training - its embedding row is effectively untrained (embedding norm ~1.77, in line with the unused special tokens, versus ~0.69-0.97 for the trained nucleotidesA/G/C/T). Do not feedUto this model; useTfor thymine. The token is retained only to keepvocab_size=16consistent with the original weights.
genbio-ai/GB.DNA-300Mgenbio-ai/GB.DNA-300M
weights (loaded into the genbio RNABertForMaskedLM reference) at all 25 representation
levels (embedding + 24 transformer layers). The embedding layer matches exactly, and the
final post-LayerNorm hidden state and MLM logits match within 4e-6. Intermediate layer
differences (up to ~2e-4) are floating-point accumulation noise in the un-normalized
residual stream, normalized away by the final layer norm. Verified on PyTorch 2.7 / CUDA 12.| Model | Parameters | Notes |
|---|---|---|
| Taykhoom/AIDO.DNA-300M | 300M | This model |
| Taykhoom/AIDO.DNA-7B | 7B | Largest DNA variant |
1import torch
2from transformers import AutoTokenizer, AutoModel
3
4tokenizer = AutoTokenizer.from_pretrained("Taykhoom/AIDO.DNA-300M", trust_remote_code=True)
5model = AutoModel.from_pretrained("Taykhoom/AIDO.DNA-300M", trust_remote_code=True)
6model.eval()
7
8sequences = ["ACGTACGTACGTACGT", "TTGCAACGTAGCTAGC"]
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, 1024) -- CLS token
15token_emb = out.last_hidden_state # (batch, seq_len, 1024)
16
17# Intermediate layers
18out_all = model(**enc, output_hidden_states=True)
19layer3_emb = out_all.hidden_states[3]1from transformers import AutoTokenizer, AutoModelForMaskedLM
2
3tokenizer = AutoTokenizer.from_pretrained("Taykhoom/AIDO.DNA-300M", trust_remote_code=True)
4model = AutoModelForMaskedLM.from_pretrained("Taykhoom/AIDO.DNA-300M", trust_remote_code=True)
5model.eval()
6
7enc = tokenizer(["ACGT[MASK]CGTA"], return_tensors="pt")
8with torch.no_grad():
9 logits = model(**enc).logits # (1, seq_len, 16)cls_emb = out.last_hidden_state[:, 0, :] (CLS token) as
input to a task-specific head for sequence-level tasks.genbio-ai/GB.DNA-300M checkpoint requires the
ModelGenerator package to load.
This port is a clean standalone re-implementation:modeling_aidodna.py and configuration_aidodna.py.attn_implementation="sdpa" and attn_implementation="flash_attention_2" are added
(not present in the original genbio-ai implementation).RNABertForMaskedLM).1@article{ellington2024_aidodna,
2 title = {Accurate and General {DNA} Representations Emerge from Genome Foundation Models at Scale},
3 author = {Ellington, Caleb N. and Sun, Ning and Ho, Nicholas and Tao, Tianhua and Mahbub, Sazan and Li, Dian and Zhuang, Yonghao and Wang, Hongyi and Song, Le and Xing, Eric P.},
4 journal = {bioRxiv},
5 year = {2024},
6 doi = {10.1101/2024.12.01.625444}
7}LICENSE for details.