Ontology-Grounded Language Modeling: Enhancing GPT-Based Philosophical Text Generation with Structured Knowledge

Claire Ponciano, Markus Schaffert, Jean-Jacques Ponciano

2025

Abstract

We present an ontology-grounded approach to GPT-based text generation aimed at improving factual grounding, historical plausibility, and stylistic fidelity in a case study: Baruch Spinoza’s Latin writings. We construct a compact ontology from Linked Open Data (Wikidata/DBpedia) augmented with expert-curated facts, serialize triples into natural-language statements, and interleave these with a canonical Latin corpus during fine-tuning of a GPT-2 (124M) model. At inference, retrieval-augmented generation (RAG) prepends ontology-derived facts and lightweight stylistic instructions, guiding the model toward historically consistent continuations in Spinoza’s register. Evaluation follows an 80/20 paragraph split of Ethica: we generate continuations for the 80% of segments retained and measure the semantic similarity (BERTScore) with the 20% omitted. This evaluation is completed by an expert assessment of historical plausibility and cosine similarity scores computation for the stylistic authenticity. Relative to a GPT-2 baseline trained only on the Latin corpus, our ontology-grounded variant achieves higher BERTScore and produces fewer factual and conceptual errors, preserving Latin rhetorical structure. These results indicate that structured knowledge integration is a feasible and effective way to make generative models more reliable for cultural-heritage text.

Download


Paper Citation


in Harvard Style

Ponciano C., Schaffert M. and Ponciano J. (2025). Ontology-Grounded Language Modeling: Enhancing GPT-Based Philosophical Text Generation with Structured Knowledge. In Proceedings of the 21st International Conference on Web Information Systems and Technologies - Volume 1: WEBIST; ISBN 978-989-758-772-6, SciTePress, pages 459-467. DOI: 10.5220/0013864400003985


in Bibtex Style

@conference{webist25,
author={Claire Ponciano and Markus Schaffert and Jean-Jacques Ponciano},
title={Ontology-Grounded Language Modeling: Enhancing GPT-Based Philosophical Text Generation with Structured Knowledge},
booktitle={Proceedings of the 21st International Conference on Web Information Systems and Technologies - Volume 1: WEBIST},
year={2025},
pages={459-467},
publisher={SciTePress},
organization={INSTICC},
doi={10.5220/0013864400003985},
isbn={978-989-758-772-6},
}


in EndNote Style

TY - CONF

JO - Proceedings of the 21st International Conference on Web Information Systems and Technologies - Volume 1: WEBIST
TI - Ontology-Grounded Language Modeling: Enhancing GPT-Based Philosophical Text Generation with Structured Knowledge
SN - 978-989-758-772-6
AU - Ponciano C.
AU - Schaffert M.
AU - Ponciano J.
PY - 2025
SP - 459
EP - 467
DO - 10.5220/0013864400003985
PB - SciTePress