Abstract
Messenger RNA (mRNA) plays a crucial role in protein synthesis, with its codon structure directly impacting biological properties. While Language Models (LMs) have shown promise in analyzing biological sequences, existing approaches fail to account for the hierarchical nature of mRNA's codon structure. We introduce Hierarchical Encoding for mRNA Language Modeling (HELM), a novel pre-training strategy that incorporates codon-level hierarchical structure into language model training. HELM modulates the loss function based on codon synonymity, aligning the model's learning process with the biological reality of mRNA sequences. We evaluate HELM on diverse mRNA datasets and tasks, demonstrating that HELM outperforms standard language model pre-training as well as existing foundation model baselines on seven diverse downstream property prediction tasks and an antibody region annotation tasks on average by around 8%. Additionally, HELM enhances the generative capabilities of language model, producing diverse mRNA sequences that better align with the underlying true data distribution compared to non-hierarchical baselines.
Introduction
Messenger RNA (mRNA) serves as the intermediary instruction manual for cellular protein synthesis. While biological sequences are often represented as simple strings of nucleotides (A, C, G, U), mRNA possesses a critical hierarchical structure: every three nucleotides form a codon, and multiple synonymous codons can translate into the same amino acid. Standard Language Models (LMs) typically treat these tokens as independent, penalizing all prediction errors equally. This approach ignores the biological reality that synonymous codon swaps often preserve physical and functional properties. HELM addresses this by integrating biological hierarchy directly into the model's objective function.
Methods: Hierarchical Cross-Entropy
The core innovation of HELM is the application of Hierarchical Cross-Entropy (HXE) during pre-training. Instead of a flat classification task, the 64 possible codons are organized into a tree structure:
- Root: All codons.
- Functional Category: Coding vs. Non-coding (Start/Stop).
- Amino Acid Level: Grouping codons by the amino acid they produce.
- Leaf Level: Individual codons.
During pre-training (using Masked or Causal Language Modeling), HELM modulates the loss based on a mistake's position in this tree. Errors between synonymous codons (same amino acid) are penalized less than errors that change the resulting amino acid. This strategy is architecture-agnostic and was tested across Transformers, Mamba, and Hyena models.
Experimental Results
HELM was pre-trained on 15.3 million mRNA sequences from the Observed Antibody Space (OAS) database and evaluated across seven diverse downstream tasks, including antibody expression, thermostability, and vaccine degradation.
Property Prediction Performance
HELM consistently outperformed standard cross-entropy (XE) baselines and existing foundation models like RNA-FM and CodonBERT. On average, HELM achieved an 8% performance boost across the evaluation suite. Notably, HELM-based models often achieved these gains with significantly fewer parameters than larger, non-hierarchical baselines.
Generative Quality and Annotation
Beyond prediction, HELM improved the generative capabilities of LMs. Generated sequences showed a 2% to 31% reduction in Mean Squared Error (MSE) for property prediction, indicating that HELM-designed mRNA more closely mimics the behavior of natural sequences. In antibody region annotation tasks, HELM significantly improved accuracy by better identifying functional segments like Variable and Constant regions.
Conclusion
By baking biological synonymity into the loss function, HELM aligns language modeling with the functional hierarchy of mRNA. While current implementations use Euclidean space, future work may explore hyperbolic spaces to better represent tree-like biological structures. HELM represents a significant step toward more biologically-aware foundation models for therapeutic applications such as vaccine design and gene therapy.
Summary updated