betaFeedback

WorksComputer Science

Ontology Refinement with Embeddings and LLMs: A Case Study on CASTON

Abstract

Ontologies are widely used to represent and organize complex knowledge in domains such as biomedicine and healthcare. However, constructing reliable ontologies remains challenging, as class hierarchies, whether manually or automatically constructed, may contain subtle subsumption errors that require careful refinement. We study this problem in CASTON, a casting-domain ontology, and present a lightweight but scalable refinement workflow that combines a fine-tuned ontology embedding model with Large Language Models (LLMs). The embedding model is used to extract a limited number of candidate axioms for refinement together with possible replacement candidates, and an LLM then returns repair suggestions. In a small expert evaluation, the default configuration using a CASTON-fine-tuned OnT embedding model and Qwen3-8B produced reliable high-confidence repairs: all six high-confidence replacements were accepted by both domain experts. The implementation is available at https://github.com/HuiYang1997/OntRefine.

Introduction

OWL ontologies provide a formal way to represent domain knowledge through concepts, relations, and logical constraints. They support knowledge sharing, automated reasoning, and explainable systems across various real-world domains, such as biomedicine [1] and healthcare [2]. However, building and maintaining ontologies still requires considerable expert effort. In particular, incorrect asserted superclass axioms can affect reasoning results and downstream applications, making class hierarchy refinement an important but time-consuming task.

Recent studies have explored the use of Large Language Models (LLMs) for ontology completion, matching, and validation [3, 4, 5, 6]. However, asking an LLM to inspect a whole ontology in order to refine subsumption axioms is not well targeted and can be computationally expensive. Therefore, we propose a two-stage approach. In the first stage, an embedding model helps narrow down the search by ranking the existing axioms and retrieving possible alternative parent classes. In the second stage, an LLM checks only these selected axiom groups. It compares the current parent class with the candidate parent classes using their class labels, and then gives structured refinement suggestions. This design keeps the LLM focused on a small local context. It also enhances the traceability of each suggested repair, because every repair is linked to a clear and limited set of candidate classes.

We use CASTON1, a developing real-world ontology for metal casting, materials science, and manufacturing processes, as a case study to evaluate whether embedding-guided LLM review can support the refinement of asserted superclass axioms. Using the CASTON 1.0.0 snapshot released on 22 February 2026, we evaluated different combinations of embedding models and LLMs. Across these combinations,

ISWC 2026 Companion Volume, October 25–29, 2026, Bari, Italy

*Corresponding author.

✉ [email protected] (H. Yang); ziyу[email protected] (Z. Li); [email protected] (X. Liu); [email protected] (A. Jarfors); [email protected] (H. Tan); [email protected] (J. Chen)

© 2026 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).

Method

We focus on asserted in-ontology subsumption axioms between named CASTON classes. That is, each axiom has the form A⊑BA \sqsubseteq B, where AA and BB are named CASTON classes and the axiom states that every instance of AA is also an instance of BB. As shown in Figure 1, the workflow has two stages: embedding-based candidate generation and LLM validation.

Overview of the ontology-refinement workflow

Figure 1. Overview of the ontology-refinement workflow.

Stage 1: Candidate generation. For each asserted axiom A⊑BA \sqsubseteq B, we rank all named classes B′∈OB' \in\mathcal{O}, excluding AA, as possible parents of AA. Let rm(A,B)r_m(A, B) denote the rank assigned by embedding model mm to the asserted parent BB of class AA, with rank 1 indicating the most plausible parent. Formally,

rm(A,B)=rank⁡sm(A,B){sm(A,B′)∣all classes B′≠A},r_m(A, B) = \operatorname{rank}_{s_m(A,B)}\{s_m(A, B') \mid\text{all classes } B' \ne A\},

where sm(A,B′)s_m(A, B') is the score function of the embedding model mm for measuring the plausibility of the axiom A⊑B′A \sqsubseteq B'. Thus, a larger value of rm(A,B)r_m(A, B) indicates that the asserted parent is less compatible with the embedding model. We then select the top krk_r axioms with the largest rm(A,B)r_m(A, B) values, using kr=30k_r = 30 by default, as suspicious axioms for LLM-based validation.

For each selected axiom A⊑BA \sqsubseteq B, we use the same embedding model to construct a pool of alternative candidate parents. Specifically, for the child class AA, we retain the kak_a (with ka=10k_a = 10 by default) highest-ranked candidate parents that are neither AA itself nor already asserted parents of AA. We denote this set by Pcand(A)P_{\mathrm{cand}}(A).

As the default embedding model, we use OnT [5] after fine-tuning it on CASTON. OnT is a hyperbolic ontology embedding method designed to adapt to a given EL\mathcal{EL} ontology. It models a score function s(A,B)s(A, B) based on the hyperbolic distance between the embeddings of AA and BB. Since CASTON falls within this ontology class, OnT is suitable for modelling its hierarchical structure.

Stage 2: LLM validation. For each axiom A⊑BA \sqsubseteq B selected in the previous stage, we construct a single LLM prompt that combines three sources of information: the child class AA, its currently asserted superclass axioms, and the candidate parent set Pcand(A)P_{\mathrm{cand}}(A), as illustrated in Figure 2. For each class mentioned in the prompt, we include the available metadata, such as the class ID, label, definition or comment, and domain or scope note. The prompt also includes all other additional axioms involving AA, such as existential restrictions of the form A⊑∃r.B1A \sqsubseteq\exists r.B_1, as background information where available.

User Prompt Template

Figure 2. Prompt used for the LLM validation stage.

The LLM is asked to determine whether each current parent is a correct direct superclass, whether any parent should be removed or replaced by one of the suggested alternatives, whether any candidate parent should be added, and to provide a justification for each decision. The model returns a structured JSON object containing the parent-level verdict, a suggested replacement where applicable, a textual justification, and a confidence label: High, Medium, or Low. We retain suggestions with High or Medium confidence as candidate refinements for subsequent evaluation.

Experimental Setup and Preliminary Results

Experiment setting. (1) Dataset: We evaluate our method on the developing ontology CASTON, using the first release, version 1.0.0, which was released on 22 February 2026. This version contains 270 named classes, i.e., concepts, and 306 axioms. Of these, 292 are subsumption axioms involving atomic concepts, for which rank scores were assigned using the embedding models, as illustrated in the workflow. (2) Configuration. As shown in the first column of Table 1. We consider three different settings: The default setting is CASTON-fine-tuned OnT + Qwen3-8B, where OnT is fine-tuned from the SBERT variant all-mpnet-base-v2. To analyze the influence of embedding models and LLMs, we compare the default workflow with two non-fine-tuned comparison settings using Qwen3-8B or GPT-4o mini, where both method use a non-CASTON-fine-tuned ensemble embedding for candidate generation. The ensemble method composed of three sentence embedding models: OnT fine-tuned on the GALEN ontology, HiT fine-tuned on WordNetNoun, and standard SBERT. All three models are based on all-mpnet-base-v2. In this ensemble setting, we use the mean rank across the embedding models to select candidate refinement axioms and generate candidate parent sets. (3) Evaluation metric. Two domain experts independently score each replacement suggestion using a five-point ordinal scale: −2-2 for completely wrong, −1-1 for seems wrong, 0 for vague or unclear, +1+1 for seems correct, and +2+2 for completely correct. We classify a suggestion as accepted when both experts assign positive scores, rejected when both assign negative scores, and mixed otherwise.

SettingConfidenceRowsAccepted (+2/+1)MixedRejected (-2/-1)Acceptance rate
Default: Qwen3-8B + CASTON OnT-FTHigh66 (6/0)00100%
Default: Qwen3-8B + CASTON OnT-FTMedium20 (0/0)200%
Ablation: Qwen3-8B + pretrained ensembleHigh74 (4/0)0357.1%
Ablation: Qwen3-8B + pretrained ensembleMedium41 (0/1)0325.0%
Auxiliary: GPT-4o mini + pretrained ensembleHigh165 (5/0)11031.3%
Auxiliary: GPT-4o mini + pretrained ensembleMedium51 (0/1)0420.0%

Table 1. Expert outcomes by setting and LLM confidence. Accepted rows have positive expert agreement; parentheses give the +2/+1 breakdown. Mixed rows are expert disagreements or unclear cases.

Results Table 1 shows that the default configuration is highly reliable for the small set of high-confidence replacement suggestions evaluated in this study. With Qwen3-8B and fine-tuned OnT embeddings, all six high-confidence replacements are accepted by both experts (with score +2+2 for all cases), yielding a 100% acceptance rate with no mixed or rejected cases. In contrast, both medium-confidence cases are mixed. This indicates that the LLM confidence score is useful for prioritization: high-confidence predictions under the default setting are trustworthy, whereas medium-confidence ones still require manual review.

Replacing the fine-tuned embeddings with the pretrained ensemble markedly reduces reliability. With the same Qwen3-8B generator, the high-confidence acceptance rate drops from 100% to 57.1%: 4 of 7 cases are accepted, while 3 are rejected. Medium-confidence results are also weak, with only 1 of 4 cases accepted and 3 rejected. Thus, although the pretrained ensemble can recover some valid candidates, it lacks the precision of the fine-tuned OnT model, highlighting the importance of task-specific embedding finetuning.

Using GPT-4o mini with the same pretrained ensemble further reduces the reliability of highconfidence predictions. Among the 16 high-confidence replacements, only 5 are consistently accepted, 1 receives mixed judgments, and 10 are rejected, yielding an acceptance rate of 31.3%. This is 68.7 percentage points lower than the default setting. Notably, many replacements assigned high confidence by GPT-4o mini are rejected by both experts. These results indicate that, compared with Qwen3-8B, GPT-4o mini exhibits poorer confidence calibration for this task and a stronger tendency to produce unreliable decisions.

Case Studies To better understand the strengths and limitations of the proposed workflow, we present detailed case studies generated using the default configuration (i.e., Qwen3-8B+OnT-FT).

Success case: A representative successful refinement is the concept chromite_sand. In the original ontology, chromite_sand was modelled as a subclass of green_sand_molding. The fine-tuned workflow instead suggested replacing its superclass with foundry_sand, a recommendation accepted by both domain experts (+2/+2). Semantically, green_sand_molding denotes a molding process, whereas chromite_sand is a mold material used in foundry applications. The suggested axiom therefore yields a more accurate material taxonomy while preserving the intended domain semantics. Similar refinements were observed for olivine_sand, silica_sand, and zircon_sand, indicating that the fine-tuned OnT embeddings can identify semantically appropriate superclass refinements rather than merely retrieving lexically related concepts.

Failure case: A representative failure case is semisolid_metal_(ssm)_processing. The original ontology classified this concept under high_pressure_die_casting, whereas the fine-tuned workflow suggested replacing its superclass with semisolid_casting. Although this suggestion is semantically related, the experts did not agree on its validity (0/-2). One expert noted that the hierarchy among these concepts is inconsistent in the current ontology and requires revision, while the other argued that semisolid_metal_processing should instead be modelled as a subclass of die_casting. This case shows that even fine-tuned embeddings may produce incorrect superclass assignments when the existing ontology hierarchy is incomplete or structurally inconsistent.

Conclusion

This poster provides preliminary evidence that embedding-guided LLM review can support practical ontology hierarchy refinement when the embedding model is adapted to the target ontology. The CASTON-fine-tuned OnT + Qwen3-8B workflow identified a small but reliable set of high-confidence repairs, all of which were judged to be completely correct by two domain experts. The evaluation is currently limited to one ontology, replacement suggestions, and a small number of expert-assessed repairs. In future work, we plan to extend this pipeline to more complex axiom types, such as relational restrictions, and evaluate its effectiveness at larger scale across ontologies from diverse domains. We will also apply the pipeline to future versions of CASTON to support systematic hierarchy refinement, ontology enrichment, and continuous ontology evolution through expert-guided, LLM-assisted refinement.

Acknowledgments

Hui Yang and Jiaoyan Chen are supported by the EPSRC project OntoEm (EP/Y017706/1). Xuan Liu acknowledges the support of the NUS Research Scholarship. Ziyu Li’s PhD project was funded by the Stiftelsen för kunskaps- och kompetensutveckling (KK-Stiftelsen) through the Smart Industry Sweden initiative (project number 2020-0044).

Declaration on Generative AI

During the preparation of this work, the authors used ChatGPT for Grammar and spelling check, Paraphrase and reword, and Improve writing style to check grammar and spelling and improve the clarity and readability of author-written text. Claude was used to assist in developing code implementations for the proposed methods. After using these tools and services, the authors reviewed and edited the generated content as needed and take full responsibility for the publication’s content.

References

  1. [1]M. Ashburner, C. A. Ball, J. A. Blake, D. Botstein, H. Butler, J. M. Cherry, A. P. Davis, K. Dolinski, S. S. Dwight, J. T. Eppig, M. A. Harris, D. P. Hill, L. Issel-Tarver, A. Kasarski, S. Lewis, J. C. Matese, J. E. Richardson, M. Ringwald, G. M. Rubin, G. Sherlock, Gene ontology: Tool for the unification of biology, Nature Genetics 25 (2000) 25–29. doi:10.1038/75556.DOI
  2. [2]SNOMED International, SNOMED CT starter guide, SNOMED International Document Library, 2024. URL: https://docs.snomed.org/snomed-ct-practical-guides/snomed-ct-starter-guide.
  3. [3]Y. He, J. Chen, E. Jimenez-Ruiz, H. Dong, I. Horrocks, Language model analysis for ontology subsumption inference, in: Findings of the Association for Computational Linguistics: ACL 2023, Association for Computational Linguistics, Toronto, Canada, 2023, pp. 3439–3453. URL: https://aclanthology.org/2023.findings-acl.213/. doi:10.18653/v1/2023.findings-acl.213.DOI
  4. [4]Y. He, M. Yuan, J. Chen, I. Horrocks, Language models as hierarchy encoders, Advances in Neural Information Processing Systems 37 (2024) 14690–14711.
  5. [5]H. Yang, J. Chen, Y. He, Y. Gao, I. Horrocks, Language models as ontology encoders (2025) 443–461.arxiv.org/abs/2507.14334
  6. [6]H. B. Gloglou, J. D’Souza, S. Auer, LLMs4OL: Large language models for ontology learning, in: The Semantic Web – ISWC 2023, volume 14265 of Lecture Notes in Computer Science, Springer, 2023, pp. 408–427. doi:10.1007/978-3-031-47240-4_22.

Paper details

vlnc:W_29mvua5a
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 4

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

ChatGPT, Claude

View statement
Looking for related papers…
Contents