Knowledge Fusion via Bidirectional Information Aggregation

Songlin Zhai, Guilin Qi, Yue Wang, Meng Yuan · DOI

Abstract

Knowledge graphs (KGs) are the cornerstone of the semantic web, offering up-to-date representations of real-world entities and relations. Yet large language models (LLMs) remain largely static after pre-training, causing their internal knowledge to become outdated and limiting their utility in time-sensitive web applications. To bridge this gap between dynamic knowledge and static models, a prevalent approach is to enhance LLMs with KGs. However, prevailing methods typically rely on parameter-invasive fine-tuning, which risks catastrophic forgetting and often degrades LLMs' general capabilities. Moreover, their static integration frameworks cannot keep pace with the continuous evolution of real-world KGs, hindering their deployment in dynamic web environments. To bridge this gap, we introduce KGA (Knowledge Graph-guided Attention), a novel framework that dynamically integrates external KGs into LLMs exclusively at inference-time without any parameter modification. Inspired by research on neuroscience, we rewire the self-attention module by innovatively introducing two synergistic pathways: a bottom-up knowledge fusion pathway and a top-down attention guidance pathway. The bottom-up pathway dynamically integrates external knowledge into input representations via input-driven KG fusion, which is akin to the stimulus-driven attention process in the human brain. Complementarily, the top-down pathway aims to assess the contextual relevance of each triple through a goal-directed verification process, thereby suppressing task-irrelevant signals and amplifying knowledge-relevant patterns. By synergistically combining these two pathways, our method supports real-time knowledge fusion. Extensive experiments on four benchmarks verify KGA's strong fusion performance and efficiency.

Introduction

The rapid evolution of information in the digital age presents a fundamental challenge for Large Language Models (LLMs). While these models possess impressive reasoning capabilities, their internal knowledge base is effectively "frozen" post-training. This leads to the "outdated knowledge" problem, where models provide incorrect or obsolete information about real-world entities and events. Knowledge Graphs (KGs) serve as a vital counterpoint, offering structured, up-to-date repositories of facts. However, the bridge between static LLMs and dynamic KGs remains precarious.

Existing integration strategies generally fall into two categories. Parameter-invasive methods, such as fine-tuning, attempt to bake new knowledge into the model's weights. This often results in "catastrophic forgetting," where the model's general reasoning and linguistic abilities degrade. On the other hand, non-invasive methods like Retrieval-Augmented Generation (RAG) or In-Context Learning (ICL) "stuff" KG triples into the prompt. This approach is plagued by high computational overhead due to the quadratic scaling of self-attention and the "attention sink" phenomenon, where the model struggles to distinguish relevant facts from irrelevant noise.

The KGA Framework

To address these limitations, we propose Knowledge Graph-guided Attention (KGA). KGA is a parameter-free, inference-time framework that "rewires" the native self-attention mechanism of a Transformer. Inspired by the dual-pathway attention processes in the human brain, KGA introduces two synergistic pathways: bottom-up knowledge fusion and top-down attention guidance.

The KGA framework re-wires the attention module within a frozen LLM layer, introducing dual pathways for knowledge integration.

The Bottom-Up Knowledge Fusion pathway mimics stimulus-driven attention. It treats the input text as a stimulus that pulls information from external KG triples. Crucially, KGA reuses the LLM's existing Query ($W^Q$), Key ($W^K$), and Value ($W^V$) matrices to project KG triples into the model's latent space. This allows for seamless semantic interaction between text and knowledge without introducing any new parameters.

Complementing this is the Top-Down Attention Guidance pathway, which mimics goal-directed attention. This pathway performs a three-stage verification process to ensure contextual relevance:

  1. Clue Extraction: The KG triple "scans" the input text to identify supporting evidence.
  2. Consolidation: Token-level clues are merged into a unified triple-level representation.
  3. Relevance Scoring: An adaptive weight ($\alpha_Z$) is calculated for each triple.

By modulating the bottom-up fusion with these top-down weights, KGA effectively amplifies knowledge-relevant patterns while suppressing task-irrelevant signals. This hierarchical integration occurs at every layer, allowing the model to perform lexical fusion in early layers and complex semantic reasoning in later ones.

Experimental Results and Discussion

We evaluated KGA across four benchmarks covering Knowledge Graph Question Answering (KGQA), KG Reasoning, and Knowledge-based Model Editing (KME).

KGA significantly outperforms zero-shot (ZSL) and in-context learning (ICL) baselines across KGQA and KG Reasoning tasks.

As shown in the comparative analysis, KGA consistently outperforms both zero-shot and ICL baselines. On the PathQuestion (2-hop) reasoning task, KGA achieved a Hit@1 score of 98.3% using a Qwen2.5-0.5B model, nearly matching the performance of specialized, heavily fine-tuned models and vastly exceeding the 73.7% achieved by ICL.

In the realm of model editing, KGA demonstrated exceptional precision. On the CounterFact benchmark, it boosted the efficacy of Llama3-8B from 0.55% to 65.45%. Importantly, KGA achieved 100% "Locality," meaning it updated specific facts without any unintended side effects on the model's broader knowledge base—a common failure mode for fine-tuning methods.

Efficiency and Robustness

KGA is not only more accurate but also significantly more efficient than context-stuffing methods. By pruning unnecessary interactions between different triples, KGA achieves linear scaling with the number of facts. In latency tests, KGA was approximately 20 times faster than ICL when processing 100 triples. Furthermore, KGA proved highly robust to noise; its performance remained stable even when the ratio of irrelevant "distractor" triples was increased, whereas ICL's performance degraded sharply.

Conclusion

KGA offers a robust and efficient solution for the real-time integration of dynamic knowledge into LLMs. By leveraging the model's existing architecture and mimicking biological attention mechanisms, it provides a pathway for LLMs to stay current with the evolving world without sacrificing their general intelligence or requiring costly retraining.

Summary updated

BibTeX
@misc{zhai2025knowledge,
  author = {Songlin Zhai and Guilin Qi and Yue Wang and Meng Yuan},
  title = {{Knowledge Fusion via Bidirectional Information Aggregation}},
  year = {2025},
  eprint = {2507.08704},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.08704},
}
Figure