An mRNA is one molecule.Read it that way.

Dense bidirectional attention in all 32 layers, one token per nucleotide, pretrained natively on whole transcripts — the 5′ UTR, CDS and 3′ UTR in one representation.

Parameters
1.61 B
Native context
10,240 nt
RNA sequences
67.6 M
Nucleotide tokens
85.7 B
One nucleotide, the whole transcript Drag along the transcript
Query nucleotide
1
In region
5′ UTR
Attends to
10,240 nt, both directions
In which layers
all 32

Schematic transcript. Each arc is a position this nucleotide can attend to; arcs that cross into another region are drawn heavier.

The problem

Three properties, never all at once

A complete transcript needs all three. Every earlier RNA model gives up at least one.

What each approach gives up Paper, Section 1
The three properties a full-transcript RNA model needs, and the one each earlier approach gives up
ApproachFull-transcript contextDense bidirectional attentionSingle-nucleotide tokens
Short-context encodersRNA-FM, RiNALMo, AIDO.RNA, RiboGRAMGives up: Pretrained at 1K
Causal decodersEVA, Evo2Gives up: Upstream only
Efficient long encodersHydraRNA, RNAretGives up: State-space or retention layers
Compressed-token encoderBiRNA-BERTGives up: Byte-pair tokens
RiboSpan1.61 B parametersKeeps: 10,240 nt, nativelyKeeps: All 32 layersKeeps: One per nucleotide
Full-transcript context Drag the window on the left
1,024‑nt encoder one window at a time
In context
1,024 nt
Truncated away
9,216 nt
Covers
1,537–2,560
Regions in view
CDS
RiboSpan · 10,240 nt the whole transcript at once
In context
10,240 nt
Truncated away
none
Covers
1–10,240
Regions in view
all three regions
Dense attention, both directions Drag along any transcript
Short-window encoderRNA-FM · RiNALMo · AIDO.RNA · RiboGRAM
1,024 ntboth directions · 10% Arcs stop at the window seam; the mask is block diagonal.
Autoregressive decoderEVA · Evo2 — causal, upstream only
5,121 ntupstream only · 50% Every arc lands upstream; the mask is lower triangular.
RiboSpandense bidirectional, all 32 layers
10,240 ntboth directions · 100% Arcs reach either way, the whole length; the mask is full.
Query nucleotide 5,121, in the CDS Each arc is a reachable position · the square is the full mask
Evidence

Native long context, measured

Corpus, architecture and masking held fixed; only the pretrained context length varies.

Masked nucleotides recovered Move the slider to change input length
10,240 nt

One square per masked nucleotide, out of a hundred. Same positions for every model. Paper, Table 6 and Appendix Table 13.

BenchmarksSwitch benchmark, then task

t-SNE maps of frozen RNA representations for eight models; the two RiboSpan panels show tighter, better separated biotype clusters.
Frozen embeddings, eight models, same sequences.
Violin and box plots of secondary structure scores under two protocols comparing structRFM and LIMBER-macro with the RiboSpan 10K checkpoints.
Secondary structure, per sequence and per RNA family.
Four stacked bar panels showing contextual separation, cross-region similarity, distal diffusion and masked-nucleotide accuracy across input lengths from 1,024 to 10,240 nucleotides.
The full benchmark, with the attention-restriction ablation.
Inside

One stack, one token per nucleotide

Select a stage for what it does and how it is set.

32 ×
↓ HRNA ∈ ℝL×D

Pretraining objective

LMLM=−1∣M∣∑i∈Mlog⁡pθ ⁣(xi∣x~)\mathcal{L}_{\mathrm{MLM}} = -\frac{1}{|M|}\sum_{i\in M}\log p_{\theta}\!\left(x_i\mid\widetilde{x}\right)
MM
the masked positions — 15%, then 40% in the continuation
x~\widetilde{x}
the corrupted sequence the model reads
pθp_{\theta}
probability of the original nucleotide at position ii

Megatron-LM with variable-length packing: several RNAs share a training sequence, but attention and positional indices reset at each boundary.

RiboSpan architecture: a single-nucleotide RNA sequence covering 5′ UTR, CDS and 3′ UTR enters an embedding layer, passes through 32 bidirectional Transformer blocks, and produces transferable nucleotide-level representations used for understanding tasks, embedding integration and diffusion-based mRNA design.
The stack end to end, and what it feeds.
Pretraining corpusHover a class
mRNA
18,316,110 sequences
27.1% of the training corpus

67,567,085 sequences, 85.7 B tokens, 90,000 held out each for validation and test. Paper, Table 2.

Sequence-length histograms for RNAcentral RNAs and Ensembl mRNAs beside a pie chart of RNA class composition.
Ensembl mRNAs centre near 2,000 nt and reach past 10,000 — the range a 1,024‑token encoder must cut.
Design

De novo design of a better mRNAfor the protein you give it

The whole transcript is generated from scratch — 5′ UTR, CDS and 3′ UTR together — not a codon table applied to an existing one. Vast numbers of sequences encode the same protein, and they do not fold, last or translate alike; conditional diffusion searches that space under design conditions, while the protein stays fixed.

Protein fixed, transcript free, schematic Drag t, or press play
t = 1.00 · 0%
Protein
—
Fixed by the protein
—
Free to choose
—
Still masked
—
masked, awaiting denoising A C G U  determined MKV residues each CDS row must encode

Positions identical across a residue’s synonymous codons are settled before the first step. The model chooses only the degenerate ones — the wobble base, plus the first base of Leu, Arg and Ser — and the UTRs.

The generation framework: a corrupted sequence passes through the RiboSpan backbone into eight conditional diffusion blocks modulated by timestep and conditions, then an MLM head with synonymous-codon constraints.
Design conditions enter every block through AdaLN-Zero modulation, so they steer the whole denoising trajectory; the MLM head keeps CDS swaps synonymous. Property-level optimisation — predictors scoring stability and translation, with reinforcement-learning post-training — is reported in a forthcoming paper.
Run it

Put the model to work

Hugging Face ZeroGPU Connecting…
Sequence representationsA, C, G, U — T is read as U

One vector per nucleotide, plus the pooled transcript vector. Download the pooled vectors as JSON and the full matrices as binary files.

Checkpoints

Four checkpoints, one recipe

Pick the job; the matching checkpoint lights up.

Get started

Install, load, encode

Install and load

shell
# clone and install
git clone https://github.com/GAIR-NLP/RIBOSPAN-FM.git
cd RIBOSPAN-FM
pip install -e .
checkpoints
# public weights
ckpt = "SII-GAIR-NLP/RIBOSPAN-1K-15"
ckpt = "SII-GAIR-NLP/RIBOSPAN-1K-40"

# access on request, via the Hugging Face model page
ckpt = "SII-GAIR-NLP/RIBOSPAN-10K-15"

The tokenizer uppercases, converts U to T and adds boundary tokens, so RNA passes straight in. Restricted checkpoints need access on Hugging Face first.

Licence

Source code
Apache 2.0

The weights are for non-commercial research. Each link opens the licence in its own repository.

Cite

BibTeX
@misc{wang2026ribospan,
  title         = {{RIBOSPAN}: A Long-Context {RNA}
                   Foundation Model for Versatile {RNA} Modeling},
  author        = {Wang, Ziyuan and Tang, Bohao and Zhang, Fei
                   and Han, Shuo and Liu, Pengfei},
  year          = {2026},
  eprint        = {2608.22849},
  archivePrefix = {arXiv},
  primaryClass  = {cs.LG}
}