Views
No views yet
| Parameter | Value |
|---|---|
| Layers | 6 |
| Attention heads | 16 |
| Embedding dimension | 512 |
| FFN hidden dimension | 2048 (GELU) |
| Vocabulary size | 10 |
| Positional encoding | Learned absolute |
| Normalization | LayerNorm (post-residual, eps=1e-12) |
| Architecture | Post-LN BERT encoder |
| Max sequence length | 1024 nt (1026 tokens with [CLS]/[SEP]) |
| Checkpoint size | ~19.7M parameters |
[PAD]=0, [UNK]=1, [CLS]=2, [SEP]=3,
[MASK]=4, N=5, A=6, C=7, G=8, T=9. Input U is
normalized to T.SpliceBERT.1024nt/pytorch_model.bin (from zenodo:7995778)eager and sdpa attention backends.
Verified on GPU with PyTorch 2.7.1 / CUDA 12.9.| Model | Context | Training data | Notes |
|---|---|---|---|
| SpliceBERT-1024nt | 1024 nt | 72 vertebrates | This model |
| SpliceBERT-510nt | 510 nt (fixed) | 72 vertebrates | Fixed-length; requires exact 510 nt input |
| SpliceBERT-human-510nt | 510 nt (fixed) | Human only | Human-specific; requires exact 510 nt input |
1import torch
2from transformers import AutoTokenizer, AutoModel
3
4tokenizer = AutoTokenizer.from_pretrained("Taykhoom/SpliceBERT-1024nt", trust_remote_code=True)
5model = AutoModel.from_pretrained("Taykhoom/SpliceBERT-1024nt", trust_remote_code=True)
6model.eval()
7
8seq = "ACGUACGUACGUACGU" # U->T handled automatically
9enc = tokenizer(seq, return_tensors="pt")
10
11with torch.no_grad():
12 out = model(**enc, output_hidden_states=True)
13
14# Mean pooling over non-special tokens
15hidden = out.last_hidden_state[0] # (seq_len+2, 512)
16token_emb = hidden[1:-1] # strip [CLS] and [SEP]
17mean_emb = token_emb.mean(dim=0) # (512,)
18
19# Intermediate layers
20layer3_emb = out.hidden_states[3] # (1, seq_len+2, 512)1import torch
2from transformers import AutoTokenizer, AutoModelForMaskedLM
3
4tokenizer = AutoTokenizer.from_pretrained("Taykhoom/SpliceBERT-1024nt", trust_remote_code=True)
5model = AutoModelForMaskedLM.from_pretrained("Taykhoom/SpliceBERT-1024nt", trust_remote_code=True)
6model.eval()
7
8seq = "A C G [MASK] A C G T"
9enc = tokenizer(seq, return_tensors="pt")
10with torch.no_grad():
11 logits = model(**enc).logits # (1, seq_len, 10)BertForMaskedLM with transformers==4.24.0.
This port uses BERT-updated, which
adds attn_implementation="sdpa" and attn_implementation="flash_attention_2" support
not present in the original codebase.pooler.dense) are not present in the original checkpoint and are
not included in the saved model.safetensors. add_pooling_layer=True (the default)
allocates the pooler layer but its weights are randomly initialized -- do not use
pooler_output without fine-tuning.1model = AutoModel.from_pretrained("Taykhoom/SpliceBERT-1024nt",
2 trust_remote_code=True,
3 attn_implementation="sdpa")1@article{chen2024_splicebert,
2 title = {Self-supervised learning on millions of primary {RNA} sequences from 72 vertebrates improves sequence-based {RNA} splicing prediction},
3 author = {Chen, Ken and Zhou, Yue and Ding, Maolin and Wang, Yu and Ren, Zhixiang and Yang, Yuedong},
4 journal = {Briefings in Bioinformatics},
5 volume = {25},
6 number = {3},
7 pages = {bbae163},
8 year = {2024},
9 doi = {10.1093/bib/bbae163}
10}