Views
No views yet
| Parameter | Value |
|---|---|
| Layers | 6 |
| Attention heads | 16 |
| Embedding dimension | 128 |
| FFN hidden dimension | 512 (GELU) |
| Vocabulary size | 10 |
| Positional encoding | RoPE (base=10000) |
| Normalization | LayerNorm |
| Architecture | ESM2-style pre-LN Transformer with GELU FFN |
| Max sequence length | 1024 tokens (1022 nucleotides + <cls> / <eos>) |
<pad> (0), <eos> (1), <unk> (2), A (3), G (4), C (5), T (6), <cls> (7), <mask> (8), <sep> (9)ESM2SI_3.1_fiveSpeciesCao_6layers_16heads_128embedsize_4096batchToks_MLMLossMin.pklESM2SI checkpoints were available (versions 3.1, FS4.1, FS4.4, FS4.7). The 3.1 checkpoint was selected because it is the version specified in the original UTR-LM paper for translation efficiency (TE) and expression level (EL) downstream tasks (used in the MJ4_Finetune evaluation scripts). The FS4.x variants are later training runs but were not the ones reported in the original publication.ESM2SI_3.1_fiveSpeciesCao_6layers_16heads_128embedsize_4096batchToks_MLMLossMin.pkl
weights. Verified on GPU with PyTorch 2.7.1 / CUDA 12.9.| Model | Pretraining Objective | Notes |
|---|---|---|
| UTR-LM-MLM | MLM | Base model |
| UTR-LM-MLMSI | MLM + MFE regression | This model — recommended for TE / EL tasks |
| UTR-LM-MLMSS | MLM + secondary structure | — |
| UTR-LM-MLMSISS | MLM + MFE + secondary structure | Recommended for MRL tasks |
1import torch
2from transformers import AutoTokenizer, AutoModel
3
4tokenizer = AutoTokenizer.from_pretrained("Taykhoom/UTR-LM-MLMSI", trust_remote_code=True)
5model = AutoModel.from_pretrained("Taykhoom/UTR-LM-MLMSI", trust_remote_code=True)
6model.eval()
7
8sequences = ["ATGCATGCATGC", "GCTAGCTAGCTAGCTA"]
9enc = tokenizer(sequences, return_tensors="pt", padding=True)
10
11with torch.no_grad():
12 out = model(**enc)
13
14# CLS token embedding (position 0) - recommended for sequence-level tasks
15cls_emb = out.last_hidden_state[:, 0, :] # (batch, 128)
16
17# All-token embeddings
18token_emb = out.last_hidden_state # (batch, seq_len, 128)
19
20# Intermediate layer representations
21out_all = model(**enc, output_hidden_states=True)
22layer3_emb = out_all.hidden_states[3] # after layer 3, shape (batch, seq_len, 128)1import torch
2from transformers import AutoTokenizer, AutoModelForMaskedLM
3
4tokenizer = AutoTokenizer.from_pretrained("Taykhoom/UTR-LM-MLMSI", trust_remote_code=True)
5model = AutoModelForMaskedLM.from_pretrained("Taykhoom/UTR-LM-MLMSI", trust_remote_code=True)
6model.eval()
7
8enc = tokenizer(["ATGC<mask>ATGC"], return_tensors="pt")
9with torch.no_grad():
10 logits = model(**enc).logits # (1, seq_len, 10)1# SDPA (PyTorch 2.0+)
2model = AutoModel.from_pretrained(
3 "Taykhoom/UTR-LM-MLMSI",
4 trust_remote_code=True,
5 attn_implementation="sdpa",
6)
7
8# Flash Attention 2 (requires flash-attn)
9model = AutoModel.from_pretrained(
10 "Taykhoom/UTR-LM-MLMSI",
11 trust_remote_code=True,
12 attn_implementation="flash_attention_2",
13 dtype=torch.bfloat16,
14)A/G/C/T alphabet. Convert U to
T before tokenization when supplying RNA-spelled sequences; a literal U
otherwise maps to <unk>. MFE was an auxiliary prediction target, not an
input channel; this minimal port preserves the backbone and MLM head but
omits the auxiliary regression head.attn_implementation="sdpa" and
attn_implementation="flash_attention_2".1@article{chu2024_utrlm,
2 title = {A 5' {UTR} Language Model for Decoding Untranslated Regions of {mRNA} and Function Predictions},
3 author = {Chu, Yanyi and Yu, Dan and Li, Yupeng and Huang, Kaixuan and Shen, Yue and Cong, Le and Zhang, Jason and Wang, Mengdi},
4 journal = {Nature Machine Intelligence},
5 volume = {6},
6 number = {4},
7 pages = {449--460},
8 year = {2024},
9 doi = {10.1038/s42256-024-00823-9}
10}