Language Model Analysis for Ontology Subsumption Inference

Yuan He, Jiaoyan Chen, Ernesto Jiménez-Ruiz, Hang Dong, Ian Horrocks

Introduction

The integration of formal logic with modern natural language processing (NLP) remains a significant challenge. While large language models (LMs) have demonstrated remarkable capabilities in general natural language inference, their ability to handle the rigorous, hierarchical relationships defined in formal ontologies is less understood. This research introduces ONTOLAMA, a framework designed to probe how well LMs can perform "Subsumption Inference" (SI)—the task of determining if one complex concept logically entails another within a formal Description Logic (DL) framework.

The ONTOLAMA Framework

The authors frame ontology reasoning as a binary classification task. Given a premise and a hypothesis derived from an ontology, the model must decide if a subsumption relationship ($C \sqsubseteq D$) exists.

Overview of the ONTOLAMA framework, illustrating the pipeline from ontology sample extraction to verbalization and language model inference.

Recursive Concept Verbaliser

A core component of ONTOLAMA is a novel tool that translates complex logical expressions into natural English. Formal ontologies often use operators like intersection ($\sqcap$), union ($\sqcup$), negation ($\neg$), and existential/universal quantifiers ($\exists, \forall$). The verbaliser recursively transforms these into readable sentences. For example, a complex medical definition might be translated into "meat that derives from some cattle and is part of only continuant."

Negative Sampling

Creating negative samples in ontologies is complicated by the Open World Assumption, where the absence of a statement does not imply its falsehood. To address this, the authors developed a method based on "Assumed Disjointness" to generate challenging negative examples, ensuring the models are tested on more than just surface-level patterns.

Experimental Setup and Datasets

The study utilized four diverse ontologies to construct SI datasets:

  • Schema.org: General web-based schema.
  • DOID: Human Disease Ontology.
  • FoodOn: Food-related knowledge.
  • GO (Gene Ontology): Fine-grained biomedical knowledge.

Tasks were divided into Atomic SI (simple named concepts) and Complex SI (involving logical operators). For benchmarking, the models were also tested on biMNLI, a binary version of the standard Multi-Genre Natural Language Inference dataset.

Key Results and Insights

The experiments, conducted using the RoBERTa family of models in zero-shot and K-shot settings, revealed several critical findings.

The Zero-Shot Gap

In zero-shot settings ($K=0$), LMs perform significantly better on general NLI tasks (biMNLI) than on formal Subsumption Inference. This suggests that the background knowledge acquired during pre-training aligns more closely with human linguistic patterns than with formal logical entailment. Even domain-specific models (e.g., trained on PubMed) did not show a significant advantage in zero-shot logic tasks within their domain.

The "Fast Learner" Phenomenon

Despite mediocre zero-shot performance, the models demonstrated a remarkable ability to learn logical structures from very few examples.

Accuracy across various datasets as a function of the number of samples per classification label (K).

As shown in the figure above, moving from 0 to 32 samples often resulted in an accuracy jump of 20-30%. By $K=128$, RoBERTa-large achieved over 91-93% accuracy across all Atomic SI tasks. In fully supervised settings, performance reached near-perfect levels (95-98%), indicating that the verbalized logic is inherently learnable by transformer architectures.

Complexity and Scale

Logical complexity poses a significant challenge. On the Gene Ontology (GO), zero-shot performance on complex logic was near random (50.4%), though it eventually scaled with more data. Furthermore, model size proved critical, with RoBERTa-large consistently outperforming RoBERTa-base, particularly as logical complexity increased.

Conclusion

This research demonstrates that while current LMs are not "born" logicians, they are exceptionally fast learners of formal logical structures when those structures are appropriately verbalized. The findings suggest that future work should focus on training LMs with explicit logical semantics, potentially leading to more robust models for specialized tasks like ontology matching and entity linking with minimal training data.

Summary updated

BibTeX
@inproceedings{he2023language,
  author = {Yuan He and Jiaoyan Chen and Ernesto Jiménez-Ruiz and Hang Dong and Ian Horrocks},
  title = {{Language Model Analysis for Ontology Subsumption Inference}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.findings-acl.213},
}
Figure