NVIDIA's CodonFM 5B Reads the Genetic Code Protein Models Ignore
NVIDIA's new 5B-parameter codon-level RNA foundation models score silent mutations and design mRNA sequences that produce up to 4x more protein in lab tests.
Takeaways
- NVIDIA released CodonFM-5B and CodonFM-5B-CDWT, two 4.85B-parameter open codon-level RNA foundation models.
- In Arc Institute lab tests, CodonFM-designed sequences raised GFP expression nearly 4x and luciferase 2x in human A549 cells.
- 5B-CDWT leads ClinVar synonymous-variant pathogenicity benchmarks; base 5B leads COSMIC cancer somatic variants.
- Frozen 5B embeddings plus random forests beat prior nucleotide models on translation efficiency and protein expression.
- Trained on 130M+ coding sequences from 20,000+ species; 2048-codon context; FP32 weights need a 40GB GPU.
- Apache-2.0 code, NVIDIA Open Model License weights, cleared for commercial use.
Most protein language models receive amino acid sequences after translation has removed the original codons. That preprocessing maps synonymous codons, which encode the same amino acid, to one representation. Those substitutions can still change mRNA structure, translation speed, co-translational folding, and protein yield.
NVIDIA has released two open CodonFM encoder checkpoints that preserve this information by processing coding RNA one codon at a time. The roughly 4.85-billion-parameter models target mRNA design and synonymous variant analysis, including inherited germline variants and tumor-acquired somatic variants. The released files and figures use the EnCodon name within the broader CodonFM family; NVIDIA provides a model card and technical post.
Rare codons change the training recipe
During pretraining, CodonFM learns to recover masked codons from their surrounding sequence. The base checkpoint masks codons uniformly, while the CDWT checkpoint uses codon-frequency-weighted masking that selects rare codons more often. NVIDIA trained both models on more than 130 million protein-coding sequences spanning over 20,000 species and hundreds of billions of tokens.
| Checkpoint | Masking objective | Reported strengths |
|---|---|---|
CodonFM-5B |
Uniform random masking | Zero-shot codon optimization, expression prediction, mRNA design, and somatic variant analysis |
CodonFM-5B-CDWT |
Rare codons receive more masking weight | Species-specific codon selection and germline pathogenicity scoring |
Both checkpoints use 24 transformer layers, a hidden width of 4,096, 32 attention heads, and rotary position embeddings. Their shared architecture isolates the effect of the masking objective when comparing results.
A 6.1 kb coding ceiling
| Parameters | Approximately 4.85 billion |
|---|---|
| Context window | 2,048 tokens |
| Maximum coding input | 2,046 codons |
| Maximum coding length | Approximately 6,138 nucleotides |
| Sequence representation | One token per codon, plus special tokens |
A 2,046-codon limit covers about 6.1 kilobases of coding sequence. Longer coding regions require truncation under the current implementation, which can remove distant context and change a variant score.
Codons multiply the design space
A protein containing amino acids with several synonymous codons can map to an enormous number of coding sequences. Laboratory screens sample only a small fraction of those possibilities, so conventional optimization often relies on species-level codon-frequency tables, GC-content rules, and hand-tuned constraints. CodonFM supplies a learned score that also reflects surrounding sequence context.
In a reported experiment with Arc Institute and Ansa Bio, CodonFM-guided coding sequences increased expression nearly fourfold for green fluorescent protein and twofold for luciferase relative to the natural sequences. The experiment used a human lung cell line, two reporter proteins, and a narrow assay setting, so broader expression claims require additional validation.
Benchmarks span design and disease
Validation loss continued to improve from the smaller CodonFM models through the 5B checkpoints on NVIDIA’s held-out data. That result shows a benefit at the tested scale; it does not establish how much further scaling would help.
| Task | Evaluation set | Reported result |
|---|---|---|
| Germline pathogenicity | 129,384 synonymous ClinVar variants | 5B-CDWT reached an AUROC of about 0.67, compared with roughly 0.61 for the strongest published baseline in the evaluation. |
| Somatic cancer variants | 1,471 curated COSMIC synonymous mutations matched with gnomAD controls | The 5B models outperformed the evaluated alternatives after controls for GC content, trinucleotide context, and gene identity. |
| Translation efficiency | 3,819 ribosome-profiling datasets covering more than 140 human and mouse cell types | Random forests trained on frozen 5B embeddings exceeded the evaluated nucleotide-model baselines. |
| Protein expression | Published expression datasets and reporter assays | Lightweight regressors using frozen embeddings improved on the evaluated baselines without fine-tuning the 5B weights. |
An AUROC of 0.5 corresponds to random ranking and 1.0 to perfect separation, placing the reported ClinVar result above chance but below the standard needed for a stand-alone clinical classifier. Frozen embeddings mean the 5B model weights remain unchanged while a smaller downstream model learns from assay-specific labels.
FP32 weights need 19.4 GB
The GitHub repository publishes the code under Apache 2.0. Model weights use the NVIDIA Open Model License, which permits commercial use subject to its terms.
A single FP32 checkpoint occupies about 19.4 GB before activations, temporary buffers, and input batches consume additional memory. NVIDIA tested the release on A100 hardware and lists Ampere and Hopper GPUs as supported. A 40 GB accelerator provides room for the model and inference overhead, while longer inputs and larger batches increase memory use.
The mutation API masks a selected codon and compares the model’s scores for the reference and alternate codons in context. The preprocessing helper returns one item, while predict_mutation expects a batch, so even single-variant inference requires collation:
import os
import torch
from torch.utils.data import DataLoader
from src.inference.encodon import EncodonInference
from src.data.preprocess.mutation_pred import mlm_process_item
model = EncodonInference(
model_path="./encodon_5b/CodonFM-Encodon-5B-v1.safetensors",
task_type="mutation_prediction",
)
model.configure_model()
model = model.to("cuda").eval()
item = mlm_process_item(
ref_seq=os.environ["CDS"],
codon_position=int(os.environ["CODON_POSITION"]),
ref_codon=os.environ["REF_CODON"],
alt_codon=os.environ["ALT_CODON"],
context_length=2048,
tokenizer=model.tokenizer,
mask_mutation=True,
)
batch = next(iter(DataLoader([item], batch_size=1)))
batch = {
key: value.to("cuda") if torch.is_tensor(value) else value
for key, value in batch.items()
}
with torch.inference_mode():
result = model.predict_mutation(batch)
score = result.likelihood_ratios.item()
In the current benchmark code, a larger positive score favors the reference codon over the alternate codon in that sequence context. The value measures model plausibility; expression direction, molecular mechanism, and causality require separate evidence. Developers should also verify codon-position indexing against the repository revision used in production.
The repository can extract a 4,096-value sequence embedding from the final-layer [CLS] token. That vector can feed a random forest or another lightweight regressor trained on local assay data for translation efficiency, expression, or stability. NVIDIA’s benchmark notebooks use this frozen-embedding workflow, avoiding the memory and data costs of full model fine-tuning.
FASTQ in, variant scores out
NVIDIA’s Genomics Analysis Blueprint extends CodonFM into a GPU workflow for projects that begin with Illumina reads instead of prepared coding sequences:
- Parabricks BWA aligns FASTQ reads to the human reference genome.
- DeepVariant identifies candidate variants from the aligned reads.
- GENCODE annotations map variants to genes and coding positions.
- CodonFM scores coding variants, including synonymous substitutions.
The blueprint handles upstream alignment, calling, and annotation, while CodonFM supplies the final sequence-context score. Production pipelines still need quality control, transcript selection, normalization, and result storage around those components.
Constraints that shape deployment
- Coding sequence only: UTRs, introns, promoters, and non-coding RNAs fall outside the model input, leaving many regulatory effects unmodeled.
- Fixed context: coding regions longer than 2,046 codons are truncated rather than automatically processed in overlapping chunks.
- Research-grade scoring: NVIDIA presents variant scores as research signals. Clinical interpretation requires validated thresholds, orthogonal evidence, and population context.
- Limited cancer benchmark: the COSMIC evaluation contains 1,471 curated mutations, which restricts subgroup analysis.
- Narrow wet-lab validation: the reported expression gains cover two reporter proteins in one human lung cell line.
- Filtered training distribution: sequences from pathogens known to affect humans were excluded, limiting expected performance on related organisms.
Generation remains pending
The current checkpoints rank codons, score variants, and produce embeddings for downstream predictors. NVIDIA says an autoregressive Decodon model is planned for directed sequence generation. Until that model ships, end-to-end design requires an external search process that proposes coding sequences and uses EnCodon scores or assay-trained regressors to rank them.