bioRxiv · 10.1101/2025.08.19.671089
Advancing Codon Language Modeling with Synonymous Codon Constrained Masking
Abstract
Codon language models offer a promising framework for modeling protein-coding DNA sequences, yet current approaches often conflate codon usage with amino acid semantics, limiting their ability to capture DNA-level biology. We introduce SynCodonLM, a codon language model that enforces a biologically grounded constraint: masked codons are only predicted from synonymous options, guided by the known protein sequence. This design disentangles codon-level from protein-level semantics, enabling the model to learn nucleotide-specific patterns. The constraint is implemented by masking non-synonymous codons from the prediction space prior to softmax. Unlike existing models, which cluster codons by amino acid identity, SynCodonLM clusters by nucleotide properties, revealing structure aligned with DNA-level biology. Furthermore, SynCodonLM outperforms existing models on 6 of 7 benchmarks sensitive to DNA-level features, including mRNA and protein expression. Our approach advances domain-specific representation learning and opens avenues for sequence design in synthetic biology, as well as deeper insights into diverse bioprocesses.
Source connections
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Heuschkel, J., Kingsley, L., Pefaur, N., Nixon, A., Cramer, S.. 2025-08-24. Advancing Codon Language Modeling with Synonymous Codon Constrained Masking. https://doi.org/10.1101/2025.08.19.671089
Cite the original work for its findings. Save a collection to share your selection of sources.