HELM: Hierarchical Encoding for mRNA Language Modeling

Mehdi Yazdani-Jahromi, Mangal Prakash, Tommaso Mansi, Artem Moskalev, Rui Liao

TL;DR

HELM (Hierarchical Encoding for mRNA Language Modeling) is a biologically-aware pre-training strategy that incorporates the hierarchical relationship between codons and amino acids into the loss function. By penalizing "synonymous" errors less than those that change a protein's sequence, HELM achieves state-of-the-art performance in mRNA property prediction and generates more biologically plausible sequences than standard models.

What Problem Does This Paper Address?

Language Models (LMs) have revolutionized our ability to "read" biological sequences like DNA and proteins. However, messenger RNA (mRNA)—the intermediary blueprint that tells cells which proteins to build—presents a unique challenge.

mRNA is organized into codons (triplets of nucleotides). Because the genetic code is "degenerate," multiple different codons can translate into the exact same amino acid, a property known as synonymity. Standard language models treat every incorrect prediction as equally wrong. In the eyes of a typical LM, predicting the wrong codon is a failure, even if that codon would have produced the correct amino acid.

This paper addresses the gap between standard machine learning objectives and biological reality. Existing models fail to account for this hierarchical structure, leading to representations that don't fully capture the nuances of mRNA stability, expression, and function.

Methods

The core innovation is the Hierarchical Cross-Entropy (HXE) loss. Instead of a flat classification task, the authors organize the codon vocabulary into a tree:

  1. Root: All codons.
  2. Functional Groups: Coding vs. Non-coding.
  3. Biological Roles: Start codons, Stop codons, and specific Amino Acids.
  4. Leaves: Individual synonymous codons.
Hierarchical codon tree structure and prediction distribution comparing HELM to standard Cross-Entropy (XE).

During pre-training (using both Masked and Causal Language Modeling), the loss function is modulated based on the "height" of the error in this tree. If the model predicts the wrong codon but the right amino acid, the penalty is lower than if it predicts a codon for a completely different amino acid. This forces the model to learn the "functional" hierarchy of the sequence.

The authors tested this strategy across three popular architectures: Transformers (GPT-2 style), Mamba, and Hyena, ultimately finding that Transformers performed best for the typical lengths of mRNA sequences (~1000 tokens).

Datasets

  • Pre-training: The authors curated a massive, high-quality dataset from the Observed Antibody Space (OAS), resulting in 15.3 million mRNA sequences. This is a significant contribution, as high-quality mRNA-specific datasets are rarer than protein or DNA datasets.
  • Evaluation: The model was benchmarked on seven diverse downstream tasks, including:
  • Ab1 & Ab2: Antibody protein expression levels.
  • iCodon: mRNA thermostability across different species.
  • COVID-19 Vaccine: Degradation labels for vaccine formulations.
  • mRFP & MLOS: Protein production and viral expression levels.
  • Antibody Region Annotation: Identifying signal peptides and constant regions.

Key Insights and Results

  • Biological Priors Matter: You don't necessarily need a bigger model or more data; you need a smarter loss function. By simply aligning the training objective with the genetic code, a 50M parameter model can outperform 100M parameter foundation models.
  • Performance Boost: HELM outperformed standard LMs and existing foundation models (like RNA-FM and CodonBERT) by an average of 8% across property prediction tasks.
Performance comparison of Transformer models trained with standard Cross-Entropy (XE) versus HELM across downstream tasks.
  • Codon Usage Bias: The model is particularly effective on datasets with high "codon usage bias" (where certain synonymous codons are preferred over others). HELM learns these subtle preferences better than "flat" models because it understands that synonymous codons are related but distinct.
  • Generative Plausibility: When asked to "write" new mRNA sequences, HELM produces sequences that are more diverse and better aligned with real-world biological distributions compared to standard cross-entropy models. In generative tasks, HELM showed a 2% to 31% improvement in retaining functional properties.
  • Robustness: The hierarchical approach proved more robust when dealing with "out-of-distribution" sequences, such as those with extreme lengths or high GC-content.

Limitations and Future Work

  • Euclidean Constraints: The hierarchy is currently modeled in Euclidean space. The authors note that hyperbolic spaces are mathematically better suited for representing tree-like structures and could further improve the model's "understanding" of the hierarchy.
  • Sequence Length: While the model handles typical mRNAs well, performance still degrades on extremely long sequences (>2000 nucleotides), likely due to the context window limits of the pre-training data.
  • Data Diversity: Much of the pre-training data is focused on antibodies. While the model generalizes well, expanding the pre-training set to a wider variety of non-antibody mRNAs could enhance its versatility.

Summary updated

BibTeX
@inproceedings{yazdanijahromi2025helm,
  author = {Mehdi Yazdani-Jahromi and Mangal Prakash and Tommaso Mansi and Artem Moskalev and Rui Liao},
  title = {{HELM: Hierarchical Encoding for mRNA Language Modeling}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=MMHqnUOnl0},
}
Figure