OntoProtein: Protein Pretraining With Gene Ontology Embedding

Ningyu Zhang, Zhen Bi, Xiaozhuan Liang, Siyuan Cheng, Haosen Hong, Shumin Deng, Jiazhang Lian, Qiang Zhang, Huajun Chen

TL;DR

OntoProtein is the first general framework to integrate structured biological knowledge from the Gene Ontology (GO) into protein language model pre-training. By jointly optimizing sequence representations and knowledge graph embeddings, the model achieves state-of-the-art results on tasks like protein function prediction and protein-protein interaction.

What Problem Does This Paper Address?

In recent years, "protein language models" (PLMs) like ProtBert and ESM have revolutionized biology by treating amino acid sequences like text. While these models are excellent at capturing the "grammar" of sequences, they are largely "knowledge-blind." They ignore decades of curated biological facts stored in Knowledge Graphs (KGs), such as the Gene Ontology (GO), which describes how proteins function, where they live in the cell, and what biological processes they drive.

The challenge lies in data heterogeneity: how do you fuse a linear sequence of amino acids with a complex, hierarchical graph of biological concepts and their text descriptions? Existing models often struggle with sparse data or complex functional relationships that sequences alone cannot fully explain.

A protein example showing how biological knowledge (Molecular Function, Biological Process, Cellular Component) relates to its sequence and interactions.

Methods

The authors propose OntoProtein, a framework that uses a hybrid approach to bridge the gap between sequences and structured knowledge.

  1. Hybrid Encoder: The model uses two specialized encoders. A Protein Encoder (based on ProtBert) processes amino acid sequences, while a GO Encoder (based on PubMedBERT) processes the text descriptions of GO terms.
  2. Joint Optimization: During pre-training, the model optimizes two objectives simultaneously:
  3. Masked Protein Modeling (MLM): The standard "fill-in-the-blank" task for sequences.
  4. Knowledge Embedding (KE): The model learns to represent biological facts as triples (head, relation, tail) using the TransE algorithm ($h + r \approx t$).
  5. Knowledge-Aware Negative Sampling: To make the contrastive learning more effective, the authors introduced a novel sampling strategy. Instead of comparing a protein to a random biological concept, they sample "hard negatives" from the same GO category (e.g., comparing one molecular function to another). This forces the model to learn the fine-grained nuances that distinguish similar biological roles.
Figure 2: Overview of our proposed OntoProtein, which jointly optimize knowledge graph embed- ding and masked protein model (Best viewed in color.).

Datasets

The researchers introduced ProteinKG25, a massive, newly constructed knowledge graph dataset. It contains:

  • 4,990,097 triples (facts).
  • 612,483 entities (including ~565k proteins and ~47k GO terms).
  • Aligned protein sequences and GO text annotations.

For evaluation, they used the standard TAPE benchmark (Secondary Structure, Contact Prediction, etc.), several Protein-Protein Interaction (PPI) datasets (STRING, SHS27k, SHS148k), and a custom Protein Function Prediction dataset following the CAFA protocol.

Key Insights and Ideas

  • Knowledge as a Prior: Injecting structured biology acts as a powerful inductive bias. The model doesn't just learn that certain amino acids appear together; it learns that those patterns are associated with specific cellular components or functions.
  • Harder is Better: The "knowledge-aware" negative sampling was crucial. By forcing the model to distinguish between closely related GO terms, the resulting embeddings became much more discriminative.
  • Model Agnostic: The OntoProtein framework is plug-and-play. It can be used to enhance almost any existing pre-trained protein language model without changing the underlying architecture during inference.

Key Results

OntoProtein consistently outperformed its sequence-only counterparts:

  • TAPE Benchmark: It surpassed ProtBert in all token-level tests, notably improving Contact Prediction (0.40 vs 0.35 P@L/2) and Secondary Structure (SS-Q3: 0.82 vs 0.81).
  • Protein-Protein Interaction: On the SHS27k dataset, OntoProtein achieved a BFS score of 72.26, significantly higher than the baseline PIPR (44.48) and ProtBert (70.94).
  • Function Prediction: In transductive settings, it improved Biological Process (BPO) prediction by 4% compared to ProtBert.

The authors also visualized the model's attention maps, finding that the "knowledge-enhanced" attention heads align remarkably well with actual physical contact matrices of proteins.

Visualization of attention weights in OntoProtein compared to the actual contact label matrix for a sample protein.

Limitations and Future Work

While promising, the authors noted several areas for improvement:

  • Incremental Gains: Compared to the massive scale of sequence-only models, the performance gains from knowledge injection are currently relatively small.
  • Coverage: ProteinKG25, while large, still only covers a subset of all known proteins. Expanding the KG is a priority.
  • Regression Tasks: The model did not perform as well on protein engineering tasks (like fluorescence or stability prediction). The authors attribute this to a lack of sequence-level objectives in the current pre-training phase.
  • Generative Tasks: Future work will explore using this knowledge-rich approach for protein design and sequence generation.

Summary updated

Abstract

Self-supervised protein language models have proved their effectiveness in learning the proteins representations. With the increasing computational power, current protein language models pre-trained with millions of diverse sequences can advance the parameter scale from million-level to billion-level and achieve remarkable improvement. However, those prevailing approaches rarely consider incorporating knowledge graphs (KGs), which can provide rich structured knowledge facts for better protein representations. We argue that informative biology knowledge in KGs can enhance protein representation with external knowledge. In this work, we propose OntoProtein, the first general framework that makes use of structure in GO (Gene Ontology) into protein pre-training models. We construct a novel large-scale knowledge graph that consists of GO and its related proteins, and gene annotation texts or protein sequences describe all nodes in the graph. We propose novel contrastive learning with knowledge-aware negative sampling to jointly optimize the knowledge graph and protein embedding during pre-training. Experimental results show that OntoProtein can surpass state-of-the-art methods with pre-trained protein language models in TAPE benchmark and yield better performance compared with baselines in protein-protein interaction and protein function prediction. Code and datasets are available in https://github.com/zjunlp/OntoProtein.
BibTeX
@inproceedings{zhang2022ontoprotein,
  author = {Ningyu Zhang and Zhen Bi and Xiaozhuan Liang and Siyuan Cheng and Haosen Hong and Shumin Deng and Jiazhang Lian and Qiang Zhang and Huajun Chen},
  title = {{OntoProtein: Protein Pretraining With Gene Ontology Embedding}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=yfe1VMYAXa4},
}
Figure