The MultiMolecule team has confirmed that the provided model and checkpoints are producing the same intermediate representations as the original implementation.
The team releasing RiNALMo did not write this model card for this model so this model card has been written by the MultiMolecule team.
Model Details
RiNALMo is a
bert
-style model pre-trained on a large corpus of non-coding RNA sequences in a self-supervised fashion. This means that the model was trained on the raw nucleotides of RNA sequences only, with an automatic process to generate inputs and labels from those texts. Please refer to the
Training Details
section for more information on the training process.
The model file depends on the
multimolecule
library. You can install it using pip:
pip install multimolecule
Direct Use
Masked Language Modeling
You can use this model directly with a pipeline for masked language modeling:
<<<<<<< HEAD
import multimolecule # you must import multimolecule to register modelsfrom transformers import pipeline
predictor = pipeline("fill-mask", model="multimolecule/rinalmo")
output = predictor("gguc<mask>cucugguuagaccagaucugagccu")
=======
>>> import multimolecule # you must import multimolecule to register models>>> from transformers import pipeline
>>> unmasker = pipeline("fill-mask", model="multimolecule/rinalmo-giga")
>>> unmasker("gguc<mask>cucugguuagaccagaucugagccu")
[{'score': 0.9774785041809082,
'token': 6,
'token_str': 'A',
'sequence': 'G G U C A C U C U G G U U A G A C C A G A U C U G A G C C U'},
{'score': 0.004996326752007008,
'token': 22,
'token_str': 'X',
'sequence': 'G G U C X C U C U G G U U A G A C C A G A U C U G A G C C U'},
{'score': 0.0035297079011797905,
'token': 3,
'token_str': '<unk>',
'sequence': 'G G U C C U C U G G U U A G A C C A G A U C U G A G C C U'},
{'score': 0.002614670665934682,
'token': 10,
'token_str': 'N',
'sequence': 'G G U C N C U C U G G U U A G A C C A G A U C U G A G C C U'},
{'score': 0.00249761575832963,
'token': 5,
'token_str': '<null>',
'sequence': 'G G U C C U C U G G U U A G A C C A G A U C U G A G C C U'}]
>>>>>>> 6fbb6942... update RiNALMo models
Downstream Use
Extract Features
Here is how to use this model to get the features of a given sequence in PyTorch:
from multimolecule import RnaTokenizer, RiNALMoModel
tokenizer = RnaTokenizer.from_pretrained("multimolecule/rinalmo-giga")
model = RiNALMoModel.from_pretrained("multimolecule/rinalmo-giga")
text = "UAGCUUAUCAGACUGAUGUUG"input = tokenizer(text, return_tensors="pt")
output = model(**input)
Sequence Classification / Regression
This model is not fine-tuned for any specific task. You will need to fine-tune the model on a downstream task to use it for sequence classification or regression.
Here is how to use this model as backbone to fine-tune for a sequence-level task in PyTorch:
import torch
from multimolecule import RnaTokenizer, RiNALMoForSequencePrediction
tokenizer = RnaTokenizer.from_pretrained("multimolecule/rinalmo-giga")
model = RiNALMoForSequencePrediction.from_pretrained("multimolecule/rinalmo-giga")
text = "UAGCUUAUCAGACUGAUGUUG"input = tokenizer(text, return_tensors="pt")
label = torch.tensor([1])
output = model(**input, labels=label)
Token Classification / Regression
This model is not fine-tuned for any specific task. You will need to fine-tune the model on a downstream task to use it for token classification or regression.
Here is how to use this model as backbone to fine-tune for a nucleotide-level task in PyTorch:
import torch
from multimolecule import RnaTokenizer, RiNALMoForTokenPrediction
tokenizer = RnaTokenizer.from_pretrained("multimolecule/rinalmo-giga")
model = RiNALMoForTokenPrediction.from_pretrained("multimolecule/rinalmo-giga")
text = "UAGCUUAUCAGACUGAUGUUG"input = tokenizer(text, return_tensors="pt")
label = torch.randint(2, (len(text), ))
output = model(**input, labels=label)
Contact Classification / Regression
This model is not fine-tuned for any specific task. You will need to fine-tune the model on a downstream task to use it for contact classification or regression.
Here is how to use this model as backbone to fine-tune for a contact-level task in PyTorch:
import torch
from multimolecule import RnaTokenizer, RiNALMoForContactPrediction
tokenizer = RnaTokenizer.from_pretrained("multimolecule/rinalmo-giga")
model = RiNALMoForContactPrediction.from_pretrained("multimolecule/rinalmo-giga")
text = "UAGCUUAUCAGACUGAUGUUG"input = tokenizer(text, return_tensors="pt")
label = torch.randint(2, (len(text), len(text)))
output = model(**input, labels=label)
Training Details
RiNALMo used Masked Language Modeling (MLM) as the pre-training objective: taking a sequence, the model randomly masks 15% of the tokens in the input then runs the entire masked sentence through the model and has to predict the masked tokens. This is comparable to the Cloze task in language modeling.
To ensure sequence diversity in each training batch, RiNALMo clustered the sequences with
MMSeqs2
into 17 million clusters and then sampled each sequence in the batch from a different cluster.
RiNALMo preprocessed all tokens by replacing "U"s with "T"s.
Note that during model conversions, "T" is replaced with "U". [
RnaTokenizer
][multimolecule.RnaTokenizer] will convert "T"s to "U"s for you, you may disable this behaviour by passing
replace_T_with_U=False
.
Training Procedure
Preprocessing
RiNALMo used masked language modeling (MLM) as the pre-training objective. The masking procedure is similar to the one used in BERT:
15% of the tokens are masked.
In 80% of the cases, the masked tokens are replaced by
<mask>
.
In 10% of the cases, the masked tokens are replaced by a random token (different) from the one they replace.
In the 10% remaining cases, the masked tokens are left as is.
Pre-training
The model was trained on 7 NVIDIA A100 GPUs with 80GiB memories.
Batch Size: 1344
Epochs: 6
Learning rate: 5e-5
Learning rate scheduler: Cosine
Learning rate warm-up: 2,000 steps
Learning rate minimum: 1e-5
Dropout: 0.1
Citation
BibTeX
:
@ARTICLE{Penic2025-qf,
title = "{RiNALMo}: general-purpose {RNA} language models can generalize
well on structure prediction tasks",
author = "Peni{\'c}, Rafael Josip and Vla{\v s}i{\'c}, Tin and Huber,
Roland G and Wan, Yue and {\v S}iki{\'c}, Mile",
abstract = "While RNA has recently been recognized as an interesting
small-molecule drug target, many challenges remain to be
addressed before we take full advantage of it. This emphasizes
the necessity to improve our understanding of its structures and
functions. Over the years, sequencing technologies have produced
an enormous amount of unlabeled RNA data, which hides a huge
potential. Motivated by the successes of protein language
models, we introduce RiboNucleic Acid Language Model (RiNALMo)
to unveil the hidden code of RNA. RiNALMo is the largest RNA
language model to date, with 650M parameters pre-trained on 36M
non-coding RNA sequences from several databases. It can extract
hidden knowledge and capture the underlying structure
information implicitly embedded within the RNA sequences.
RiNALMo achieves state-of-the-art results on several downstream
tasks. Notably, we show that its generalization capabilities
overcome the inability of other deep learning methods for
secondary structure prediction to generalize on unseen RNA
families.",
journal = "Nature Communications",
publisher = "Springer Science and Business Media LLC",
volume = 16,
number = 1,
pages = "5671",
month = jul,
year = 2025,
copyright = "https://creativecommons.org/licenses/by-nc-nd/4.0",
language = "en"
}
Contact
Please use GitHub issues of
MultiMolecule
for any questions or comments on the model card.
Please contact the authors of the
RiNALMo paper
for questions or comments on the paper/model.
rinalmo-giga huggingface.co is an AI model on huggingface.co that provides rinalmo-giga's model effect (), which can be used instantly with this multimolecule rinalmo-giga model. huggingface.co supports a free trial of the rinalmo-giga model, and also provides paid use of the rinalmo-giga. Support call rinalmo-giga model through api, including Node.js, Python, http.
rinalmo-giga huggingface.co is an online trial and call api platform, which integrates rinalmo-giga's modeling effects, including api services, and provides a free online trial of rinalmo-giga, you can try rinalmo-giga online for free by clicking the link below.
multimolecule rinalmo-giga online free url in huggingface.co:
rinalmo-giga is an open source model from GitHub that offers a free installation service, and any user can find rinalmo-giga on GitHub to install. At the same time, huggingface.co provides the effect of rinalmo-giga install, users can directly use rinalmo-giga installed effect in huggingface.co for debugging and trial. It also supports api for free installation.