How Ontologies Boost Large Language Models: A Comprehensive Review

This review examines how formal knowledge representations (ontologies) can be integrated with large language models to enhance reasoning, reduce hallucinations, and improve factual reliability, outlining three roles—information provider, reasoner, validator—while analyzing recent frameworks, open‑source projects, and future research challenges.

AsiaInfo Technology: New Tech Exploration
AsiaInfo Technology: New Tech Exploration
AsiaInfo Technology: New Tech Exploration
How Ontologies Boost Large Language Models: A Comprehensive Review

Ontology as Knowledge Provider

In this role the ontology supplies high‑quality, structured background knowledge to LLMs, improving answer accuracy, domain relevance, and explainability.

Knowledge Integration & Fusion : Graph‑based knowledge is merged with user queries and jointly trained into the model. Systems such as KG‑Adapter and GAIL add adaptive layers that embed graph entities and relations into LLM parameters, reducing knowledge forgetting.

Ontology‑RAG (Retrieval‑Augmented Generation) : The query is mapped to ontology entities, relevant triples or sub‑graphs are retrieved, and the structured facts are injected into the LLM prompt. Representative systems include:

OG‑RAG – builds a hypergraph from the ontology, retrieves relevant hyperedges, and feeds them to the LLM. The pipeline extracts entities from unstructured text, creates JSON‑LD instances, flattens them into hyperedges, ranks hypernodes by combined vector similarity (s⊕a) and value similarity (v), selects top‑k candidates, and greedily assembles a fact‑cluster of up to L hyperedges for RAG. Code: https://github.com/microsoft/ograg2.

BMQExpander – extracts ontology‑aligned entities from a biomedical query, maps them to UMLS CUIs, builds a local semantic graph, filters irrelevant relations, serialises the graph into a tree‑structured prompt, and uses the prompt to retrieve documents. Code:

https://github.com/zabir-nabil/ontology-guided-query-expansion

.

MindMap – extracts evidence sub‑graphs from a knowledge graph, aggregates them, and lets the LLM reason over the combined graph to produce a “thinking map” that is returned alongside the answer. Repository: https://github.com/wyl-willing/MindMap.

Ontology as Reasoner

Here the ontology (and its reasoning engine) is used as an external symbolic component that answers queries generated by the LLM.

Cypher‑based reasoning : The ontology is stored in a property graph (e.g., Neo4j). The LLM converts a natural‑language question into a Cypher query via Text2Cypher, which is then executed to retrieve precise answers.

SPARQL‑based reasoning : The ontology is queried with SPARQL. Prompt engineering injects ontology metadata (including rdfs:comment) to guide the LLM in generating correct SPARQL statements, and post‑processing validates and repairs them.

T‑Box / A‑Box reasoning (Solar) : A multi‑agent pipeline first builds a T‑Box from unstructured text, then generates a Python interpreter for that T‑Box. User facts (A‑Box) are mapped to the ontology, and an SMT solver performs formal reasoning to produce verifiable answers. Repository: https://github.com/albsadowski/solar.

Ontology as Validator

In this paradigm the ontology checks the LLM’s output for consistency and factual correctness, forming a generate‑validate‑revise loop.

CyberRAG : After a RAG step, a separate validation model receives the answer, the original query, and a domain ontology; it returns a pass/fail flag and confidence score.

OBQC : Ontology‑Based Query Check validates SPARQL generated by the LLM, produces a natural‑language error explanation, and triggers an LLM‑driven repair loop until the query passes semantic checks.

Conclusion and Open Challenges

The surveyed works demonstrate that ontologies can serve as knowledge providers, reasoners, and validators for LLMs, substantially improving factuality, interpretability, and robustness. Practical deployments remain limited, standards for bidirectional co‑evolution of LLMs and ontologies are lacking, and integration with agents, chatbots, and recommendation systems is an open research frontier.

AIRAGontologyknowledge integrationsemantic reasoning
AsiaInfo Technology: New Tech Exploration
Written by

AsiaInfo Technology: New Tech Exploration

AsiaInfo's cutting‑edge ICT viewpoints and industry insights, featuring its latest technology and product case studies.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.