Views
No views yet
| Parameter | Value |
|---|---|
| Layers | 12 |
| Attention heads | 20 |
| Embedding dimension | 480 |
| FFN hidden dimension | 1280 (SwiGLU, 2/3 x 4 x embed) |
| Parameters | 33,491,074 |
| Vocabulary size | 22 |
| Positional encoding | RoPE (base=10000, non-interleaved) |
| Normalization | LayerNorm (eps=1e-5) |
| Architecture | Pre-LN Transformer with SwiGLU FFN |
| Max sequence length | ~8192 (practical; RoPE has no hard limit) |
<cls> (0), <pad> (1), <eos> (2), <unk> (3),
<mask> (4), A (5), C (6), G (7), T (8), I (9), R (10), Y (11), K (12), M (13),
S (14), W (15), B (16), D (17), H (18), V (19), N (20), - (21).rinalmo_micro_pretrained.pt from Zenodo 15043668| Model | Parameters | Notes |
|---|---|---|
| RiNALMo-micro | 33.5M | This model |
| RiNALMo-mega | 148.1M | Medium variant |
| RiNALMo-giga | 650.9M | Full model |
1import torch
2from transformers import AutoTokenizer, AutoModel
3
4tokenizer = AutoTokenizer.from_pretrained("Taykhoom/RiNALMo-micro", trust_remote_code=True)
5model = AutoModel.from_pretrained("Taykhoom/RiNALMo-micro", trust_remote_code=True)
6model.eval()
7
8sequences = ["ACUUUGGCCA", "CCCGGU"]
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, 480) -- CLS token
15token_emb = out.last_hidden_state # (batch, seq_len, 480)
16
17# Intermediate layers
18out_all = model(**enc, output_hidden_states=True)
19layer6_emb = out_all.hidden_states[6] # after block 61from transformers import AutoTokenizer, AutoModelForMaskedLM
2
3tokenizer = AutoTokenizer.from_pretrained("Taykhoom/RiNALMo-micro", trust_remote_code=True)
4model = AutoModelForMaskedLM.from_pretrained("Taykhoom/RiNALMo-micro", trust_remote_code=True)
5model.eval()
6
7enc = tokenizer(["ACU<mask>UGGCCA"], return_tensors="pt")
8with torch.no_grad():
9 logits = model(**enc).logits # (1, seq_len, 22)1# SDPA (PyTorch 2.0+)
2model = AutoModel.from_pretrained("Taykhoom/RiNALMo-micro", trust_remote_code=True,
3 attn_implementation="sdpa")
4
5# Flash Attention 2 (requires flash-attn package)
6model = AutoModel.from_pretrained("Taykhoom/RiNALMo-micro", trust_remote_code=True,
7 attn_implementation="flash_attention_2",
8 dtype=torch.bfloat16)attn_implementation dispatch. SDPA and the dispatch interface are additions; the
Flash backend preserves the original non-causal Flash Attention design.x = attn_ln(x); x = x + attn(x)) rather
than the original. The FFN uses standard Pre-LN.(1 - mask_ratio_train) / (1 - mask_ratio_observed)
even at inference, consistent with the original training code.1@article{penic2025_rinalmo,
2 title = {RiNALMo: general-purpose {RNA} language models can generalize well on structure prediction tasks},
3 author = {Penić, Rafael Josip and Vlašić, Tin and Huber, Roland G. and Wan, Yue and Šikić, Mile},
4 journal = {Nature Communications},
5 volume = {16},
6 number = {1},
7 pages = {5671},
8 year = {2025},
9 doi = {10.1038/s41467-025-60872-5}
10}