Structuring Ontologies for Bayesian Reasoning in LLM Contexts
Large Language Models (LLMs) have proven to be effective tools for generating coherent text and supporting decision making across domains. However, in complex settings such as healthcare, decision making requires reasoning under uncertainty, causal inference, and the ability to quantify risks or probabilities related to specific events. These capabilities are not fully supported by LLMs, in part due to their lack of an explicit, structured knowledge domain. An emerging line of research seeks to address this limitation by equipping LLMs with symbolic knowledge through ontologies. Some approaches even leverage LLMs to automatically generate ontologies from domain-specific documents by identifying classes, relationships, and properties. However, these automatically generated ontologies often exhibit high structural variability, making it difficult to quantify decisions or compute probabilistic outcomes, especially in formal reasoning tasks like those found in medicine. This work proposes an architecture that constrains the generative freedom of the LLM through structured prompts which define expected entity types and semantic relations. This controlled output enables the automatic transformation of the resulting ontology into a Bayesian network, establishing conditional dependencies with associated probabilities. The resulting system supports both symbolic and probabilistic inference. The implementation uses LangChain and ChatGPT via API for ontology extraction, OWLready2 for formal ontology representation, and pgmpy for Bayesian network construction. The system was evaluated on a corpus of eight clinical documents related to oral cancer, successfully generating an interpretable ontology and a functional Bayesian network. Simulated responses demonstrated plausible risk estimates based on combinations of symptoms and observed factors, highlighting the potential of this integration to build decision support tools that not only explain their outputs but also quantify them in a transparent and auditable way
Institutions
- Universidad Andrés Bello (CL)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2025-06-08
- DOI
- https://doi.org/10.5281/zenodo.15617597
- Primary Topic
- Biomedical Text Mining and Ontologies
- Type
- article
- Field-Weighted Citation Impact
- 0.00