Skip to main content
QUICK REVIEW

[Paper Review] Infusing Knowledge into Large Language Models with Contextual Prompts

Kinshuk Vasisht, Balaji Ganesan|arXiv (Cornell University)|Mar 3, 2024
Topic Modeling4 citations
TL;DR

This paper proposes a method to infuse knowledge into large language models (LLMs) by generating contextual prompts from domain-specific corpora instead of relying on structured knowledge graphs. By fine-tuning LLMs on input prompts augmented with relevant context sentences retrieved via entity-based search, the approach achieves significant performance gains—e.g., Hits@1 of 0.827 on TACRED and 0.805 on KELM-TEKGEN—demonstrating effective knowledge infusion even for low-resource or underrepresented entities.

ABSTRACT

Knowledge infusion is a promising method for enhancing Large Language Models for domain-specific NLP tasks rather than pre-training models over large data from scratch. These augmented LLMs typically depend on additional pre-training or knowledge prompts from an existing knowledge graph, which is impractical in many applications. In contrast, knowledge infusion directly from relevant documents is more generalisable and alleviates the need for structured knowledge graphs while also being useful for entities that are usually not found in any knowledge graph. With this motivation, we propose a simple yet generalisable approach for knowledge infusion by generating prompts from the context in the input text. Our experiments show the effectiveness of our approach which we evaluate by probing the fine-tuned LLMs.

Motivation & Objective

  • To address the impracticality of maintaining structured knowledge graphs for domain-specific or low-resource entities in real-world NLP applications.
  • To overcome limitations of existing knowledge infusion techniques that depend on pre-existing knowledge bases or entity embeddings.
  • To enable effective knowledge infusion for entities not well-represented in knowledge graphs, such as rare or domain-specific individuals.
  • To develop a scalable, generalizable, and efficient method for knowledge infusion using only unstructured text corpora and fine-tuning.
  • To evaluate the impact of context length and quality on downstream knowledge-intensive NLP tasks like relation prediction and open-domain question answering.

Proposed method

  • Retrieve relevant context sentences from a domain-specific corpus using a search index, based on entities mentioned in the input prompt.
  • Generate contextual prompts by augmenting input prompts with retrieved sentences that describe the entities involved.
  • Fine-tune a pre-trained LLM (e.g., Flan-T5) on the augmented prompts to infuse knowledge from the retrieved context.
  • Use entity linking and disambiguation to improve context retrieval accuracy when structured knowledge graphs are available.
  • Extend the method to other modalities such as tabular data and graphs, enabling broader applicability.
  • Evaluate performance on knowledge-intensive tasks like relation prediction and open-domain question answering using standard metrics.

Experimental results

Research questions

  • RQ1Can contextual prompts derived from unstructured domain corpora effectively infuse knowledge into LLMs without relying on structured knowledge graphs?
  • RQ2How does the length and quality of retrieved context affect the performance of knowledge-infused LLMs on downstream tasks?
  • RQ3Does the proposed method outperform existing knowledge infusion techniques that use factual triples or soft prompts?
  • RQ4Can the method generalize to low-resource or underrepresented entities not found in knowledge bases?
  • RQ5How effective is the approach in real-world domains like legal text, where knowledge graphs are sparse or incomplete?

Key findings

  • The method achieved a Hits@1 score of 0.827 on the TACRED dataset when fine-tuned with contextual prompts, a substantial improvement over the base model’s 0.050.
  • On the KELM-TEKGEN dataset, the model with contextual prompts reached a Hits@1 of 0.805, compared to 0.056 for the base fine-tuned model.
  • Increasing context length improved performance, with Hits@1 rising from 0.846 to 0.914 on TACRED when using longer context, indicating context quality enhances knowledge access.
  • The approach achieved a 20.0% exact match score on the TriviaQA question-answering task when using contextual prompts, outperforming the base model (16.7%) and the fine-tuned-only model (20.0%).
  • In a legal domain setting, the method improved Hits@10 from 0.245 to 0.290 and MRR from 0.200 to 0.217, showing effectiveness even in low-resource, sparse-knowledge environments.
  • The method demonstrated robustness in scenarios where knowledge graphs are incomplete or unavailable, proving effective for entities not present in Wikidata or similar repositories.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.