<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <issn pub-type="ppub">1613-0073</issn>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Towards Building an RDF-based Deep Document Model and Retrieval Augmented Generation System for Enhanced Question Answering with Large Language Models</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Runsong Jia</string-name>
          <email>Runsong.Jia@anu.edu.au</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Bowen Zhang</string-name>
          <email>Bowen.Zhang@qdx.co</email>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Sergio J. Rodríguez-Méndez</string-name>
          <email>Sergio.RodriguezMendez@anu.edu.au</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Pouya G. Omran</string-name>
          <email>P.G.Omran@anu.edu.au</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Australian National University</institution>
          ,
          <addr-line>Canberra ACT 2601, AU</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Knowledge Graph, Deep Document Model, Large Language Model, Information Extraction</institution>
          ,
          <addr-line>Knowledge</addr-line>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>QDX Technologies Pte. Ltd.</institution>
          ,
          <addr-line>33A Pagoda Street, Singapore 059192, SG</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>Knowledge Graphs (KGs) are crucial for Retrieval-Augmented Generation (RAG), but traditional methods have limitations in capturing details and querying academic KGs. The challenges lie in identifying the appropriate KG type for RAG, such as a Metadata KG, and optimizing the integration of Large Language Models (LLMs) with KGs to enhance retrieval and generation. This paper introduces a novel framework combining the Deep Document Model (DDM) concept and a KG-enhanced Query Processing (KGQP) mechanism. DDM provides a comprehensive, hierarchical representation of academic papers using advanced Natural Language Processing (NLP) techniques, while KGQP optimizes complex queries using the KG's structural information and semantic relationships. The framework also integrates KGs with state-of-the-art LLMs to improve knowledge utilization and downstream task performance. Evaluations show that the KG-based approach surpasses vector-based methods in relevance, accuracy, completeness, and readability. This research demonstrates the potential of combining KGs and LLMs for efective academic knowledge management and discovery. § Submission type: Poster §.</p>
      </abstract>
      <kwd-group>
        <kwd>Generation System</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>CEUR
ceur-ws.org</p>
    </sec>
    <sec id="sec-2">
      <title>1. Introduction and Related</title>
    </sec>
    <sec id="sec-3">
      <title>Work</title>
      <p>
        In the current era, where LLMs are extensively applied for complex question-answering tasks,
these models serve as efective tools for understanding. However, relying solely on LLMs is not
suficient to meet the challenges, as they require appropriate methods to process and explore
massive semi-structured data [
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ]. KGs play a crucial role in this context, as they manage vast
amounts of data and provide relevant contextual information to LLMs [
        <xref ref-type="bibr" rid="ref3 ref4">3, 4</xref>
        ]. Existing research
has already utilized KGs to enhance the outputs of LLMs [
        <xref ref-type="bibr" rid="ref5 ref6 ref7">5, 6, 7</xref>
        ], highlighting the importance
of integrating LLMs with KGs. Through KGs, relevant information can be efectively filtered
and pinpointed, providing the precise context needed for LLMs to perform their tasks.
nEvelop-O
      </p>
      <p>
        In this work, we propose utilizing the Metadata KG of a document set, such as ASKG [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ],
integrated with a RAG architecture and LLMs to provide relevant and diverse contexts from
research papers for generating answers to complex queries. We utilize the following tools to
construct the KG automatically. MEL (Metadata Extractor &amp; Loader) and TNNT (The NLP-NER
Toolkit) are powerful tools for extracting knowledge from unstructured sources1. MEL converts
metadata and text into JSON objects [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], while TNNT enhances this data with Named Entity
Recognition [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. Additionally, the PARSE component 2 of the KGCP pipeline 3 employs web
crawling and NLP models to enrich academic semantic knowledge bases in computer science
[
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. The key contributions of this paper include: i. constructing KGs using DDM’s fine-grained
representation, ii. optimizing KG queries with KGQP for extensive knowledge graphs, and iii.
enhancing query handling for complex scholarly domain inquiries.
      </p>
    </sec>
    <sec id="sec-4">
      <title>2. Methodology</title>
      <p>Central to our approach is the DDM concept4, which captures the logical hierarchical structure
of documents from section, paragraph to sentence level. By employing NLP techniques, DDM
conducts in-depth analysis of textual elements, identifies their hierarchical relationships, and
creates a model that reflects the document’s logical flow. Our process integrates PARSE and DDM
methods to construct a KG from scientific papers (ASKG). This approach not only transcends
the traditional role of knowledge graphs as mere fact providers but also ofers comprehensive
metadata and context for collections of research papers. DDM enhances the depth and richness
of knowledge representation through its alignment with the Document Object Model Ontology
(DOMO). In this way, the DDM’s structure is materialized in an ontology-based metadata KG.</p>
      <p>
        To address the challenge of “AI hallucination” faced by LLMs when dealing with complex
questions, particularly those involving intricate fact verification, we have designed and
implemented the KGQP (KG-enhanced Query Processing) workflow 5. This process harnesses
the potential advantages of LLMs and incorporates an academic KG (ASKG) aligned with a
generic model (DOMO). As shown in Figure 1, this pipeline leverages KG-based context in LLM
question-answering, utilizing structured information from ontology-based KGs like ASKG to
provide accurate context to prompt engineering tasks with LLMs and reduce hallucinations.
The workflow’s main steps as shown in Figure 1 involves:
1. Entity Identification: We utilize GPT-4 for identifying entities in user queries. GPT-4
demonstrates exceptional performance in entity recognition and matching [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], accurately
identifying entities and their corresponding quantities within user queries.
2. Retrieval of Relevant Paragraphs: We employ SPARQL queries with exact and string
matching techniques:
• Exact Matching: We construct SPARQL queries to retrieve paragraphs directly
related to the identified entities in the query.
      </p>
      <sec id="sec-4-1">
        <title>1https://w3id.org/kgcp/MEL-TNNT</title>
        <p>
          2https://w3id.org/kgcp/PARSE
3https://w3id.org/kgcp/
4https://w3id.org/kgcp/DDM
5https://w3id.org/kgcp/KGQP
• String Matching: When exact matching fails to retrieve suficient relevant entities,
we employ more flexible search techniques. These include case-insensitive searches
and searches for any occurrences of the specified substring within the entity label,
allowing for partial matches and retrieving more potentially relevant entities.
3. Entity Matching: We link academic entities with relevant paragraphs using
GISTEmbedding. The semantic similarity between each entity and paragraph pair is calculated
using cosine similarity, with a threshold set at 70%. For each entity, we identify the
paragraph with the highest similarity score. Subsequently, we match the entities identified
in the user’s query with the corresponding entities in our KG.
4. Selection of Most Relevant Paragraphs: We employ Keyword Frequency Matching to
select the most relevant paragraphs.
5. Answer Generation: We utilize LLaMA2 [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ] to generate answers based solely on the
selected paragraphs.
        </p>
        <p>This workflow leverages the structured information in our KG to provide more accurate and
relevant context for the LLM, thereby improving answer quality and reducing hallucinations.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>3. Evaluation and Conclusions</title>
      <p>We compare our KGQP method against a vector-based baseline. In the baseline experiment, a
simple chunking approach was employed to preprocess the text data. The dataset used in this
experiment consists of 10 scientific papers in the field of computer science. These papers were
all published by the same two authors, who are also the experts involved in the subsequent
human evaluation. The dataset was divided into chunks with a maximum of 100 tokens per
chunk and a 5% overlap ratio between adjacent chunks. This ensures that the content length of
each chunk obtained by “Simple Chunking” is comparable to the average length of Paragraphs6
in KGQP process and provides richer contextual information. This chunking process yielded a
total of 618 text chunks.</p>
      <p>
        Our evaluation employed both human assessment and quantitative metrics. Three evaluators,
including two human experts and Claude [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], scored answers from KG-based and vector-based
(Simple Chunking) methods across four dimensions: Relevance, Accuracy, Completeness, and
Readability, using a 5-point scale.
      </p>
      <p>
        We also conducted entity extraction, calculating overlap and Jaccard distance between the
two methods. Semantic distance was measured using GIST-Embedding [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. Additionally, we
analyzed context diversity by recording the number of article sources per answer and calculated
similarity between answers and user query embeddings.
      </p>
      <p>As shown in Table 1, the KG-based method consistently outperformed the vector-based
approach across all evaluated dimensions. The most significant improvements were observed in
Completeness and Accuracy, demonstrating the KG-based method’s efectiveness in providing
more comprehensive and precise answers. These results suggest that our proposed approach
efectively enhances question-answering performance in academic contexts.</p>
      <p>Our approach shows promise despite challenges posed by varied document structures. Future
work will focus on better integrating DDM with the PARSE Pipeline for full automation and
extending our framework to support Multimodal Knowledge Graphs and Question Answering
for figures and tables.</p>
      <p>In conclusion, our KG-based method demonstrates consistent superiority in producing
relevant, accurate, and comprehensive answers while maintaining high readability. The observed
improvements across all metrics underscore the potential of our approach in enhancing
questionanswering performance within academic contexts. As we address current limitations and expand
the system’s capabilities, we anticipate further advancements in academic knowledge
management and discovery.</p>
      <sec id="sec-5-1">
        <title>6These paragraph entities were extracted through the DDM pipeline.</title>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>J.</given-names>
            <surname>Wu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Q.</given-names>
            <surname>Gao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Liu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Wei</surname>
          </string-name>
          ,
          <string-name>
            <surname>A</surname>
          </string-name>
          <article-title>Survey on Embedding Techniques for Scholarly Knowledge Graphs</article-title>
          ,
          <source>in: International Conference on Web Information Systems Engineering</source>
          , Springer, Singapore,
          <year>2020</year>
          , pp.
          <fpage>150</fpage>
          -
          <lpage>160</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>X.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Zhang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Zhang</surname>
          </string-name>
          , S. Ma,
          <article-title>Review on Knowledge Graph Techniques for Retrieving Scientific Publications</article-title>
          ,
          <source>Frontiers of Computer Science</source>
          <volume>14</volume>
          (
          <year>2020</year>
          )
          <fpage>143301</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>B.</given-names>
            <surname>Abu-Salih</surname>
          </string-name>
          ,
          <article-title>Domain-specific knowledge graphs: A survey</article-title>
          ,
          <source>Journal of Network and Computer Applications</source>
          <volume>185</volume>
          (
          <year>2021</year>
          )
          <fpage>103076</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>A. B.</given-names>
            <surname>Cano</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Gómez-Rodríguez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. O.</given-names>
            <surname>Tijani</surname>
          </string-name>
          ,
          <article-title>Combining Text Embeddings and Knowledge Graphs for Scholarly Document Classification</article-title>
          ,
          <source>in: European Conference on Information Retrieval</source>
          , Springer, Cham,
          <year>2021</year>
          , pp.
          <fpage>249</fpage>
          -
          <lpage>263</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>D.</given-names>
            <surname>Sanmartin</surname>
          </string-name>
          ,
          <article-title>KG-RAG: Bridging the Gap Between Knowledge and Creativity</article-title>
          , arXiv preprint arXiv:
          <volume>2405</volume>
          .12035 (
          <year>2024</year>
          ). URL: https://doi.org/10.48550/arXiv.2405.12035.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>G.</given-names>
            <surname>Agrawal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Kumarage</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Alghamdi</surname>
          </string-name>
          , H. Liu,
          <article-title>Can Knowledge Graphs Reduce Hallucinations in LLMs? : A Survey, NAACL (</article-title>
          <year>2024</year>
          ). URL: https://doi.org/10.48550/arXiv.2311.07914.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>S.</given-names>
            <surname>Pan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Luo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Chen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Wu</surname>
          </string-name>
          ,
          <source>Unifying Large Language Models and Knowledge Graphs: A Roadmap</source>
          (
          <year>2023</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>R.</given-names>
            <surname>Jia</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Zhang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. J. Rodríguez</given-names>
            <surname>Méndez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. G.</given-names>
            <surname>Omran</surname>
          </string-name>
          ,
          <article-title>Leveraging Large Language Models for Semantic Query Processing in a Scholarly Knowledge Graph</article-title>
          ,
          <source>arXiv preprint arXiv:2405.15374</source>
          (
          <year>2024</year>
          ). URL: https://doi.org/10.48550/arXiv.2405.15374.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>S. J. Rodríguez</given-names>
            <surname>Méndez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. G.</given-names>
            <surname>Omran</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Haller</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Taylor</surname>
          </string-name>
          , MEL: Metadata Extractor &amp; Loader, in: ISWC (Posters/Demos/Industry),
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>S.</given-names>
            <surname>Seneviratne</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. J. Rodríguez</given-names>
            <surname>Méndez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Zhang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. G.</given-names>
            <surname>Omran</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Taylor</surname>
          </string-name>
          , A. Haller,
          <article-title>TNNT: The Named Entity Recognition Toolkit</article-title>
          ,
          <source>in: Proceedings of the 11th on Knowledge Capture Conference</source>
          ,
          <year>2021</year>
          , pp.
          <fpage>249</fpage>
          -
          <lpage>252</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>B.</given-names>
            <surname>Zhang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. J. Rodríguez</given-names>
            <surname>Méndez</surname>
          </string-name>
          ,
          <string-name>
            <surname>P. G.</surname>
          </string-name>
          <article-title>Omran, ASKG: An Approach to Enrich Scholarly Knowledge Graphs through Paper Decomposition with Deep Learning</article-title>
          ,
          <source>in: ISWC 2023 Posters and Demos: 22nd International Semantic Web Conference</source>
          , Athens, Greece,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>J.</given-names>
            <surname>Achiam</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Adler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Agarwal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Ahmad</surname>
          </string-name>
          ,
          <string-name>
            <given-names>I.</given-names>
            <surname>Akkaya</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F. L.</given-names>
            <surname>Aleman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Almeida</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Altenschmidt</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Altman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Anadkat</surname>
          </string-name>
          , et al.,
          <source>GPT-4 technical report, arXiv preprint arXiv:2303.08774</source>
          (
          <year>2023</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>H.</given-names>
            <surname>Touvron</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Lavril</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Izacard</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Martinet</surname>
          </string-name>
          , M.
          <article-title>-</article-title>
          <string-name>
            <surname>A. Lachaux</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          <string-name>
            <surname>Lacroix</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          <string-name>
            <surname>Rozière</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          <string-name>
            <surname>Goyal</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          <string-name>
            <surname>Hambro</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          <string-name>
            <surname>Azhar</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Rodriguez</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Joulin</surname>
            , E. Grave, G. Lample, LLaMA: Open and
            <given-names>Eficient</given-names>
          </string-name>
          <string-name>
            <surname>Foundation Language Models</surname>
          </string-name>
          ,
          <year>2023</year>
          . arXiv:
          <volume>2302</volume>
          .
          <fpage>13971</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <surname>Anthropic</surname>
          </string-name>
          , Claude: Introducing Claude, https://www.anthropic.com/index/ introducing-claude,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>A. V.</given-names>
            <surname>Solatorio</surname>
          </string-name>
          ,
          <article-title>GISTEmbed: Guided In-sample Selection of Training Negatives for Text Embedding Fine-tuning</article-title>
          ,
          <source>arXiv preprint arXiv:2402.16829</source>
          (
          <year>2024</year>
          ). URL: https://arxiv.org/ abs/2402.16829. arXiv:
          <volume>2402</volume>
          .
          <fpage>16829</fpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>