You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 26 Next »

First draft to be created until 11 October 2024.

ADD NEW TOP LEVEL SECTION: LLM TRAINING

How do I enhance/augment/extend LLM training through KGs? (LLM TRAINING) – length: up to one page

Lead: Daniel Baldassare

Contributors:

  • Diego Collarana (FIT)
  • Daniel Baldassare (doctima) – Lead
  • Michael Wetzel (Coreon)
  • Rene Pietzsch (ECC)


Problem statement

The training of large language models typically employs unsupervised methods on extensive datasets. Despite their impressive performance on a range of tasks, these models often lack the practical, real-world knowledge required for certain applications. Furthermore, since domain-specific data is not included in the public domain datasets used for pre-training or fine-tuning large language models (LLMs), the integration of knowledge graphs (KGs) becomes fundamental for the injection of proprietary knowledge into LLMs, especially for enterprise solutions. In order to infuse this knowledge into LLMs during training, many techniques have been researched in recent years, resulting in three main state-of-the-art methods (Pan et al, 2024): 

  1. Integration of KGs into training objectives (See answer 1)
  2. Verbalization of KGs into LLM inputs (See answer 2)
  3.  Integrate KGs by Fusion Modules: Joint training of graph and language models (See answer 3)

Explanation of concepts

The first method focuses on extending the pre-training procedure. The term pretraining objectives is used to describe the techniques that guide the learning process of a model from its training data. In the context of pre-training large language models, a variety of methods have been employed based on the architecture of the model itself. Decoder-only models such as GPT-4 usually use Casual Language Modelling (CLM), where the model is presented with a sequence of tokens and learns to predict the next token in the sequence based solely on the preceding tokens (Wang et al., 2022). Integrating KGs into training objectives consists in extending the standard llm's pre-training objective of generating coherent and contextually relevant text by designing a knowledge aware pre-training.

The second method involves integrating KGs directly into the LLM's input by verbalising the knowledge graph into the prompt, thereby transforming structured data into text format that the LLM can process and learn from. Data from the knowledge is either prepended or postpended to the user's question as contextual information in the prompt. Within this approach the standard llm pre-training objective of generating coherent and contextually relevant text remains untouched and the knowledge augmentation task is modeled as a linguistic task.


Brief description of the state of the art

First draft to be created until 11 October 2024


Proposed solutions:

Answer 1: integrate KGs into the LLM Training Objective

Contributors:

  • Diego Collarana (FIT)

Short definition/description of this topic: please fill in ...

  • Content ...
  • Content ...
  • Content ... 

Answer 2: integrate KGs into LLM Inputs (verbalize KG for LLM training)

Contributors:

  • Diego Collarana (FIT)
  • Daniel Baldassare (doctima) – Lead
  • Michael Wetzel (Coreon)
  • Rene Pietzsch (ECC)
  • ... 

Draft from Daniel Baldassare :

Short definition/description of this topic: Verbalizing knowledge graphs for LLM is the task of representing knowledge graphs as text so that they can be written directly in the prompt, the main input source of LLM. Verbalization consists of finding textual representations for nodes, relationships between nodes, and their metadata. Verbalization can take place at different stages of the LLM lifecycle, during training (pre-training, instruction fine-tuning) or during inference (in-context learning), and consists in:

Answer 3: Integrate KGs by Fusion Modules

Contributors:

  • Diego Collarana (FIT)

Short definition/description of this topic: please fill in ...

  • Content ...
  • Content ...
  • Content ... 


References:

  • S. Pan, L. Luo, Y. Wang, C. Chen, J. Wang, und X. Wu, „Unifying Large Language Models and Knowledge Graphs: A Roadmap“, IEEE Trans. Knowl. Data Eng., Bd. 36, Nr. 7, S. 3580–3599, Juli 2024, doi: 10.1109/TKDE.2024.3352100.
  • T. Wang u. a., „What Language Model Architecture and Pretraining Objective Works Best for Zero-Shot Generalization?“, in Proceedings of the 39th International Conference on Machine Learning, PMLR, Juni 2022, S. 22964–22984. Zugegriffen: 3. Oktober 2024. [Online]. Verfügbar unter: https://proceedings.mlr.press/v162/wang22u.html



ADD NEW TOP LEVEL SECTION: ENHANCING LLMs AT INFERENCE TIME

How do I use KGs for Retrieval-Augmented Generation (RAG)? (2.1 – Prompt Enhancement) – length: up to one page

Lead: Diego

Draft Daniel Burkhardt

Explanation of concepts

  • Retrieval-augmented generation (RAG) methods combine retrieval mechanisms with generative models to enhance the output of LLMs by incorporating external knowledge. By grounding the generated output in specific and relevant information, RAG methods enhance the quality and accuracy of the generated output.
  • Types of RAG:

    • Conventional RAG has three components: 1) Knowledge Base, typically created by chunking text documents, transforming them into embeddings, and storing them in a vector store. 2) Retriever searches the vector database for chunks that exhibit high similarity to the query. 3) Generator feeds the retrieved chunks, alongside the original query, to an LLM to generate the final response.
    • Graph RAG integrates knowledge graphs into the RAG framework, allowing for the retrieval of structured data that can provide additional context and factual accuracy to the generative model. 
  • RAG is used in various natural language processing tasks, including question-answering, information extraction, sentiment analysis, and summarization. It is particularly beneficial in scenarios requiring domain-specific knowledge.

Conventional RAG Limitations

Despite its advantages over standalone LLMs, Conventional RAG has the following limitations:

  1. Struggles to answer queries that require the intricate interconnectedness of information and global context crucial for generating comprehensive summaries.
  2. It cannot integrate structure and unstructured data, a use case typically required in industrial applications.
  3. Limited accuracy due to context loss during text chunking and its reliance on text similarity search.
  4. It has limited reasoning capabilities, especially with abstract questions that require reasoning, inference, or the synthesis of new information not explicitly stated in the source material.

We describe various solutions for integrating knowledge graphs into RAG systems to improve accuracy, reliability, and explainability. 

Answer 1: KG-Guided Retrieval Mechanisms

Contributors:

  • Daniel Burkhardt (FSTI)
  • Robert David (SWC)
  • Diego Collarana (FIT)
  • Daniel Baldassare (doctima)
  • Michael Wetzel (Coreon)

Short definition/description of this topic: KG-Guided Retrieval Mechanisms involve using for example knowledge graphs or vector databases to enhance the retrieval process in RAG systems. Knowledge graphs provide a structured representation of knowledge, enabling more precise and contextually aware retrieval of information. This approach can directly query knowledge graphs or use them to augment queries to other data sources, improving the relevance and accuracy of the retrieved information.

Draft Robert David:

  • Initial RAG idea: Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
  • RAG is commonly used with vector databases.
    • can only grasp semantic similarity represented in the document content
    • only unstructured data
    • vector distance instead of a DB search limits the retrieval capabilities
  • Graph RAG uses knowledge graphs as part of the RAG system
    • KGs for retrieval (directly), meaning the database is storing KG data
    • KGs for retrieval via a semantic layer, potentially retrieving over different data sources of structured and unstructured data
    • KGs for augmenting the retrieval, meaning the queries to some database is modified via KG data
  • Via Graph RAG, we can
    • ingest additional semantic background knowledge (knowledge model) not represented in the data itself
      • additional related knowledge based on defined paths (rule-based inference)
      • focus on certain aspects of a data set for the retrieval (search configuration)
      • personalization: represent different roles for retrieval via ingesting role description data into the retrieval (especially important in an enterprise environment)
    • reasoning
    • linked data makes factual knowledge related to the LLM-generated knowledge and thereby provide a means to check for correctness
    • explainable AI: provide justifications via KG
    • consolidate different data sources: unstructured, semi-structured, structured (enterprise knowledge graph scenario)
    • doing the actual retrieval via KG queries: SPARQL
    • hybrid retrieval: combine KG-based retrieval with vector databases or search indexes

Answer 2: Hybrid Retrieval Combining KGs and Dense Vectors

Contributors:

  • Daniel Burkhardt (FSTI)
  • Diego Collarana (FIT)
  • Daniel Baldassare (doctima)

Draft from Daniel Burkhardt

Short definition/description of this topic: Hybrid Retrieval combines the strengths of knowledge graphs and dense vector representations to improve information retrieval. This approach leverages the structured, relational data from knowledge graphs and the semantic similarity captured by dense vectors, resulting in enhanced retrieval capabilities. Hybrid retrieval systems can improve semantic understanding and contextual insights while addressing scalability and integration complexity challenges. 

Key Challenges

  • Knowledge Graph Construction and Maintenance: Creating and updating high-quality knowledge graphs for specific domains can be challenging and resource-intensive.
  • Scalability and Efficiency: Retrieving information from large and complex knowledge graphs while maintaining acceptable response times remains challenging.
  • Evaluation Standardization: The lack of widely accepted benchmarks and evaluation metrics hinders progress and comparability across Graph RAG approaches. The quality of KG is crucial.
  • Human Element, we need knowledge engineers and domain specialists. 

References

How do I enhance LLM explainability by using KGs? (2.2 – Answer Verification) – length: up to one page

Lead: Daniel Burkhardt

Draft from Daniel Burkhardt

Short definition/description of this topic: KG-Enhanced LLM Interpretability refers to the use of knowledge graphs to improve the transparency and explainability of large LLMs. By integrating structured knowledge from KGs, LLMs can generate more interpretable outputs, providing justifications and factual accuracy checks for their responses. This integration helps in aligning LLM-generated knowledge with factual data, enhancing trust and reliability. 

Answer 1: Measuring KG Alignment in LLM Representations

Draft from Daniel Burkhardt

Short definition/description of this topic: This involves evaluating how well the representations generated by LLMs align with the structured knowledge in KGs. This alignment is crucial for ensuring that LLMs can accurately incorporate and reflect the relationships and entities defined in KGs, thereby improving the factuality and coherence of their outputs.

literature: https://arxiv.org/abs/2311.06503 , https://arxiv.org/abs/2406.03746, https://arxiv.org/abs/2402.06764

Contributors:

  • Daniel Burkhardt (FSTI)
  • Content ...
  • Content ...
  • Content ... 

Answer 2: KG-Guided Explanation Generation

Draft from Daniel Burkhardt

Short definition/description of this topic: KG-Guided Explanation Generation uses knowledge graphs to provide explanations for the outputs of LLMs. By leveraging the structured data and relationships within KGs, this approach can generate detailed and contextually relevant explanations, enhancing the interpretability and transparency of LLM outputs. 

literature: https://arxiv.org/abs/2312.00353, https://arxiv.org/abs/2403.03008

Contributors:

  • Daniel Burkhardt (FSTI)
  • Rene Pietzsch (ECC)
  • ... 
  • Content ...
  • Content ...
  • Content ... 

Answer 3: KG-Based Fact-Checking and Verification

Contributors:

  • Daniel Burkhardt (FSTI)
  • ... 

Draft from Daniel Burkhardt

Short definition/description of this topic: This involves using knowledge graphs to verify the factual accuracy of information generated by LLMs. By cross-referencing LLM outputs with the structured data in KGs, this approach can identify and correct inaccuracies, ensuring that the generated information is reliable and trustworthy. 

literatur: https://arxiv.org/abs/2404.00942, https://aclanthology.org/2023.acl-long.895.pdf, https://arxiv.org/pdf/2406.01311 


  • Content ...
  • Content ...
  • Content ... 

How do I enhance LLM reasoning through KGs? (2.3 – Answer Augmentation) – length: up to one page

Lead: Daniel Burkhardt

Draft from Daniel Burkhardt

Short definition/description of this topic: KG-Enhanced LLM Reasoning refers to the use of knowledge graphs to improve the reasoning capabilities of LLMs. By incorporating structured knowledge, LLMs can perform more complex reasoning tasks, such as multi-hop reasoning, where multiple pieces of information are connected to derive a conclusion.

?Leo H: could also include  Tool-Augmented Learnin approaches as a subtopic, e.g. "KG-enhanced generation" (querying KGs during inference for factual input or additional verification context): https://arxiv.org/abs/2302.04761, https://arxiv.org/pdf/2305.11554 

  • Content ...
  • Content ...
  • Content ... 

Answer 1: KG-Guided Multi-hop Reasoning

Contributors:

  • Daniel Burkhardt (FSTI)
  • Daniel Baldassare (doctima)
  • Please add yourself if you want to contribute ...
  • ... 

Draft from Daniel Burkhardt

Short definition/description of this topic: This involves using knowledge graphs to facilitate multi-hop reasoning, where LLMs connect multiple entities and relationships to answer complex questions. This approach enhances the reasoning depth of LLMs by providing a structured path through interconnected data points in KGs.

literature: https://neo4j.com/developer-blog/knowledge-graphs-llms-multi-hop-question-answering/, https://link.springer.com/article/10.1007/s11280-021-00911-5

  • Content ...
  • Content ...
  • Content ... 

Answer 2: KG-Based Consistency Checking in LLM Outputs

Contributors:

  • Daniel Burkhardt (FSTI)
  • Daniel Baldassare (doctima)
  • Michael Wetzel (Coreon)
  • ... 

Draft from Daniel Burkhardt

Short definition/description of this topic: KG-Based Consistency Checking involves using knowledge graphs to ensure the consistency of LLM outputs. By comparing generated content with the structured data in KGs, this method can identify inconsistencies and improve the coherence of LLM-generated information.

literature:https://www.researchgate.net/publication/382363779_Knowledge-based_Consistency_Testing_of_Large_Language_Models

  • Content ...
  • Content ...
  • Content ... 

How do I evaluate LLMs through KGs? (3) – length: up to one page

Answer 1: Using KGs to Evaluate LLM Knowledge Coverage

Maybe add additional properties such as factuality, correctness, precision etc. or perhaps keep these that we have right now and call them "selected properties" ... 

Lead: Fabio

Contributors:

  • Daniel Burkhardt (FSTI)
  • Daniel Baldassare (doctima)
  • Fabio Barth (DFKI)
  • ... 

Draft from Daniel Burkhardt

Short definition/description of this topic: This involves using knowledge graphs to analyze and evaluate various aspects of LLMs, such as knowledge coverage and biases. KGs provide a structured framework for assessing how well LLMs capture and represent knowledge across different domains. This involves assessing the extent to which LLMs cover the knowledge represented in KGs. By comparing LLM outputs with the structured data in KGs, this approach can identify gaps in knowledge and areas for improvement in LLM training and performance

literature: https://www.amazon.science/publications/grapheval-a-knowledge-graph-based-llm-hallucination-evaluation-framework


  • Content ...
  • Content ...
  • Content ... 

Answer 2: Analyzing LLM Biases through KG Comparisons

Contributors:

  • Daniel Burkhardt (FSTI)
  • Daniel Baldassare (doctima)
  • Fabio Barth (DFKI)
  • Max Ploner (HU)
  • ... 

Draft from Daniel Burkhardt

Short definition/description of this topic: This involves using knowledge graphs to identify and analyze biases in LLMs. By comparing LLM outputs with the neutral, structured data in KGs, this approach can highlight biases and suggest ways to mitigate them, leading to more fair and balanced AI systems.


  • Content ...
  • Content ... 

literature: https://arxiv.org/abs/2405.04756

  • No labels