The hidden language of proteins: understanding the evolution of color vision using AI

A popular 2013 webcomic by The Oatmeal sparked a widespread online fascination with the idea that mantis shrimp can see mysterious “shrimp colors” beyond human imagination. Although the story is more complicated than that [1], mantis shrimp, along with other arthropods, can detect a broader range of wavelengths than vertebrates (Fig. 2) [2].

Figure 1. Image by Tumblr user uncharismaticmacrofauna.

Vision depends on light-sensitive proteins called opsins. These proteins convert incoming light into signals that the brain can interpret, and today animals rely on a wide variety of opsins to help them see in diverse and specialized environments. Although all animal opsins descend from a common ancestral gene, arthropod and vertebrate opsins have evolved independently for more than 600 million years, resulting in very different ranges of light detection.

Figure 2. Arthropods (blue) color sensitivity is broader than that of vertebrates (orange). Figure provided by Todd Oakley and Seth Frazer, presented at the SICB 2026 annual meeting.

Like all proteins, opsins are based on a sequence of amino acids whose order determines their shape and function. Much like words in a sentence, changing even a single “letter” (one amino acid) can alter the protein’s function. Because proteins must remain functional, evolution can only explore changes that obey the “grammar” of amino acid sequences. So if these constraints apply to all opsin evolution, then might the vast differences in vision among animals be explained by just slight differences in the starting point of ancient opsin genes? A kind of butterfly effect of protein evolution?

This was the very question that Dr. Todd Oakley, a professor at the University of California, Santa Barbara, and his graduate student Seth Frazer, set out to answer. They used computer simulations and known opsin sequences from living animals to reconstruct the ancestral opsins of both groups. This method allowed them to infer the sequence of these ancient proteins. However, just knowing the ancient sequence of amino acids doesn’t tell us what wavelengths of light the molecule can detect. This is where the researchers turned to artificial intelligence (AI) to help find the answer.

Poring over the literature, they compiled the known light sensitivities of hundreds of different opsins. They used that data to train a machine learning algorithm, which the researchers call OPTICS (Opsin Phenotyping Tool for Inferring Color Sensitivity) [3]. OPTICS predicts an opsin’s peak light sensitivity (λmax) directly from its amino acid sequence, allowing the researchers to estimate the function of both modern and reconstructed ancestral proteins. The researchers then simulated evolution by introducing one amino acid change at a time and used OPTICS to predict the resulting λmax. To avoid generating unrealistic proteins, they used mutations that followed the evolutionary “grammar” observed in nature.

It turns out that the same technology developed to recreate natural language can be applied to recreate (potentially) functional protein sequences. Large language models (LLMs) are AI tools that learn statistical patterns in sequences. While models like ChatGPT are trained on human language, Meta’s Evolutionary Scale Modeling (ESM) model was trained on more than 250 million protein sequences, allowing it to learn the “grammar” of proteins instead. According to Oakley and Frazer, unlike ChatGPT, ESM does not require large data centers to be operational, and they could even run multiple analyses locally on a moderate PC setup, making the model effective at a fraction of the resource cost of other LLMs.

Utilizing ESM, the researchers created a system: they would present the model with an opsin sequence with a single amino acid masked out, and the LLM would predict which amino acid is most likely to be found in that spot. This whole process is similar to how the autocomplete on a smartphone works. Just as your phone wouldn’t suggest “photosynthesis” as the most likely word to come after the phrase “Hello, how are…”, ESM would not suggest any amino acids that had never been observed in such a sequence in nature. The researchers validated this approach by presenting ESM with known, well-conserved opsin sequences, and the model predicted the correct answer with high accuracy every time. Now they could confidently choose reasonable mutations in their evolution simulation.

They simulated 100 evolutionary lineages each for ancestral arthropod and vertebrate opsins, allowing each to accumulate 1,000 acceptable amino acid substitutions before predicting the λmax of the resulting proteins using OPTICS. At the end of the simulations, the results showed that, indeed, the initial architecture of an opsin could restrict its evolutionary trajectory. The arthropod opsins regularly evolved to have a wider range of λmax compared to vertebrates and were able to reach optimum λmax more quickly. All this indicates that for animal opsins, the ancestral starting sequence has a large effect on the diversity of colors modern species can detect.

Along with helping us understand the evolution of color vision in animals, this research also demonstrates the potential AI and LLMs have in assisting basic scientific research. While many LLMs today receive criticism for their large energy costs and use of resources, LLMs like ESM demonstrate that it is possible to provide valuable scientific insight while costing a fraction of the resources. The OPTICS model is similarly non-demanding and is made available to others through the researchers’ GitHub. The researchers hope to continue developing OPTICS and make it a more powerful tool for understanding the function of opsins and other visual systems. The continuous, open-source development of such low-impact, high-yield AI systems will indeed be crucial to the development of science and research in the future and to bringing us closer to one day truly understanding the elusive “shrimp colors”.

[1] Hanne H. Thoen et al., A Different Form of Color Vision in Mantis Shrimp.Science343,411-413(2014).DOI:10.1126/science.1245824

[2] Matthew J. Murphy, Erica L. Westerman; Evolutionary history limits species’ ability to match colour sensitivity to available habitat light. Proc Biol Sci 1 May 2022; 289 (1975): 20220612. https://doi.org/10.1098/rspb.2022.0612

[3] Seth A Frazer, Todd H Oakley, Accessible and robust machine learning approaches to improve the opsin genotype-phenotype map, Molecular Biology and Evolution, Volume 43, Issue 6, June 2026, msag138, https://doi.org/10.1093/molbev/msag138

Author Bio:

Momin Ahmed Khaki is a fourth-year Ph.D. candidate at Iowa State University, working with Dr. Dennis Lavrov to use molecular markers to elucidate the evolution of marine invertebrates. His current work focuses on the evolution and phylogenetics of marine sponges, with a focus on the order Haplosclerida and mitochondrial evolution.