Introduction
Large Language Models (LLMs) have demonstrated remarkable general-purpose capabilities, yet they frequently struggle in specialized domains such as medicine or niche technical fields. These failures often manifest as "hallucinations" or a lack of factual precision because the models were not exposed to specific domain-specific Knowledge Graphs (KGs) during pre-training. While fine-tuning is the standard approach to bridge this gap, it faces two significant challenges: data inefficiency—where models are retrained on facts they already know—and catastrophic forgetting, where new knowledge overwrites existing capabilities.
This paper introduces InfuserKI, a novel framework designed to selectively inject missing knowledge from KGs into LLMs. By utilizing a specialized "Infuser" module that monitors a model's internal hidden states, the system activates knowledge adapters only when the model encounters information it has not previously mastered. This approach reduces knowledge forgetting by up to 9% while maintaining high factual reliability.
The InfuserKI Framework
The InfuserKI pipeline operates through three distinct stages: Knowledge Detection, Knowledge Adapters, and the Knowledge Infuser gating mechanism.
1. Knowledge Detection
To avoid redundant training, the framework first "interrogates" the LLM to distinguish between known and unknown facts. The system generates multiple-choice questions (MCQs) based on KG triplets (e.g., <Subject, Relation, Object>). If the model answers correctly, the fact is deemed "known"; if it fails, the fact is categorized as "unknown" and targeted for integration.
2. Knowledge Adapters
Rather than modifying the base model's weights directly, InfuserKI employs small, parallel "adapter" modules integrated into the Feed-Forward Network (FFN) layers. These adapters are trained exclusively on the identified "unknown" facts. To ensure these facts generalize beyond simple memorization, the training process incorporates a multi-task objective: standard Question Answering (QA) loss, Next Token loss for linguistic consistency, and a Relation Classification (RC) task.
3. The Knowledge Infuser
The core innovation of the framework is the Knowledge Infuser, a gating mechanism that dynamically manages knowledge integration. By analyzing the LLM’s internal hidden states, the Infuser calculates an "infusing score" ($r^l$). If the model's internal activations suggest high confidence (indicating it already knows the answer), the Infuser blocks the adapter's input to prevent interference. Conversely, if the model appears uncertain, the Infuser "opens the gate," allowing the adapter to provide the necessary domain-specific knowledge.
Experimental Evaluation
The authors evaluated InfuserKI across several diverse benchmarks to test its reliability and generalizability:
- UMLS (Unified Medical Language System): A massive medical KG used to test domain-specific injection.
- MetaQA: A movie-domain dataset focused on multi-hop reasoning.
- PubMedQA: A downstream task used to verify if injected medical knowledge improves real-world performance.
- Model Editing Benchmarks: Tests on zsRE (zero-shot Relation Extraction) and T-REx compared InfuserKI against state-of-the-art model editing techniques.
Key Insights and Results
Reliability and Locality
InfuserKI demonstrated exceptional performance on the UMLS 2.5k dataset, achieving a Newly-learned Rate (NR) of 0.99, indicating nearly perfect acquisition of previously unknown facts. Crucially, it maintained a Remembering Rate (RR) of 0.99, significantly outperforming standard LoRA (0.80) and other editing methods like T-Patcher (0.06). This high "Locality" ensures that the model's general knowledge remains untouched while specialized facts are added.
Layer Sensitivity
An architectural analysis revealed that factual knowledge integration is most effective when adapters are placed in the bottom layers (specifically layers 3 through 12). This suggests that LLMs process factual relationships early in the transformer stack, while later layers are reserved for refining abstract concepts and linguistic formatting.
Efficiency vs. RAG
Compared to Retrieval-Augmented Generation (RAG), which requires external searches and consumes significant context window space, InfuserKI embeds knowledge directly into the model parameters. This results in lower inference latency and more concise, direct responses. The framework is also highly parameter-efficient, adding only approximately 2.5M parameters—a negligible fraction of a LLaMA-2-7B model.
Conclusion and Future Work
InfuserKI provides a robust solution for the selective integration of Knowledge Graphs into LLMs, effectively mitigating the risks of catastrophic forgetting. While the current framework excels at 1-hop knowledge triplets, future research will focus on scaling the system to handle millions of triplets and improving its performance on complex, multi-hop reasoning tasks. Additionally, the effectiveness of the integration remains partially dependent on the base model's underlying instruction-following capabilities, marking an area for further optimization in smaller or less capable base models.
Summary updated