Source-linked AI summary

Give Us the Facts: Enhancing Large Language Models with Knowledge Graphs for Fact-aware Language Modeling

Linyao Yang, Hongyang Chen, Zhao Li, Xiao Ding, Xindong Wu

arXiv:2306.11489v2cs.CLcs.AI

TL;DR

LLMs remain limited in recalling and correctly using factual knowledge for grounded text, despite their strong language capabilities. This paper surveys KGPLMs and their applications, then proposes KGLLMs to enhance LLM factual reasoning; it also identifies trade-offs and complementary alternatives.

  • Problem

    LLMs can generate fluent language but still struggle to recall and correctly apply factual knowledge in knowledge-grounded text.

  • Method

    The paper systematically reviews KGPLMs, categorizes their enhancement methods and applications, compares LLMs with KGs, and proposes KGLLMs.

  • Results

    KGPLMs outperform unenhanced BERT on entity typing, relation classification, and question answering by F1-score, while adding external knowledge increases model size and runtime.

  • Takeaways & Limitations

    The paper argues that KGs retain value alongside LLMs and can provide explicit factual knowledge for fact-aware language modeling.

  • Takeaways & Limitations

    Data augmentation and retrieval augmentation model factual knowledge differently from KGs, with data augmentation ignoring relationships between entities.

Abstract

from arXiv · show

Recently, ChatGPT, a representative large language model (LLM), has gained considerable attention due to its powerful emergent abilities. Some researchers suggest that LLMs could potentially replace structured knowledge bases like knowledge graphs (KGs) and function as parameterized knowledge bases. However, while LLMs are proficient at learning probabilistic language patterns based on large corpus and engaging in conversations with humans, they, like previous smaller pre-trained language models (PLMs), still have difficulty in recalling facts while generating knowledge-grounded contents. To overcome these limitations, researchers have proposed enhancing data-driven PLMs with knowledge-based KGs to incorporate explicit factual knowledge into PLMs, thus improving their performance to generate texts requiring factual knowledge and providing more informed responses to user queries. This paper reviews the studies on enhancing PLMs with KGs, detailing existing knowledge graph enhanced pre-trained language models (KGPLMs) as well as their applications. Inspired by existing studies on KGPLM, this paper proposes to enhance LLMs with KGs by developing knowledge graph-enhanced large language models (KGLLMs). KGLLM provides a solution to enhance LLMs' factual reasoning ability, opening up new avenues for LLM research.

I. INTRODUCTION

LLMs exhibit emergent abilities but remain limited in recalling and correctly applying facts for knowledge-grounded generation. This paper reviews KGPLMs and proposes KG-enhanced LLMs to improve factual knowledge modeling.

  • LLM background: Scaling PLM parameters or data can produce emergent abilities that distinguish LLMs from smaller PLMs.Emergent abilities are abilities absent in small models but arising in larger ones.
  • LLM background: LLMs can engage in continuous conversation and complete complex tasks, prompting questions about replacing structured KGs as parameterized knowledge bases.ChatGPT is described as being based on GPT-3.5, supervised fine-tuning, and RLHF.
  • Motivation: LLMs often struggle to recall relevant facts and apply correct knowledge when generating knowledge-grounded content.The paper identifies factual recall and application as a persistent limitation despite LLMs’ language abilities.
  • Paper scope: Existing KGPLM research is categorized into before-training, during-training, and post-training enhancement methods, while prior surveys lack a systematic KGPLM focus.The paper positions its review as broader and more up to date than earlier surveys.
  • Contributions: The paper comprehensively reviews KGPLMs and their applications, compares LLMs with KGs, and proposes KGLLMs with future research directions.Its stated contributions include a KGPLM review, evaluation overview, LLM–KG comparison, and KG-enhanced LLM proposal.

A. Background of PLMs

PLMs learn contextual representations through pretraining and are organized into encoder-only, decoder-only, and encoder-decoder frameworks. Their training objectives span word-, phrase-, and sentence-level tasks.

  • PLM foundations: PLMs learn dense, continuous word representations from large corpora and can be fine-tuned for downstream tasks.Examples include summarization, classification, and text generation.
  • Model frameworks: Encoder-only models recover masked tokens bidirectionally, decoder-only models predict tokens autoregressively, and encoder-decoder models generate outputs from inputs.Encoder-only models support contextual representation learning, decoder-only models suit generation, and encoder-decoder models support sequence-to-sequence tasks.
  • Pretraining tasks: Masked language modeling randomly masks input tokens and trains PLMs to reconstruct them from context.MLM is presented as a typical word-level pretraining task.
  • Pretraining tasks: Replaced token detection introduces corrupted alternatives and trains the model to identify whether each token was replaced.RTD can better reflect vocabulary changes in real text and support handling unknown or misspelled words.
  • Pretraining tasks: Phrase- and sentence-level objectives include span boundary prediction, next sentence prediction, sentence order prediction, and related reordering tasks.These objectives target syntactic structure, context relations, sentence order, or specialized task performance.

B. Milestones

PLM milestones progressed from context-aware recurrent representations to Transformer-based architectures and distinct encoder-only, decoder-only, and encoder-decoder frameworks.

  • ELMo: ELMo used bidirectional LSTMs to learn context-aware word representations but struggled with long sequences.Its objective modeled tokens from both preceding and following context.
  • Transformer: Transformers introduced self-attention, enabling dependence modeling among input tokens with parallel processing and improved efficiency.The attention output uses query, key, and value matrices.
  • Encoder-only PLMs: Encoder-only PLMs use bidirectional Transformers with masked-language modeling and next-sentence prediction for self-supervised training.RoBERTa, DistilBERT, ERNIE, ALBERT, ELECTRA, and DeBERTa are representative models.
  • Decoder-only PLMs: Decoder-only PLMs use unidirectional Transformers to predict the next token autoregressively, supporting language understanding and text generation.GPT and its improved models primarily adopt this framework.
  • Encoder-decoder PLMs: Encoder-decoder PLMs use an encoder for latent input representations and a decoder for target generation, with T5 converting NLP tasks into text-to-text format.BART is another encoder-decoder example using a denoising sequence-to-sequence architecture.

C. Scaling PLMs to LLMs

Scaling PLMs in parameters and data produced LLMs with emergent abilities and stronger performance on complex tasks. ChatGPT exemplifies this progression through GPT pretraining, supervised fine-tuning, and RLHF.

  • Scaling: Increasing parameter and data scales led enlarged PLMs to exhibit abilities absent from smaller models, motivating their scaling into LLMs.The paper frames emergent abilities as special capabilities arising at sufficiently large scales.
  • LLM architectures: LLMs typically contain hundreds of billions of parameters and include both encoder-decoder and predominantly decoder-only architectures.Examples include GLM, Switch, Flan T5, ChatGLM, GPT-3, PaLM, GPT-4, and LLaMA2.
  • ChatGPT: ChatGPT adapts GPT-3.5 for dialogue through large-corpus pretraining, supervised fine-tuning on labeler demonstrations, and reinforcement learning from human feedback.RLHF trains a reward model from direct human evaluator feedback and optimizes the GPT model as a reinforcement-learning problem.
  • GPT-4: GPT-4 extends text input to multimodal signals and underwent six months of iterative alignment with an added safety reward in RLHF.The paper also mentions predictable scaling among GPT-4’s enhanced optimization methods.
  • Model comparison: The comparison table tracks PLM characteristics, while the accompanying text notes that the largest model’s parameter size increased year by year.The supplied table passages provide the title but no individual table values.

D. Pros and Cons of LLMs

LLMs show strong task performance, zero-shot and in-context learning, reasoning, instruction following, alignment, and tool use. They nevertheless face factual, structural, reasoning, domain, currency, safety, and consistency limitations.

  • Advantages: LLMs achieve better performance than smaller PLMs across many NLP tasks and can solve some complex tasks traditional models cannot.The paper presents these capabilities as broad advantages of LLMs.
  • Zero-shot Learning: ChatGPT outperformed previous models on 9 of 13 datasets with zero-shot learning and fully fine-tuned task-specific models on 4 tasks.The passage attributes this performance to rich input data and large parameter scale.
  • In-context Learning: In-context learning enables LLMs to learn tasks from a few demonstrations embedded in formatted natural-language prompts.The prompt includes a task description and examples showing how to perform it.
  • Step-by-step Reasoning: Chain-of-thought prompting adds intermediate reasoning steps and supports arithmetic, commonsense, and symbolic reasoning tasks.These tasks are described as typically beyond smaller PLMs’ capabilities.
  • Capabilities: Instruction tuning, RLHF, and tool manipulation extend LLMs’ abilities to unseen instructed tasks, aligned responses, and specialized or real-time tasks.External tools include search engines, calculators, and compilers.
  • Unstructured Generation: LLMs may generate structurally unconstrained text because pretraining emphasizes local context while overlooking global syntactic structure.This is especially difficult for formal rules, grammar, and fine-grained structural constraints.
  • Hallucination: Hallucination occurs when generated knowledge-grounded text contradicts sources or lacks supporting evidence, creating deployment risks.The passage states that structured KGs can be incorporated dynamically to produce more factual rationales and reduce hallucination.
  • Reasoning Limitations: LLMs can produce invalid reasoning paths, prompt-sensitive fact forecasts, shallow entity-relationship predictions, and errors in numerical or symbolic computation.The paper links these difficulties to reliance on word overlap, co-occurrence, and sequence patterns.

III. KGPLMS

KGPLMs incorporate knowledge graphs into pre-trained language models to strengthen knowledge modeling. The paper organizes these methods by when KGs participate in pre-training and summarizes representative models.

  • KGPLMs incorporate knowledge graphs into PLMs to improve their knowledge modeling ability.
  • Table II summarizes representative KGPLMs.
  • Existing KGPLMs are categorized as before-training, during-training, or post-training enhancement methods according to when KGs participate in pre-training.

A. Before-training Enhancement KGPLMs

Before-training enhancement methods unify text and KG triples in the input or training data to improve knowledge modeling and reasoning without increasing model size or training time. They remain useful for data-scarce domains but require additional preprocessing resources and may introduce noise.

  • Before-training methods address heterogeneous text–KG embedding spaces and knowledge noise by unifying text and KG triples in a common input format.
  • Expand Input Structures: Input-structure methods merge KG subgraphs with sentence trees and use structural controls such as soft positions, visible matrices, and mask-self-attention.
  • Enrich Input Information: Input-information methods enrich text embeddings with entity information, while DKPLM replaces long-tail entity representations with representations generated from knowledge triples.
  • Generate New Data: KG-based data generation constructs artificial training examples, including commonsense question-answering data with aligned entities, masked sentences, and distractor choices.
  • Optimize Word Masks: Knowledge masking selects entity-centered targets rather than random masks, forcing models to learn knowledge needed to predict masked contents accurately.
  • Before-training methods can improve corpus structure and reasoning without increasing model size or training time, but preprocessing requires extra resources and may introduce noise.

B. During-training Enhancement KGPLMs

During-training enhancement methods let PLMs learn text and KG information concurrently through added encoders, layers, adapters, or modified tasks. They can improve downstream performance and domain customization, but increase complexity, training demands, and overfitting risk.

  • During-training methods enable PLMs to learn knowledge directly by jointly processing text and KGs through external knowledge components.
  • Knowledge encoders integrate token and entity representations, while knowledge encoding layers retrieve KG entity embeddings and recontextualize input entities.
  • Add Independent Adapters: Independent adapters inject knowledge without changing the original PLM parameters and support continual fusion of knowledge from different tasks or sources.
  • Modify the Pre-training Task: Modified pre-training tasks replace or augment masked language modeling with entity-level masking, word-sense prediction, or multi-task knowledge learning.
  • During-training methods often improve downstream performance and support domain or task customization, but larger architectures can increase training time and overfitting risk.

C. Post-training Enhancement KGPLMs

Post-training enhancement methods inject domain knowledge through fine-tuning on additional data and tasks or through automatically generated prompts. They are low-cost and effective for specific tasks, but depend on prior knowledge and can constrain generation flexibility.

  • Post-training methods inject domain-specific knowledge through fine-tuning on additional data and tasks or through automatically generated prompts.
  • Fine-tune PLMs with Knowledge: Fine-tuning methods include hidden-representation modulation, knowledge adapters, adapter fusion, and textual inference frameworks for domain tasks.
  • Generate Knowledge-based Prompts: Knowledge-to-text prompting transforms structured knowledge into textual descriptions, while dynamic KGs can be constructed with open information extraction and rule-based post-processing.
  • KGPLMs outperform unenhanced BERT on entity typing, relation classification, and question answering according to Table III’s F1-score results.
  • Post-training methods are low-cost and effective for specific tasks, but depend on prior knowledge and external resources and may constrain generation flexibility.

D. Effectiveness and Efficiency of KGPLMs

KGPLMs improve knowledge-grounded task performance over unenhanced PLMs, but incorporating KG knowledge increases parameter size and running time. Their applications span entity, relation, question-answering, and other NLP tasks.

  • Effectiveness: KGPLMs outperform BERT on entity typing, relation classification, and question answering using F1-score.Table III summarizes improvements over unenhanced BERT across all three knowledge-grounded tasks.
  • Efficiency: KG incorporation consistently makes pre-training, fine-tuning, and inference slower than for BERT because KGPLMs add knowledge encoder modules.The added knowledge increases computational requirements even though it can enable higher performance.
  • Efficiency: KALM achieves better performance than 1.5B-parameter GPT-2 on some downstream tasks with 775M parameters.This suggests that external knowledge can support satisfactory performance with fewer parameters and training resources.
  • Applications: KGPLMs capture factual and relational information more effectively than traditional PLMs and support multiple downstream applications.Applications include chatbots, programming assistants, named entity recognition, relation extraction, sentiment analysis, knowledge graph completion, and question answering.
  • Applications: KGPLMs support structured reasoning and explainable predictions in question answering by combining PLMs with knowledge graphs.OreoLM uses collaborative reasoning between a PLM and a differentiable knowledge graph reasoning module.

V. CAN LLMS REPLACE KGS?

Existing studies do not support treating LLMs as complete replacements for knowledge graphs: PLMs can recall some stored facts, but factual retrieval and reasoning remain unreliable. KGs provide accessible, consistent, interpretable structures that complement LLM flexibility.

  • Evidence for LLM knowledge: PLMs can contain relational knowledge and recall stored facts without fine-tuning, providing proof-of-concept evidence for their use as knowledge bases.Experiments tested cloze-style reasoning and the storage and querying of millions of entity facts.
  • Evidence against replacement: PLMs struggle to accurately recall relational facts, and benchmark studies question their viability as knowledge bases.Reported issues include sense-making difficulty, prompt-template dependence, and weak closed-book factual answering.
  • Evidence against replacement: Larger LLMs still produce unreliable encyclopedic facts and commonsense properties, with fact prediction dependent on prompts and included entities.They also have limited ability to infer relationships between actions and events.
  • Complementary strengths: KGs are easier to access and edit and offer stronger consistency, reasoning ability, and interpretability than LLMs.LLMs offer greater flexibility through unsupervised learning, while KGs explicitly organize real-world facts and relationships.
  • Complementary strengths: LLMs and KGs complement each other, motivating KG enhancement as a way to improve performance on knowledge-grounded tasks.The paper also describes using LLMs to construct KGs through information extraction and prompted symbolic extraction.

VI. ENHANCING LLMS WITH KGS

The paper proposes KGLLMs as a fact-aware language-modeling direction because even scaled LLMs remain prone to unfactual responses and commonsense errors. It adapts KGPLM enhancement strategies while identifying open challenges in efficiency, knowledge integration, interpretability, and domain specificity.

  • Motivation and proposal: KGLLMs are proposed to improve LLM learning of factual knowledge and achieve fact-aware language modeling.The proposal responds to unfactual responses and commonsense errors that persist despite scaling beyond 100B parameters.
  • Development framework: All three KGPLM enhancement types—before-training, during-training, and post-training—can be applied to developing KGLLMs.Before-training methods can construct KG-extended text, while post-training methods can use knowledge-extended data or knowledge-grounded tasks.
  • Alternative enhancement methods: Data augmentation and retrieval augmentation are additional approaches for improving LLM factual language modeling beyond KG enhancement.Data augmentation refines pre-training data, while retrieval augmentation supplies external information during use.
  • Open challenges: KGLLMs require more computational resources and time than plain LLMs because knowledge must be preprocessed and encoded.The paper calls for studying KGLLM scaling laws to identify optimal parameter sizes.
  • Open challenges: Effective knowledge integration remains unresolved because methods can perform well on particular tasks while underperforming on others.Further research is needed to select valuable knowledge and avoid catastrophic forgetting with vast or conflicting knowledge.
  • Open challenges: Future KGLLM research should address interpretability, domain-specific knowledge graphs, and multimodal or temporal knowledge.The paper notes that interpretability methods are insufficiently studied and domain-specific KGLLMs remain limited.

VII. CONCLUSION

The paper surveys KGPLMs to assess the value of KGs in the LLM era and proposes KGLLMs for fact-aware language modeling. It frames future work around incorporating KGs into LLMs and developing their factual knowledge capabilities.

  • Paper contributions: The paper reviews PLM background, categorizes KGPLMs into three enhancement types, and examines their applications.It also analyzes whether PLMs and LLMs can replace KGs based on existing studies.
  • Paper contributions: The paper proposes enhancing LLMs with KGs to improve factual knowledge learning through fact-aware language modeling.It identifies questions concerning the value of KGs, methods for incorporating them into LLMs, and future KGLLM development.
Loading 2306.11489v2…