Beyond ESM2: Graph-Enhanced Protein Sequence Modeling with Efficient Clustering
Shujian Jiao Bingxuan Li Lei Wang Xiaojin Zhang Wei Chen Jiajie Peng Zhongyu Wei

One Subgraph for All: Efficient Reasoning on Opening Subgraphs for Inductive Knowledge Graph Completion
    Zhiwen Xie,
        Yi Zhang, Guangyou Zhou, Jin Liu, Xinhui Tu,  
        and Jimmy Xiangji Huang, Member, IEEE
Zhiwen Xie,Guangyou Zhou and Xinhui Tu are with the School of Computer Science, Central China Normal University, Wuhan, 430079, China. E-mail: {zwxie@ccnu.edu.cn; gyzhou@mail.ccnu.edu.cn; tuxinhui@mail.ccnu.edu.cn}



Yi Zhang is with the Faculty of Artificial Intelligence in Education, Central China Normal University, Wuhan, 430079, China. E-mail: yizhang@mails.ccnu.edu.cn
Jin Liu is with the School of Computer Science, Wuhan University, Wuhan, 430072, China. E-mail: jinliu@whu.edu.cn
Jimmy Xiangji Huang is with the Information Retrieval and Knowledge Management Research Lab, York University, Toronto, Canada. E-mail: jhuang@yorku.ca.
Manuscript received April 19, 2005; revised August 26, 2015.
    April 29, 2024
====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

*Equal contribution. Corresponding authors.
footnote


Proteins are essential to life's processes, underpinning evolution and diversity. Advances in sequencing technology have revealed millions of proteins, underscoring the need for sophisticated pre-trained protein models for biological analysis and AI development. Facebook's ESM2, the most advanced protein language model to date, leverages a masked prediction task for unsupervised learning, crafting amino acid representations with notable biochemical accuracy. Yet, it lacks in delivering functional protein insights, signaling an opportunity for enhancing representation quality.Our study addresses this gap by incorporating protein family classification into ESM2's training.This approach, augmented with  Community Propagation-Based Clustering Algorithm, improves global protein representations, while a contextual prediction task fine-tunes local amino acid accuracy. Significantly, our model achieved state-of-the-art results in several downstream experiments, demonstrating the power of combining global and local methodologies to substantially boost protein representation quality.




§ INTRODUCTION

Proteins are involved in almost all the life activities of organisms, and the study of their sequences, structures, characteristics, and roles is a major area of research in the life sciences in the post-genomic era <cit.>.A protein sequence can be thought of as a string of amino acid letters. The residues, structural domains, and families of amino acids that make up a protein resemble words, phrases, and sentences in human language. Therefore, machine learning methods developed for natural language and other sequences are well suited to the task of predicting proteins <cit.>.Most sequence-based language models [e.g., BERT  <cit.>, XLNet  <cit.>, ELECTRA  <cit.>] are designed to process natural language (with a bias towards English).Considering the notable parallels between protein sequences and the structure of natural language, employing natural language processing <cit.> (NLP) techniques to analyze protein sequences emerges as a logical approach.



Currently, ESM-2 <cit.>, developed by Facebook, is recognized as the most extensive protein sequence language model to date, featuring a sophisticated architecture with 48 layers and over 15 billion parameters. This groundbreaking model is trained on an expansive dataset comprising up to 250 million protein sequences sourced from Uniparc <cit.>, which encompasses 86 billion amino acids <cit.>. The dataset's vast scale mirrors the extensive text corpora used in developing large-scale neural networks for natural language processing, highlighting the model's unmatched breadth and depth. Leveraging this comprehensive base, ESMFold emerges as an innovative 3D protein structure prediction tool, leveraging ESM-2's insights with just a single sequence input to significantly speed up predictions. In cases where it deeply understands sequences, ESMFold achieves atomic-level accuracy, matching or even surpassing leading models like AlphaFold2 <cit.> and RoseTTAFold <cit.>. This efficiency in generating swift, precise predictions from single inputs showcases that a more profound grasp of sequences leads to a better understanding of protein structures.

Challenges accompany ESM-2 and its derivatives like ESMFold, primarily in their reliance on statistical analysis of amino acid compositions to generate amino acid representations. This approach, focused on predicting missing amino acids within contexts, proves adequate for classifying protein families and identifying remote homologies but falls short in capturing the full functional complexity of proteins. Consequently, the unsupervised training method yields protein representations that lack interpretability, underscoring the insufficiency of statistical properties alone to fully elucidate protein functions. Moreover, since the computational complexity is the square of the sequence length and the length of protein sequences is much larger than the text length, and since ESM2 and ESMFold require a large amount of computational resources, the large number of parameters, and the complexity of the computation pose obstacles for researchers who do not have high-performance computing facilities. Additionally, while ESMFold offers promising capabilities in predicting protein structures from single sequences, it struggles with proteins exhibiting complex folding patterns or those necessitating interactions with other molecules for accurate structural and functional modeling, indicating the potential need for integrating additional sequence or molecular information for more precise predictions.In general, our contributions are of three-folds:




  * We have fused graph pre-training with masked language modeling to refine the ESM2 model, achieving unparalleled performance in protein-centric tasks beyond ESM2.
 
  * Our proposed Community Propagation-Based Clustering Algorithm is a novel, resource-efficient training method for graph neural networks.
 
  * We provide a detailed demonstration of the role of the graph network asynchronous information propagation algorithm in the pre-training tasks of protein sequences.






§ RELATED WORK




 §.§ Protein Large Language Models


The technology of language models is currently very popular and being explored for application across a variety of professional domains, including healthcare <cit.>, finance <cit.>, industry <cit.>, education <cit.>, and the judiciary <cit.>. In the healthcare sector, there is a particular focus on AI-based intelligent diagnostics <cit.>, with primary modalities including text, medical imaging, and medical examinations <cit.>. As research delves deeper, it has become evident that understanding the microscopic information, such as genetics and proteins, is crucial for gaining a more profound comprehension of disease processes. 

Proteins, with their sequences of amino acids, exhibit a remarkable resemblance to natural language, where residues and structural domains can be likened to letters and words. This similarity has sparked interest in developing AI methodologies tailored for protein analysis. By leveraging the parallels between the intricate 'language' of proteins and human language, researchers are now turning their attention to AI-driven approaches to better understand and predict protein sequences, which are fundamental to the mechanisms of life. The development of specialized Protein Large Language Models (Prot-LLMs) has significantly advanced with models categorized into encoder-only, decoder-only, and encoder-decoder architectures, each tailored for different protein research applications. Encoder-only models are optimized for predicting protein functions or properties, while decoder-only models focus on protein sequence generation. Central to encoder-only Prot-LLMs is the Transformer encoder architecture, which efficiently translates protein sequences into concise vector representations, crucial for identifying unique protein patterns. Prominent pre-trained protein sequence encoders include ProteinBert <cit.>, ProtTrans <cit.>, PMLM <cit.>, ProtFlash <cit.>, ProtNPT <cit.>, ESM1b <cit.>, ESM-1v <cit.>, and ESM-2 <cit.>. The integration of techniques such as Multiple Sequence Alignment (MSA) with ESM-MSA-1b (MSA Transformer) <cit.> has been instrumental in breakthroughs like AlphaFold2 and AlphaMissence <cit.>.Incorporating 3D structural information has marked a significant progression, exemplified by models like ESM-GearNet <cit.>, SaProt <cit.>, LM-GVP <cit.>, and PromptProtein <cit.>, indicating a shift towards structure-aware pretraining to refine protein representation. Efforts to enhance encoder architectures and training methodologies include self-supervised learning through masked language modeling (MLM) tasks, effectively reconstructing corrupted tokens from contextual cues, with the ESM series leveraging the Transformer encoder architecture, akin to BERT and RoBERTa <cit.>, to predict protein structure and function.



 §.§ Advancements in ESM Models

The field of protein prediction has witnessed transformative advancements through the evolution of Evolutionary Scale Modeling (ESM). A significant leap forward was achieved with the adaptation of the ESM1b model, which now provides highly accurate variant effect predictions for an extensive array of over 40,000 protein isoforms, markedly surpassing the capabilities of conventional methodologies. The introduction of the ESM-2 model represents another milestone, featuring an exponential increase in model parameters from 8 million to an impressive 15 billion. This upscaling has been instrumental in achieving unprecedented accuracy in protein structure prediction, demonstrating the critical role of model complexity in computational protein analysis. Furthermore, the application of ESM models in specialized tasks, such as MHC peptide binding prediction <cit.> and single-sequence protein structure prediction <cit.>, showcases the models' adaptability and effectiveness across diverse research applications. The release of cutting-edge pre-trained models and codes <cit.> specifically designed for protein design, coupled with the recent updates to the ESM Metagenomic Atlas, underscores the continuous efforts toward refining the predictive accuracy and utility of ESM models. Moreover, the integration of LR-ESM in the NetGO 3.0 <cit.> framework for advanced large-scale functional prediction exemplifies the broadening scope of ESM models in providing critical insights into the vast expanse of uncharacterized proteins. Collectively, these advancements not only enhance our understanding of protein functions and interactions but also pave the way for novel discoveries in protein science.


§ METHOD

The masking language task is crucial for the model to discern each amino acid's biochemical traits, while Community Propagation-Based Clustering connects these sequences to the protein's structure and function based on the statistical nature of amino acids. The masked language model deciphers semantics at the residue level, and the clustering approach interprets the entire protein sequence. Together, they meld local and global insights, greatly enhancing protein representation and capturing the intricate relationship between a protein's structure, function, and statistics.Community Propagation-Based Clustering Algorithms, inspired by hierarchical clustering, enable nuanced classification of proteins into detailed families or broader superfamilies, establishing hierarchical relationships. This mimics the organization of communities and towns, where synchronizing tasks among members—akin to information exchange within a network—is managed through regular updates to a central system. This model of synchronization is analogous to the information propagation on a graph, streamlining the integration and coordination of work progress.

 §.§ Community Propagation-Based Clustering 


In Figure <ref>, P1 and P2 are two proteins in family A, and P3 and P4 are two proteins in family B. Together they belong to a superfamily. The black realisation arrows represent the information exchange between the protein nodes and the family nodes they belong to, and this exchange should be executed immediately along with the update of the protein nodes. The red dotted line represents the information exchange between the family node and the superfamily node, which should be time-delayed, i.e., when the update on the family accumulates a certain number of steps before it is performed.What needs to be considered in the Community Propagation-Based Clustering Algorithm is how to design the initial representation of each node and how information is propagated between nodes. For the initial representation of a protein node, this paper uses the average pooling of the protein representation model for the representation of each amino acid residue output as the initial representation of the protein node:

    P = 1/l∑_i=1^lH_i,

where l represents the input sequence length and H_i represents the representation vector of the ith amino acid in the last layer of the protein representation model. In this paper, we use randomly initialised vectors F∈ℝ^d and SF∈ℝ^d as the initial representations of family and superfamily nodes, respectively.

In this paper, link prediction is used as the information propagation algorithm. Specifically, for the input protein representation {P_1, P_2, ... , P_N}, N being the batch size, and the corresponding family node representation {F_1, F_2, ... , F_N} and the superfamily node representation {SF_1, SF_2, ... , SF_N}. The score function S_F(P_i, F_j) is used to evaluate the likelihood of establishing a link between protein node i and protein family node j. The score function S_SF(P_i, SF_j) is used to evaluate the possibility of establishing links between protein nodes and superfamily nodes, and in practice this paper adopts the vector inner product as the score function. It should be ensured that the distribution of the output of the score function conforms to the distribution of the actual graph.

In this paper, Softmax is used to measure the distribution of the score function. Specific:

    ℒ_family = 1/N∑_i=1^N -log Sm(S_F(P_i, F_i)),


    ℒ_superfamily = 1/N∑_i=1^N -log  Sm(S_SF(P_i,SF_i)),

where Softmax() measures the distribution of samples in a batch. The loss representation of the final Community Propagation-Based Clustering Algorithm is:

    ℒ_ commu=wℒ_family+(1-w)ℒ_superfamily,



where w represents the weight magnitude of the two losses.
The Community Propagation-Based Clustering Algorithm proposed in this paper addresses how data with multiple category labels can be incorporated into a pre-trained language model by means of graph pre-training. Although the external manifestation of the algorithm is the propagation of information on a graph, it essentially addresses the problem of hierarchical clustering of data from different categories.


Clustering algorithms, such as hierarchical clustering <cit.> and k-means clustering <cit.>, segment data into classes based on feature similarity, aiming to maximize intra-class similarity and minimize inter-class similarity. In the realm of protein families, this translates to grouping proteins into superfamilies and families, where each family represents a fine-grained cluster and each superfamily a coarse-grained one. This research treats each family as a precise clustering focus, reflecting the need for protein representations to encapsulate the familial information. Hence, we introduce the Community Propagation-Based Clustering Algorithm for a supervised approach to clustering protein sequences, aligning the sequence representation with its familial heritage.A detailed exposition on the algorithm's interpretability is provided in the appendix<ref>.




 §.§ Masked Language Modeling

Intertwined with clustering, the masked language task equips the model to discern individual amino acid biochemical properties. The Community Propagation-Based Clustering Algorithm then takes this a step further, forging connections between amino acid sequences and the protein's structural and functional attributes. These attributes are deeply linked to the statistical properties of amino acids. Together, these twin objectives—masking language tasks and community propagation—create a synergy, reinforcing each other to refine the protein representation quality.
In our methodology, we harness the BERT model's architecture, renowned for its multiple stacked Transformer Blocks, as the encoder for protein sequences. To achieve our dual goals, we deploy two distinct fully connected neural networks to project the encoded protein vectors into separate representation spaces for the masked prediction task and the Community Propagation-Based Clustering Algorithm. Each Transformer Block in the BERT framework features a multi-head self-attention mechanism, recalculating token representations by considering contextual token relationships. Multi-heads permit multiple attention computations, capturing diverse sequence characteristics, followed by concatenation and mapping back to the original input size through a perceptron. The forward propagation network—a classic two-layer fully connected network—serves as an intermediary, transforming representations between layers.

Each token vector encoded by the BERT model will have its loss computed by the mask prediction task and the Community Propagation-Based Clustering Algorithm, respectively, in order to run the stochastic gradient descent algorithm to update all network parameters of the model. Specifically, for the mask prediction task the loss function is computed as:

    ℒ_ MLM = 𝔼_M∑_i∈ M- logp(x_i|x_/M),

For each sequence x={x_1, x_2, ... , x_n}, a set of tokens M to be masked is sampled, and the actual amino acid at each position i is replaced with the mask symbol <mask>. For each masked position, the loss function is set to the negative logarithmic value of the probability of predicting the correct amino acid x_i, taking the sequence x_/M as the context of the protein sequence with the masked portion removed. Intuitively, in order to predict the masked position, the model must identify the correlation between the masked site and the unmasked portion of the sequence. The probability is calculated as:

    p(x_i|x_/M)= Softmax(W_M_j · z_li),

where W_M∈ℝ^d × V is the vocabulary prediction matrix used to map the size of the representation vector of each token to the size of the vocabulary list, V is the size of the vocabulary list, and W_M_j stands for the vector of prediction matrices corresponding to the j word (the correct word corresponding to x_i) in the vocabulary list.

For the Community Propagation-Based Clustering Algorithm this paper uses the link prediction task as the goal, using the average of the token representations at each location as the final representation vector of the protein sequence i.e:

    P = 1/l∑_i=1^lz_li,


where l represents the input sequence length and z_li represents the representation vector of the ith amino acid output from the last layer of BERT. In this paper, we use the randomly initialised vectors F∈ℝ^d and SF∈ℝ^d as the initial representations of family and superfamily nodes, respectively. Assume that all protein sequences involved in a single batch calculation are denoted as {P_1, P_2, ... , P_N}, N being the batch size, and the corresponding family node representation for each protein {F_1, F_2, ... , F_N} and the superfamily node representation {SF_1, SF_2, ... , SF_N}. The score function S_F(P_i, F_j) is used to evaluate the likelihood of establishing a link between protein node i and protein family node j. The score function S_SF(P_i, F_j) is used to evaluate the possibility of establishing links between protein family nodes and superfamily nodes, and in practice this paper adopts the vector inner product as the score function. It should be ensured that the distribution of the score function output matches the distribution of the actual graph.

The final model loss is the sum of the two optimisation objective losses:

    ℒ_ model = ℒ_ MLM + ℒ_ commu.

The specifics concerning the masked language model and the Community Propagation-Based Clustering are elaborated in the appendix<ref>.


§ CONTINUE TRAINING ON ESM2






 §.§ Pre-training Dataset

We obtained the classification data and corresponding amino acid sequences of proteins from two databases, InterPro (<https://www.ebi.ac.uk/interpro/>) <cit.> and UniprotKB (<https://www.uniprot.org/>) <cit.> are two databases to obtain the classification data and corresponding amino acid sequences of the proteins, respectively. interPro classifies each protein into a family and provides predictions of protein structural domains and sites of importance in the protein sequence to analyse the protein function. To classify proteins in this way, InterPro uses prediction models provided by several different databases that make up the InterPro consortium (called member databases). By combining protein features from these member databases into one searchable resource, their individual strengths are exploited to generate a powerful integrated database and diagnostic tool. 

UniProtKB contains the functional information of the proteins and preserves the amino acid sequences of the proteins.UniProtKB consists of two parts:

    
  * The information in this part of the UniProtKB/Swiss-Prot-Database is manually annotated and reviewed, and is therefore of high quality and non-redundant.
    
  * UniProtKB/TrEMBL-The information in this part of the database is computationally annotated by algorithms and is not reviewed, thus providing a high level of coverage of the proteome.

The protein classification data from InterPro and the protein sequence data from UniproKB are finally joined by protein entry numbers to obtain all the training data.

Considering the limitations of local computing resources and the quality of the data, all the proteins from UniProtKB/Swiss-Prot database are finally extracted in this paper, which are all These proteins are all manually annotated and thus representative and highly reliable.

A total of 568744 proteins were obtained from UniProtKB
/SwissProt, and all the obtained proteins were queried for the corresponding protein interfaces in InterPro, and finally 540601 training data were obtained. For each protein, the complete amino acid sequences of all families and superfamilies were recorded. It should be noted that some proteins may lack the corresponding superfamily or family classification information, but they must have one of the two categories, in this case, we will randomly sample to fill in the missing items, for example, if a protein lacks a family category, the model will randomly select one of the superfamily categories as the family category each time it reads the sample. Detailed statistics of the data are given in the table<ref>.





 §.§ Training Details

A 12-layer ESM2 model was used as the protein representation model in the pre-training experiments, which was subjected to knowledge distillation using Tinybert to generate the student model. For the mask prediction task, 15% of the amino acid residues in the protein sequence are randomly selected for replacement, of which 80% are replaced with <mask>, 10% are replaced with a random representation, and the remaining 10% are kept unchanged. For Community Propagation-Based Clustering Algorithm, the weights of family score loss and superfamily score loss were 0.2 and 0.8, respectively. an AdamW was used as the optimiser with a learning rate of 5e-5 .



 §.§ Validation of Protein Representation

The visualisation method demonstrates whether the stability and functional properties possessed by a protein can be deduced from the representation of the model. The stability of a protein is mainly characterised by the biochemical properties of the amino acid residues that make up the protein, whereas the function of a protein is mainly reflected in the proximity of representations of proteins with similar structure and function.In order to investigate whether the model has learnt to encode physicochemical properties in the representation of amino acid residues, this paper uses TSNE to downscale the parameters of the final prediction layer of the network so that they can be plotted onto 2D coordinates. In Fig. <ref>, it is found that the space can clearly distinguish the boundaries between amino acids with different biochemical properties. These biochemical properties include hydrophobicity, polarity, and aromaticity, as well as molecular size and electrode properties, all of which affect the interchangeability of amino acid residues at a site in a protein, i.e., the stability of the protein structure.


A representation of each amino acid residue can be obtained through the final layer of the model, and the final protein can be obtained by averaging these representations. These protein representations project a sequence to a point in space, thus different protein sequences can be distinguished. In this paper, the distribution of homologous genes in space can be studied intuitively in two-dimensional coordinates by TSNE dimensionality reduction. In addition, Principal Component Analysis (PCA) was applied to recover the main direction of change in the representation, and four homologous genes in four species were selected to find the direction of change. In order to exclude the statistical properties of the number of amino acids itself in the amino acid sequence, this paper also introduces the protein representation before untrained and the protein representation using the unitary bag-of-words model. Figure <ref> shows that the modelled protein representations encode structural and functional information about the proteins thereby allowing for a significant aggregation effect of protein representations within the same protein family. 




§ DOWNSTREAM TASK EXPERIMENTS



 §.§ Downstream task introduction

To evaluate the effectiveness of the protein representation model post-pretraining, we established the following downstream tasks based on six different protein aspects: Protein Classification, Protein Activity Prediction, Protein-Protein Interaction, Protein Function Prediction, Mutation Effects, and Homology Testing. For task validation, datasets specific to each task were procured, which were not involved in the training of the protein representation model. The model developed in this study solely generates a numerical vector replete with structural-functional information from the input protein sequences, which is then utilized for the respective downstream tasks. For tasks requiring multiple protein sequences (Protein-Protein Interaction, Mutation Effects, Homology Testing), we adopted an approach of training multiple protein sequences over several iterations. Tasks such as Protein Classification, Protein-Protein Interaction, and Protein Function Prediction necessitate the construction of a multi-layer fully connected neural network and subsequent fine-tuning on a training set. It is important to note that the parameters of the protein representation model proposed in this paper remain constant during the experiments of these downstream tasks. Detailed experimental procedures are provided in the appendix(from appendix<ref> to appendix<ref>).


 §.§ Enhanced Performance in Protein Representation Tasks

The table highlights optimal performances in bold, underscoring that ComproESM—leveraging both mask prediction tasks and the graph network asynchronous information propagation algorithm—surpasses the ESM2 model in a range of downstream tasks. Given ComproESM's integration of protein family data, which encapsulates structural and functional protein information, enhancements in family classification, function prediction, and homology detection are anticipated. Moreover, ComproESM outperforms the ESM2 model in tasks requiring a comprehensive understanding of the biochemical properties of amino acid residues, such as mutation effects, activity prediction, and protein-protein interactions. Ablation studies focusing individually on these tasks further suggest that while targeting specific tasks can yield improvements, a combined approach garners optimal results across all downstream tasks.
Considering both ESM2 and our proposed model are trained on mask prediction tasks, we partitioned data into a training set and test set at a 9:1 ratio. Performance on the mask prediction task is evaluated using the Exponential Cross Entropy Score (ECE), where a perfect model scores 1, and a uniform random prediction across 25 amino acids scores 25. Lower ECE scores indicate superior mask prediction performance. As shown in Table <ref>, our model slightly underperforms the sole MLM model trained on the same dataset, attributed to the incorporation of graph link prediction tasks altering the original protein representation space by integrating protein family data.Further validation of the changes induced by the protein representation is detailed in the appendix<ref>.





 §.§ Protein Classification Model Analysis

In order to analyse the advantages of the model in this paper on the protein classification task even further, the 10 most common protein families were selected from the dataset PF13649.6, PF00560.33,PF13508.7,PF06580.13,PF02397.16,
PF00677.17,PF01035.20,PF02417.15,PF13472.6,
PF00684.19.60 samples of proteins were sampled for each category, of which 50 samples were used for training and 10 samples for testing. The results after 20 epochs of iteration under the same experimental setup are shown in Table <ref>, and it can be found that the accuracy of the model proposed in this paper is much larger than that of the ESM2 model in the training set, which indicates that the protein representation given by the model proposed in this paper has a better decision boundary between the different protein family classes, and so the model can be in training to find this boundary quickly. The confusion matrix of the prediction results is shown in Figure <ref>, which shows that the ESM2 model has a lower prediction accuracy for the proteins in the protein family categories PF13649.6, PF13508.7, and PF13472.6, whereas there is no such bias in the model proposed in this paper, which indicates that the protein representations given in the proposed model are more consistent with the protein family categories than those given in the ESM2 model. protein representation has a more direct correlation with the protein family categories.






§ CONCLUSION


In this paper, we propose ComproESM, and demonstrate the efficacy of integrating protein family classification information with the ESM2 model's training process, thereby enhancing the model's capability to accurately represent global protein structures and predict local amino acid residues. Our innovative Community Propagation-Based Clustering Algorithm, when combined with the masking algorithm, has significantly advanced the model's performance across a spectrum of downstream tasks, far surpassing the capabilities of the ESM2 model with a comparable number of parameters.These findings not only underscore the potential of tailored algorithmic strategies in understanding complex biological data but also pave the way for future research in protein sequence analysis and functional prediction. Through this work, we contribute to the broader field of computational biology by providing a robust framework for protein representation that is sensitive to both the structural and functional nuances of proteins. 





§ LIMITATION


Although this paper achieves optimal performance on various protein downstream tasks, due to the limitation of experimental resources, we does not use the mask prediction task and the Community Propagation-Based Clustering Algorithm to train directly on the randomly initialised Transformer model, but uses the 12-layer model of ESM2 for initialisation. The representation space of the final model trained by this method is highly offset, which means that the model only converges to a locally optimal solution. Meanwhile, the training data taken in this paper only has 500,000 proteins, which is still too small compared to the hundreds of millions of proteins stored in protein databases. In the future, this paper will train the model in this paper from scratch on larger protein sequence data, so as to obtain a higher quality protein representation model.



§ ETHICS CONSIDERATION


Given the profound potential impact of this research on the life sciences and medical fields, several ethical considerations must be taken into account. Firstly, ensuring data privacy is critical, particularly if any human-derived protein sequences are included in the dataset; researchers must handle such data responsibly and with consideration for consent and confidentiality. Additionally, the accessibility of the developed tools and methods should be addressed to prevent exacerbating inequalities in research capabilities across different institutions or countries, especially considering the computational resources required for high-performance models like ESM-2. Moreover, it is imperative to transparently communicate both the capabilities and limitations of the model to avoid misinterpretation or overreliance on its predictions, which could have significant consequences for downstream applications such as drug discovery or personalized medicine. Finally, there should be a commitment to open science by making the methodologies, source code, and potentially the trained model accessible to other researchers, fostering collaboration and accelerating advancements while respecting intellectual property rights.
















§ INTERPRETABILITY OF COMMUNITY PROPAGATION-BASED CLUSTERING ALGORITHMS

In the Community Propagation-Based Clustering Algorithm, the data input to the model is a set of samples {P_1, P_2, ... , P_N}, where N is the batch size, and each sample corresponds to the family category representation {F_1, F_2, ... , F_N} and the superfamily category representation {SF_1, SF_2, ... , SF_N}. For the ith sample P_i of these, Softmax(Z_i) is required to be equal to 1. That is, the score Z_i is required to be as large as possible and the other scores as small as possible. Since Z = w Z_F + (1-w) Z_SF, i.e., the scores Z_F and Z_SF are required to be as large as possible. Take the calculation of Z_F as an example:

    Z_F = P · F.

where P = {p_1, p_2, ... , p_d}, F={f_1, f_2, ... , f_d}, then Z_F can be expressed as:

    Z_F = ∑_j=1^dp_j × f_j,

And if you use the Euclidean distance measure between P, F, the distance distance is given by:

    S = ∑_j=1^d(p_j-f_j)^2/|P||F|, ∑_j=1^d(p_j-f_j)^2/|P||F|,


    |P|^2+|F|^2-2Z_F/|P||F|,

Assuming that the stretching of the vectors does not affect the properties of the vectors themselves, it can be assumed that |P|=|F|=1, and thus the distance S can be expressed as:

    S = 2 - 2Z_F.

It follows that max(Z_F) is equivalent to min(S), in other words the optimisation objective treats the category representation as a clustering centre, and the purpose of the loss function is to bring in closer the distance between nodes within the class and the centre of the class, and to bring out further the distance between nodes outside the class and the centre of the class. The parameters w and size are used to control the coverage of different granularity categories in the representation space.
In order to demonstrate the clustering effect of Community Propagation-Based Clustering Algorithm in a more graphical way, in this paper, 120 random 2-dimensional vectors are initialised using a normal distribution, and each vector corresponds to a fine-grained category and a coarse-grained category, with a total of 30 small categories and 10 large categories. The backpropagation algorithm was used on this randomly generated dataset using Community Propagation-Based Clustering Algorithm until convergence, and finally the representations of all the 2-dimensional vectors were presented on the axes (as shown in Fig. <ref>).



In the graph <ref>, all red nodes represent coarse-grained cluster centres and all blue nodes represent fine-grained cluster centres. The density of the red nodes is less than that of the blue nodes due to the weight parameters w_f and w_s. The rest of the nodes are all nodes in the dataset, nodes belonging to the same coarse-grained level are represented using the same shape, and nodes of the same colour under the same shape represent their same fine-grained category. From the figure, it can be seen that Community Propagation-Based Clustering Algorithm achieves a significant clustering effect and the sample distribution is in accordance with the assumption above, i.e., the stretching of the vectors does not affect the nature of the vectors themselves.



§ MASK LANGUAGE MODEL SETTING DETAILS

The input used by the model is a protein sequence, which is a string of letters where each letter represents a particular amino acid. Also for each protein sequence there is a family class and superfamily class to which the protein belongs, and these labels will be used for subsequent loss function calculations. The model will first obtain a token sequence from the input protein sequences (each letter, i.e., an amino acid, is a token) and add special identifiers <bos> and <eos> at the beginning and the end of the sequence, respectively, and use a masking technique to blur the input so as to force the model to derive the missing token based on the context. 15% of the tokens will be randomly selected and used with the identifier <mask>. A random 15% token is selected and replaced with the identifier <mask>. Note that in order to improve the model's performance, the strategy of replacing the original token with <mask>, replacing it with a random token, and keeping the original token unchanged is implemented in a ratio of 8:1:1 for all the replaced words. The inputs to the model are {x_1, x_2, ... , x_n} where x_i∈ℝ, the first layer of the BERT model is the word encoder, which is to convert the token input after word splitting into a vector input, and here the approach is to use the shaping index corresponding to each token to obtain the corresponding column of vectors in the word encoding matrix. The W_e∈ℝ^d × V and W_p∈ℝ^d × S are the word encoding matrix and position encoding matrix respectively, V is the size of the vocabulary list, S is the maximum length of the input that can be accepted by the model, and d is the size of the representation vector dimension. The vector encoding for each token is the sum of word encoding and position encoding. After word encoding, we obtain {z_01, z_02, ... , z_0n} where z_0i∈ℝ^d. Next these word vectors will be passed through multiple Transformer Blocks, and it should be noted that the inputs and outputs of the Transformer Blocks passing through any of the layers will be of the exact same form, so that the final representation of each token after capturing the contextual information is obtained {z_l1, z_l2, ..., z_ln},wherez_li∈ℝ^d.



§ VERIFY THAT THE PROTEIN REPRESENTATION

In order to further validate the changes produced by the protein representation, in this paper, 1010 pairs of proteins belonging to a family were randomly sampled as positive samples and an equal number of pairs of proteins that do not belong to a protein family were randomly sampled as negative samples, and the similarity between the pairs of proteins was calculated using cosine similarity. The similarity takes values between 0 and 1. The results of the two models are plotted in Figure<ref> and Figure<ref>. 

From the figure, it can be seen that the model proposed in this paper can clearly distinguish between positive and negative samples, and there is still a large part of overlapping space in the distribution of positive and negative samples for ESM2. Therefore, the biggest advantage of the proposed model is that it incorporates family information into the protein representation with little or no loss of the quality of the ESM2 representation, which itself carries the structural and functional information of the protein. Therefore, the protein representations generated using the model proposed in this paper can outperform the original ESM2-generated protein representations for a variety of protein downstream prediction tasks.






§ PROTEIN CLASSIFICATION

Search engines compute target sequences by sequence comparison algorithms to compare them with known sequences in databases to achieve classification, such as BLAST, and the performance of this method is limited by the comparison algorithm. Therefore, the use of machine learning methods to classify protein families based on protein sequences has become a hot research topic in recent years.




In this paper, we obtain the protein classification dataset on Kaggle, and organise the dataset, each sample is composed of protein sequences and their corresponding family names, and count the number of proteins corresponding to each family type (see table <ref> and figure <ref>), and it can be seen from figure <ref>, it can be seen that the number of protein family distributions in this dataset shows a long-tailed distribution, so the top 250 classes of families with the highest number of proteins are taken as the predicted labels, and the final data obtained is 278,866. Considering the time of the test, this paper uniformly samples each class to one percent of the original one, and divides the training set and the test set according to the ratio of 1:1. Finally, 1394 training samples and test samples were obtained, and the model uses the simplest single-layer fully connected neural network to classify the input protein representations and use the classification accuracy for representation quality assessment. The test results are shown in Table <ref>.





§ MUTATION EFFECTS

Masked Language Modelling Objective The training objective of a trained protein language model is to output the probability of an amino acid occurring at a position in a protein given its surroundings. In this paper, we use this property to score mutations in amino acid sequences. For a given mutation, the amino acids in the original protein can be considered as a reference state, and the probability assigned to the mutated amino acid is compared to the probability assigned to the original amino acid thereby deriving the mutation score.

Specifically, the mutation score is evaluated using a log odds ratio at the mutation site, and when multiple mutation sites are present in a protein sequence, the scores at each position are summed using an addition method:

    ∑_t∈ T logp(x_t=x_t^mt|x_/T)- logp(x_t=x_t^wt|x_/T),

Here the sum is summed over all mutation positions, and the sequence input to the model is masked at each mutation position.

Riesselman et al. <cit.> collected a set of 41 deep mutation scans and thus evaluated the model, these scans consisted of assessing the activity of a set of different proteins on various tasks. The experiments corresponded to different measurements in different tasks with different functions being tested. Each deep mutation scan dataset was treated as a separate prediction task and the model was used to score each variant in the dataset. These tasks were divided into a validation set consisting of ten mutation scan datasets and a test set consisting of the remaining datasets. Protein representation quality was assessed by comparing scores to experimental measurements using Spearman rank correlation.

Rank correlation, also known as rank correlation, is a non-parametric statistical method, but does not require a distribution of the original variable. It is suitable for information that does not follow a normal distribution, as well as information where the overall distribution is unknown and the original data is expressed in terms of rank.The Spearman rank correlation coefficient is used to calculate the correlation between two ordered sets of data. The formula for calculation is:

    r_s = 1-6∑d^2_i/n(n^2-1),

where d_i=(x_i-y_i), x_i and y_i denote the position of the two variables after sorting, and n is the total number of samples.

The absolute value of Spearman's rank correlation coefficient is less than 1. The magnitude of the absolute value represents the strength of the correlation, and an absolute value of 1 indicates that the two series are perfectly correlated. When r_s is positive, then the two sequences are positively correlated; when r_s is negative, then the two sequences are negatively correlated.

The correlation between the mutation scores predicted by the model and the mutation scores generated by the real experiment is calculated, and the Pearman rank correlation is used here to return the correction. Correction is closer to 1, which means that the correlation between the two sequences is greater, and in this paper, we use the model to calculate the confusion degree of the amino acid sequences, so as to realise the zero-shot prediction of the activity of the protein. In this paper, we use the model to calculate the perplexity of amino acid sequence to achieve zero-shot prediction of protein activity, and the results are shown in Table <ref>.



§ ACTIVITY PREDICTION

Protein mutations affect the activity of protein function, and protein activity was predicted using linear regression modelling of coded proteins regression, with the mean square error used to assess the prediction. The biological activity of protein mutations is predicted by training a simple mutation prediction network, i.e., using an embedded representation of the protein coding model to the amino acid sequence. In this paper, a simple multilayer perceptron is used to predict the mutation effect of protein sequences. The embedding representations of the dataset are saved by pre-computation. Afterwards a test of the downstream task is completed using these embedding representations and the activity corresponding to each representation.
In this test, the activity of ß-lactamase variants is predicted by training a model. The data was initially obtained from deep mutation scans and published by the Envision paper  <cit.>. The dataset was taken from a fasta , and each entry in the file contains: the mutated ß-lactamase sequence, a residue in which the mutation occurs (exchanged for another amino acid) and a target value corresponding to the activity of the mutated protein, which describes the magnitude of the strength of the protein to act on a function and is a real-valued value. The quality of the protein representation was assessed by comparing the mean square error between the predicted activity values of the model and the experimentally measured activity values, and the results are shown in Table <ref>.



§ PROTEIN-PROTEIN INTERACTIONS

PPIs have so far been studied from different perspectives (e.g. signalling, biochemistry, etc.) using a variety of approaches. Protein-protein interaction networks can then be constructed using this information. The use of machine learning methods to complete the complementation of large PPI networks and to make inference predictions on PPI networks is a major research topic in computational biology. In order to explore whether the protein representation model trained in this paper can embed protein interaction relationships into protein representation, the human protein-protein interaction network <cit.> provided by Stanford University is selected in this paper. This is a protein-protein interaction network that contains physical interactions between proteins in the experimentally recorded human body, such as metabolic enzyme coupling interactions and signalling interactions. The nodes on the graph represent human proteins and the edges represent physical interactions between proteins in human cells (see Table <ref>).


Consider each edge in the table <ref> as a positive example and use the randomly generated edges as negative examples. The final positive and negative examples are divided in the training and test sets in the ratio of 9 : 1, respectively. The two proteins were encoded into vectors with the model separately, spliced and then directly predicted by a binary neural network, with prediction accuracy as the evaluation metric, and the results are shown in Table <ref>.




§ FUNCTION PREDICTION

TheGeneOntology resource (http://geneontology.orgGO) is the most comprehensive and widely used knowledge base on gene function. Therefore, in this paper, we test whether the protein embeddings generated by the protein representation model proposed in this paper can accurately predict the functions of protein sequences by collecting the functional descriptions of proteins from the Gene Ontology database. Functional descriptions corresponding to each class of proteins can be extracted from the protein database, and a total of 39,168 human proteins with 23,666 protein functions contained in all annotations were extracted from the UniprotKB database, and the model is required to accurately predict the correct functional option for a defined protein, given its functional description and three randomly generated functional descriptions. Detailed statistical information about the dataset is given in Table <ref>.

In this paper, we use PubMedBERT <cit.> to obtain a representation of the functional description.PubMedBert is a pre-trained model trained from scratch from a large mixed dataset containing knowledge of a range of biological literature on diseases, drugs, genes, organs, cells, etc. PubMedBert uses masks on all of this data to predict the task. These data were pre-trained using the mask prediction task and fine-tuned and achieved state-of-the-art performance on a variety of tasks such as named entity recognition, PICO, relation extraction, semantic similarity, document classification, knowledge quizzing, and more. Each character-level encoding is obtained by feeding the functional description of the protein into PubMedBert, and all these encodings are averaged to obtain the encoding of the sentence. The sentence representation should contain rich semantic information, and a linear layer is used to project the protein representation into the representation space of the functional description. Afterwards, the similarity between the functional description and the protein representation is computed using vector dot product and the one with the highest similarity is selected as the correct option. The accuracy of selecting the correct option using the model is used as an evaluation metric of how good the protein representation is, and the results are shown in Table <ref>.




§ HOMOLOGY DETECTION


We use SCOPe <cit.> to assess remote homology detection. According to standard practice <cit.>, Rossman-type folds (c.2-2.5, c.27 and 28, c.30 and 31) and four- to eight-bladed propellers (b.66-b.70) were excluded from this paper. Proteins from the same superfamily belong to different families. Vector inner products were used directly to measure the structural and functional similarity of the protein representations, taking the highest 10 scored proteins to consider them as remotely homologous to the target proteins, using the Hit-10 metric, i.e., the proportion of proteins corresponding to the top 10 scores and the target proteins that do belong to the same protein superfamily. The experiments are performed by measuring the density of homologous proteins near the query sequence based on an unsupervised classifier that measures the similarity between protein representations based on the inner product of vectors. For each domain, a vector similarity query will be performed on all other domains and they will be sorted by distance to the query domain. For superfamily level assessment, any domains with the same superfamily and not belonging to the same family are considered as positive examples; any domains with different superfamilies are considered as negative samples. The metrics were measured using Hit-10, which gives the proportion of correctly predicted remote homologues among the ten highest ranked results. The experimental data is consistent with the ESM2 paper, and the final results are shown in Table. <ref>
In order to distinguish the effect of the model more clearly, this paper also increased the difficulty of the experiments by using only protein sequences with sequence similarity below 40% to participate in the experiments, and at the same time, due to the limitation of computational resources, only proteins of the α folding family were used. The experiment verifies that the protein representation can detect remote homology between proteins belonging to the same superfamily (but belonging to different families) as well as between proteins belonging to the same fold (but belonging to different superfamilies). The final sample size of the experiment was 2644, and the correlation between two two proteins was calculated using cosine similarity, and the top 10 proteins were taken as the homologous proteins detected by the model. The final calculations were done separately (Hit@10: the proportion of proteins ranked in the top 10 of similarity that are homologous proteins, Hit@5 and Hit@1), and the final results are shown in Table <ref>, where SF stands for the results on superfamily homology detection, and F stands for the results on folding homology detection.


From Table <ref>, it can be seen that when the sequence similarity of the proteins in the dataset used for testing is reduced to below 40%, the accuracy of the model on the remote homology detection task will be greatly reduced, and the model proposed in this paper performs significantly better than the ESM2 on this task as well.It is argued that this result arises due to the fact that the model proposed in this paper is introduced into the training of the protein family data, the protein representation itself spatially conforms to the reticulation distribution of protein families, in other words, the protein representation contains the functional information of proteins, so that functionally similar proteins can still be recognised better when sequence similarity decreases. Both models perform poorly in protein folding homology detection when sequence similarity decreases, probably because the folding structure of proteins itself is highly correlated with sequence similarity.

