File size: 24,444 Bytes
0aa19f1
 
 
 
 
41188b5
0aa19f1
 
 
 
 
 
a907429
 
 
0aa19f1
a907429
0aa19f1
a907429
 
0aa19f1
a907429
0aa19f1
 
 
 
 
 
6bb88e2
 
0aa19f1
 
 
 
 
 
 
 
 
 
b81067c
0aa19f1
 
 
6bb88e2
0aa19f1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b81067c
 
0aa19f1
 
6bb88e2
 
0aa19f1
 
 
 
 
 
 
 
 
 
6bb88e2
 
0aa19f1
 
 
 
 
41188b5
 
 
 
0aa19f1
 
 
 
 
 
 
6bb88e2
 
0aa19f1
 
41188b5
 
 
 
 
 
 
b81067c
41188b5
 
b81067c
0aa19f1
b81067c
0aa19f1
b81067c
 
 
 
 
 
0aa19f1
 
 
b81067c
0aa19f1
b81067c
 
 
 
 
 
0aa19f1
 
 
b81067c
0aa19f1
b81067c
0aa19f1
b81067c
0aa19f1
b8e3a30
 
 
 
0aa19f1
b81067c
0aa19f1
b81067c
0aa19f1
 
 
b81067c
0aa19f1
b81067c
0aa19f1
 
 
b81067c
 
 
 
0aa19f1
 
 
 
b81067c
 
 
 
0aa19f1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2859c0e
 
 
0aa19f1
41188b5
0aa19f1
 
 
 
 
 
 
 
 
 
2859c0e
0aa19f1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41188b5
0aa19f1
 
 
 
 
 
 
 
 
 
 
 
2859c0e
0aa19f1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41188b5
0aa19f1
 
41188b5
 
 
 
 
0aa19f1
41188b5
 
 
 
 
 
 
 
 
 
 
 
 
b81067c
 
41188b5
 
0aa19f1
 
 
 
 
 
6bb88e2
0aa19f1
 
 
 
 
 
 
6bb88e2
0aa19f1
 
 
 
 
 
 
 
 
 
6bb88e2
0aa19f1
 
 
 
 
 
 
 
 
6bb88e2
0aa19f1
 
 
 
 
 
 
 
 
 
41188b5
0aa19f1
 
 
 
6bb88e2
0aa19f1
 
 
 
 
 
 
 
6bb88e2
 
0aa19f1
 
41188b5
 
 
 
 
 
 
 
 
 
0aa19f1
 
 
 
b81067c
 
41188b5
0aa19f1
 
 
 
 
 
 
 
 
41188b5
0aa19f1
 
 
 
b81067c
 
 
 
 
 
 
 
 
 
89627b0
b81067c
 
 
0aa19f1
 
 
 
 
 
 
 
 
 
41188b5
0aa19f1
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
---

license: other
license_name: nvidia-open-model-license
license_link: >-
  https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-license/
library_name: codonfm
language:
- en
tags:
- biology
- genomics
- rna
- dna
- codon
- encodon
- codon-optimization
- synonymous-variants
- variant-effect-prediction
- protein-expression
- translation-efficiency
- mrna-design
- foundation-model
- masked-language-modeling
---


<!-- Typographic wordmark, accepted as-is. Swap in a design asset here if one is ever produced. -->
<p align="center">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/nvidia/CodonFM-Encodon-5B-v1/resolve/main/assets/codonfm-wordmark-dark.svg">

    <img src="https://huggingface.co/nvidia/CodonFM-Encodon-5B-v1/resolve/main/assets/codonfm-wordmark.svg" width="300" alt="CodonFM">

  </picture>

</p>


<p align="center"><strong>Reading mRNA in its own language, one codon at a time.</strong><br>NVIDIA Biological Sciences</p>

<p align="center">
  <a href="https://github.com/NVIDIA-BioNeMo/CodonFM">Code</a> ·
  <a href="https://research.nvidia.com/labs/dbr/assets/data/manuscripts/nv-codonfm-preprint.pdf">Preprint</a> ·
  <a href="https://huggingface.co/collections/nvidia/codonfm">All CodonFM models</a> ·
  <a href="https://catalog.ngc.nvidia.com/orgs/nvidia/teams/clara/models/nv_codonfm_encodon">NGC</a> ·
  <a href="https://developer.nvidia.com/blog/boost-protein-expression-and-predict-variant-effects-with-codonfm-5b">Blog</a>
</p>

<p align="center">
  <img src="https://huggingface.co/nvidia/CodonFM-Encodon-5B-v1/resolve/main/assets/codonfm-hero.svg" width="1060" alt="Three mRNA strands encoding the same protein, differing only at one leucine codon: CUU, CUC and CUA, highlighted in yellow, tan and blue. Each passes through stylised model layers and emerges as a protein structure tinted to match its codon, showing that synonymous choices change the outcome.">
</p>

# CodonFM-5B

CodonFM is a family of open RNA foundation models that read protein-coding sequences at **codon**
resolution. Most protein models treat synonymous codons (the different three-letter words that
encode the same amino acid) as interchangeable, discarding the signal they carry. CodonFM keeps
it, learning the context-dependent grammar of codon usage from evolution-scale data.

That grammar is shaped by GC content, tRNA availability, RNA structure and host or tissue context,
and it shows up in translation efficiency, RNA stability, protein folding and pathogenic
synonymous variants. From coding sequence alone, CodonFM recovers synonymous variant effects,
missense pathogenicity and mRNA properties.

CodonFM-5B is the largest member of the family. It is released together with
[CodonFM-5B-CDWT](https://huggingface.co/nvidia/CodonFM-Encodon-5B-CDWT-v1), which is pretrained with
codon-frequency-weighted masking instead of uniform random masking. To learn more see
[What are the two training objectives?](#what-are-the-two-training-objectives)

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/nvidia/CodonFM-Encodon-5B-v1/resolve/main/assets/codonfm-overview-dark.svg">
  <img src="https://huggingface.co/nvidia/CodonFM-Encodon-5B-v1/resolve/main/assets/codonfm-overview.svg" width="1060" alt="A coding sequence tokenised two ways. Amino-acid models collapse the synonymous codons GAA and GAG into a single token E, losing the distinction. CodonFM keeps each codon as its own token, which feeds codon optimization, variant effect prediction and sequence embeddings.">
</picture>

## Why codon resolution matters

A synonymous substitution is often called a silent mutation, because the protein it encodes is
unchanged. It is rarely silent in practice. Swapping a common leucine codon for a rare one leaves
the amino acid sequence identical while changing how the transcript folds, how quickly the
ribosome moves along it, and whether the finished protein folds correctly.

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/nvidia/CodonFM-Encodon-5B-v1/resolve/main/assets/codonfm-consequences-dark.svg">
  <img src="https://huggingface.co/nvidia/CodonFM-Encodon-5B-v1/resolve/main/assets/codonfm-consequences.svg" width="1060" alt="A synonymous change from CTA to CTG keeps the same amino acid but triggers three downstream consequences: mRNA structure instability shortens mRNA half-life, affecting how much protein is made; altered translational kinetics disrupt folding rhythm, affecting how fast it is made; protein misfolding and aggregation cause loss of function or toxicity, affecting whether it works at all.">
</picture>

A model that tokenises to amino acids cannot represent the left-hand side of that picture, so it
cannot reason about any of the consequences on the right.

The second problem is scale. Because most amino acids have several codons, the same protein can be
encoded by an immense number of different coding sequences without altering a single residue. A
wet-lab cycle tests a few dozen constructs, so the search has always been settled by frequency
tables or expert intuition. Getting
it right matters: a major cliff in RNA-based therapeutic design is reaching good protein expression
at tolerable doses, and an exceptionally well-designed protein still fails if it cannot be produced
in the cell type you need it in.

## What makes CodonFM work

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/nvidia/CodonFM-Encodon-5B-v1/resolve/main/assets/codonfm-pillars-dark.svg">
  <img src="https://huggingface.co/nvidia/CodonFM-Encodon-5B-v1/resolve/main/assets/codonfm-pillars.svg" width="1060" alt="Three ingredients make CodonFM work: evolutionary data from over 130 million coding sequences across more than 22,000 species; a codon-level model that captures synonymous codon usage; and downstream validation on protein expression, translation efficiency and variant effect.">
</picture>

## Where to start

| If you want to | Go to |
|---|---|
| Run something now | [Quick start](#quick-start) |
| Choose between the two 5B models | [Which model should I use?](#which-model-should-i-use) |
| Score variants starting from sequencing data | [From a sequencer to scored variants](#from-a-sequencer-to-scored-variants) |
| Know exactly what the model takes and returns | [What are the inputs and outputs for the model?](#what-are-the-inputs-and-outputs-for-the-model) |
| See the evidence that scale helps | [What scaling to 5B buys you](#what-scaling-to-5b-buys-you) |

## Model Architecture

| Model Name | Parameters |
|---|---|
| Encodon-80M | 7.68 × 10⁷ |
| Encodon-600M | 6.09 × 10⁸ |
| Encodon-1B | 9.11 × 10⁸ |
| Encodon-Cdwt-1B | 9.11 × 10⁸ |
| Encodon-5B | 4.85 × 10⁹ |
| Encodon-5B-CDWT | 4.85 × 10⁹ |

## Which model should I use?

| Model | Params | Masking | Benefits |
|---|---|---|---|
| [CodonFM-5B](https://huggingface.co/nvidia/CodonFM-Encodon-5B-v1) ★ | 5B | Random | Best for zero-shot prediction valuable for codon optimization and mRNA design, expression prediction and somatic variant analysis |
| [CodonFM-5B-CDWT](https://huggingface.co/nvidia/CodonFM-Encodon-5B-CDWT-v1) | 5B | Codon-frequency-weighted | Valuable for species-specific differences and **germline** variants. |
| [Encodon-1B](https://huggingface.co/nvidia/NV-CodonFM-Encodon-1B-v1) | 911M | Random | Smaller model needed for fine-tuning or post-training |
| [Encodon-Cdwt-1B](https://huggingface.co/nvidia/NV-CodonFM-Encodon-Cdwt-1B-v1) | 911M | Codon-frequency-weighted | Smaller model needed for fine-tuning or post-training and more valuable for species-specific differences |
| [Encodon-600M](https://huggingface.co/nvidia/NV-CodonFM-Encodon-600M-v1) | 609M | Random | Smaller model for fine-tuning or post-training |
| [Encodon-80M](https://huggingface.co/nvidia/NV-CodonFM-Encodon-80M-v1) | 77M | Random | Smallest model for fine-tuning or post-training |

All CodonFM models are listed in the [CodonFM collection](https://huggingface.co/collections/nvidia/codonfm).

## What are the two training objectives?

Each pretraining method for the 5B models offers unique advantages for the resulting models.

**CodonFM-5B** uses uniform random masking of codons, where all codons are weighted equally, regardless of how often they appear in the pretraining corpus.

**CodonFM-5B-CDWT** weights the masking according to usage bias instead: the rarer a codon is
within its taxonomic group, the more often it is hidden during training. This pushes the model to
learn rare-codon usage in certain sub-contexts of sequences, which allowed it to better capture
species-specific functional codon selection and improved germline pathogenicity scoring.

## What are the inputs and outputs for the model?

Because CodonFM can be used for a variety of capabilities, the model can be used in a number of tasks illustrated in the notebooks.

### Input

A protein-coding sequence (CDS): uppercase `A`/`C`/`G`/`T`.

The model tokenises by codon (sequences must be divisible by 3), with a default context window of 2048 tokens including the start and separator tokens.

### Files in

- **Input Type(s):** Text (mRNA Sequence)  
- **Input Format:** fasta files converted to memmaps 
- **Input Parameters:** 1D 
- **Other Properties Related to Input:** mRNA sequence represented as a string of codons, of maximum length 2046. Longer sequences are automatically truncated to this length


### Files out

- **Output Type(s):** Other: mRNA Sequence 
- **Output Format:** Text 
- **Output Parameters:** 2D 
- **Other Properties Related to Output:** Numeric 2D tensor with floating-point values representing probabilities of a given codon at each masked position within the sequence


### What a variant score does not tell you

The likelihood ratio says how probable the alternate codon is in context, and a larger positive
value means the model finds it less plausible. It does **not** predict whether expression goes
up or down, and it is a research signal rather than a clinical call.

## Quick start

### 1. Set up the environment

```bash

git clone https://github.com/NVIDIA-BioNeMo/CodonFM

cd CodonFM

bash run_dev.sh

```

`run_dev.sh` builds the development image from the repository's `Dockerfile` and drops you into a
shell, with GPU access and your local code mounted at `/workspace`. It needs Docker and the
NVIDIA container toolkit. Pass `--data-dir` and `--checkpoints-dir` to mount your own paths.

### 2. Download the weights

```bash

hf download nvidia/CodonFM-Encodon-5B-v1 --local-dir ./encodon_5b

```

That gives you `CodonFM-Encodon-5B-v1.safetensors` and `config.json`. Point `model_path` at the
`.safetensors` file itself, not at the directory: the loader rejects a directory, and it reads
`config.json` from alongside the file.

### 3. Score a synonymous variant

Does a silent mutation matter? This scores a GAA → GAG substitution, where both codons encode glutamate,
by the ratio of the model's likelihoods for the two codons in context.

```python

import torch

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()



cds = "ATGGAATTTTAA"

variant = mlm_process_item(

    ref_seq=cds,

    codon_position=1,          # Zero-based codon index.

    ref_codon="GAA",

    alt_codon="GAG",

    context_length=2048,

    tokenizer=model.tokenizer,

    mask_mutation=True,

)

batch = {

    k: torch.as_tensor(v, device="cuda").unsqueeze(0)

    for k, v in variant.items()

}



with torch.inference_mode():

    score = model.predict_mutation(batch).likelihood_ratios.item()



print(f"Synonymous variant score: {score:.6f}")

```

### 4. Extract embeddings

The third thing the model gives you is a vector per sequence: the `[CLS]` representation from
the final layer. These are the input to your own regressor when you have assay data of your own
and want to predict translation efficiency, expression or stability from sequence.

```python

import numpy as np

import torch

from src.inference.encodon import EncodonInference

from src.data.preprocess.codon_sequence import process_item



model = EncodonInference(

    model_path="./encodon_5b/CodonFM-Encodon-5B-v1.safetensors",

    task_type="embedding_prediction",

)

model.configure_model()

model = model.to("cuda").eval()



sequences = ["ATGGAATTTTAA", "ATGGAGTTTTAA"]

items = [process_item(s, context_length=2048, tokenizer=model.tokenizer)

         for s in sequences]

batch = {k: torch.as_tensor(np.stack([it[k] for it in items]), device="cuda")

         for k in items[0]}



with torch.inference_mode():

    embeddings = model.extract_embeddings(batch).embeddings



print(embeddings.shape)        # (2, 4096): one 4096-wide vector per sequence

```

Extracting them is only half the job. The repository's notebooks
`4-EnCodon-Downstream-Task-riboNN`, `5-EnCodon-Downstream-Task-mRFP-expression` and
`6-EnCodon-Downstream-Task-mRNA-stability` show the other half: fitting a light regressor on
frozen embeddings, which is how the benchmarks above were produced.

For variant scoring at scale and the downstream expression tasks, see the
[notebooks](https://github.com/NVIDIA-BioNeMo/CodonFM/tree/main/notebooks) in the repository.

## From a sequencer to scored variants

The quick start above begins with a coding sequence, which assumes you already have one. Most
work starts further back, with reads off a sequencer, and getting from there to a CDS is the bulk
of the job.

The [variant effect prediction notebook](https://github.com/NVIDIA-AI-Blueprints/genomics-analysis/blob/main/notebooks/variant_effect_prediction.ipynb)
in the [Genomic Analysis Blueprint](https://build.nvidia.com/nvidia/genomics-analysis), written by
Gary Burnett and Fan Cao, covers that whole span on GPU:

| Stage | What happens |
|---|---|
| 1. Variant calling | Raw Illumina FASTQ reads aligned to the human reference with Parabricks BWA, then variants called with DeepVariant |
| 2. Gene annotation | GENCODE processed to pull out protein-coding sequences, and the called variants mapped onto genes and transcripts |
| 3. Effect prediction | Each variant scored with CodonFM, synonymous ones included |

Stage three is what this page documents. Stages one and two are what make it usable on data you
actually have, rather than on a coding sequence you were already holding.

It runs on GPU and needs the Parabricks container. The dataset that ships with it is small, a
worked example rather than a realistic cohort.

## What scaling to 5B buys you

### Scale buys comprehension

Validation loss keeps falling with model size, and the 5B models separate clearly from the rest
of the family rather than converging with them.

<img src="https://huggingface.co/nvidia/CodonFM-Encodon-5B-v1/resolve/main/assets/fig1-validation-loss.png" width="1060" alt="Validation loss against training samples seen, for EnCodon 80M, 600M, 1B, 1B CDWT, 5B and 5B CDWT. Every model's loss falls as training continues, and the 5B models sit lowest throughout, reaching about 1.95 against roughly 2.25 for 1B and 2.9 for 80M.">

*Figure 1. Larger EnCodon models achieve lower validation loss as training continues.*

That shows up directly as fewer synonymous mix-ups. Codon confusion, how often the model
mispredicts one synonymous codon for another, falls steadily with scale across almost every
amino acid.

<img src="https://huggingface.co/nvidia/CodonFM-Encodon-5B-v1/resolve/main/assets/fig2-codon-confusion.png" width="1060" alt="Heatmap of synonymous codon confusion by amino acid for each EnCodon model size. Darker green means less confusion. Rows grow darker from EnCodon 80M at the top through to 5B and 5B CDWT at the bottom.">

*Figure 2. Synonymous codon confusion across model scales. Darker green is a lower confusion

score, so larger models show a firmer grip on codon usage.*

### Variant interpretation

Across 129,384 synonymous variants in ClinVar, the 5B models give the highest AUROC for
separating pathogenic from benign, and **5B-CDWT leads**, so the rare-codon weighting earns its
place on this germline task.

<img src="https://huggingface.co/nvidia/CodonFM-Encodon-5B-v1/resolve/main/assets/fig3-clinvar-auroc.png" width="1060" alt="Box plot of AUROC for distinguishing pathogenic from benign matched synonymous variants. EnCodon 5B CDWT is highest at about 0.67, followed by 5B, then 1B CDWT and 1B near 0.62, with SOTA-Best-1 at about 0.61 and EnCodon 80M lowest at about 0.51.">

*Figure 3. CodonFM 5B CDWT and 5B achieve the highest AUROC for separating pathogenic from

benign synonymous variants in ClinVar.*

The same holds for somatic mutations. Across 1,471 cancer-observed synonymous variants matched
between COSMIC and gnomAD, the larger models beat both the PhyloP conservation score and the best
published model on this benchmark. CodonFM also recovers known loss-of-function synonymous
mutations in *KRAS*.

<img src="https://huggingface.co/nvidia/CodonFM-Encodon-5B-v1/resolve/main/assets/fig4-cosmic-cancer.png" width="1060" alt="Two box plots comparing COSMIC synonymous mutations against matched gnomAD common variants. On the Mann-Whitney U test the 5B models reach about 10 on the negative log-10 p scale against roughly 6 for 1B, 2 for PhyloP and 1.5 for SOTA-Best-2. The AUROC panel shows the same ordering.">

*Figure 4. Across 1,471 curated cancer-observed synonymous variants, larger EnCodon models

outperform the PhyloP conservation score and the best state-of-the-art model on this test.*

Separately, on de novo variant prioritization across three trio-sequenced disease cohorts,
including 42,607 autism cases and 2,871 congenital heart disease probands, CodonFM gives the
best separation of disease from control, from coding sequence alone.

### mRNA design

Random forests trained on **frozen** 5B embeddings beat the strongest published nucleotide models on both
translation efficiency (>140 human and mouse cell types drawn from 3,819 ribosome profiling
datasets) and protein expression (1,459 synonymous CDS variants with an *E. coli* readout), with
no fine-tuning.

<img src="https://huggingface.co/nvidia/CodonFM-Encodon-5B-v1/resolve/main/assets/fig5-te-expression.png" width="1060" alt="Two bar charts of Spearman correlation. On mRNA translation efficiency, EnCodon 5B CDWT and 5B lead at about 0.72, ahead of SOTA-Best-1 at roughly 0.69 and SOTA-Best-3 at 0.52. On mRFP expression, EnCodon 5B and 5B CDWT lead at about 0.73, ahead of SOTA-Best-3 at 0.68 and SOTA-Best-1 at 0.55.">

*Figure 5. Random forest performance on frozen zero-shot embeddings, for translation efficiency

(RiboNN Spearman ρ) and mRFP protein expression (Spearman ρ on a held-out test set). The 5B models

lead on both.*

### Where it gets used

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/nvidia/CodonFM-Encodon-5B-v1/resolve/main/assets/codonfm-applications-dark.svg">
  <img src="https://huggingface.co/nvidia/CodonFM-Encodon-5B-v1/resolve/main/assets/codonfm-applications.svg" width="1060" alt="Optimized coding sequences from CodonFM feed CAR-T immunotherapy, tumour profiling, vaccine efficacy and peptide manufacturing.">
</picture>

## Where to go next

| If you want to | Go here |
|---|---|
| Run CodonFM on your own sequencing data | [From a sequencer to scored variants](#from-a-sequencer-to-scored-variants), above |
| Reproduce the benchmarks above | The [evaluation notebooks](https://github.com/NVIDIA-BioNeMo/CodonFM/tree/main/notebooks): zero-shot variant scoring, translation efficiency, expression and stability |
| Understand the method | The [preprint](https://research.nvidia.com/labs/dbr/assets/data/manuscripts/nv-codonfm-preprint.pdf) |
| Use a smaller or earlier model | The [CodonFM collection](https://huggingface.co/collections/nvidia/codonfm) |
| Read the background | The [original CodonFM blog](https://developer.nvidia.com/blog/introducing-the-codonfm-open-model-for-rna-design-and-analysis/) |

## Hardware and software

| | |
|---|---|
| **GPU memory** | The checkpoint is FP32, so the weights alone occupy 19.4 GB before activations. Plan for a 40 GB card or larger |
| **Tested on** | NVIDIA A100. Supported microarchitecture compatibility: NVIDIA Ampere and NVIDIA Hopper |
| **Base image** | `nvcr.io/nvidia/pytorch:26.09-py3`, pinned by digest in the repository's Dockerfile. Python 3.12 |
| **OS** | Linux |

## Limitations

- CodonFM models protein-coding sequences only. It does not model UTRs, introns or non-coding RNA,
  so regulatory effects outside the CDS are out of scope.
- Context is capped at 2,046 codons; longer transcripts are truncated.
- Predictions are computational hypotheses. Designed sequences and variant calls need
  experimental validation before use in research or clinical decisions.
- Training data excludes human-affecting pathogen sequences, for biosafety.

The formal model card, with the full Model Card++ bias, explainability, safety and privacy
subcards, is on [NGC](https://catalog.ngc.nvidia.com/orgs/nvidia/teams/clara/models/nv_codonfm_encodon).

## Ethical Considerations

NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse.

For more detailed information on ethical considerations for this model, please see the Model Card++ Bias, Explainability, Safety & Security, and Privacy Subcards.

Users are responsible for ensuring the physical properties of model-generated molecules are appropriately evaluated and comply with applicable safety regulations and ethical standards.

CodonFM optimizes or scores a coding sequence that the user supplies. It does not propose biological payloads, and it provides no guidance on synthesizability or immunogenicity. Determining whether a designed sequence can be manufactured, and how it will behave in a biological system, remains the responsibility of the user.

Users designing sequences for synthesis are encouraged to screen them with [SecureDNA](https://securedna.org/). SecureDNA screens DNA, so RNA sequences should have U converted to T before submission; and it detects hazards by exact match against a database of known hazardous sequences and their predicted functional variants, so it will not flag a genuinely novel agent with no homology to a listed hazard. This is guidance for users rather than a control that NVIDIA applies to model outputs.

Please report model quality, risk, security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).

## License

Code is released under Apache-2.0. Model weights are governed by the
[NVIDIA Open Model License Agreement](https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-license/).
Ready for commercial and non-commercial use.

## Citation

```bibtex

@article{codonfm_2025,

  author = {Darabi+, Sajad and Cao+, Fan and Naghipourfar+, Mohsen and Rabhi, Sara and

            Sethia, Ankit and Gion, Kyle and Grewal, Jasleen and Cohen, Jonathan and

            Greenleaf, William and Goodarzi*, Hani and Sundaram*, Laksshman},

  title  = {{Learning the language of codon translation with CodonFM}},

  url    = {https://research.nvidia.com/labs/dbr/assets/data/manuscripts/nv-codonfm-preprint.pdf},

  year   = {2025}

}

```

Sajad Darabi, Fan Cao and Mohsen Naghipourfar are equal contributing first authors.
Corresponding authors: Hani Goodarzi and Laksshman Sundaram.

## Contact

Questions and correspondence: nv-codonfm@nvidia.com