D r KGC : Dynamic Subgraph Retrieval-Augmented LLM s for Knowledge Graph Completion across General and Biomedical Domains (2025)

Abstract: Knowledge graph completion (KGC) aims to predict missing triples in knowledge graphs (KGs) by leveraging existing triples and textual information. Recently, generative large language models (LLMs) have been increasingly employed for graph tasks. However, current approaches typically encode graph context in textual form, which fails to fully exploit the potential of LLMs for perceiving and reasoning about graph structures. To address this limitation, we propose DrKGC (Dynamic Subgraph Retrieval-Augmented LLMs for Knowledge Graph Completion). DrKGC employs a flexible lightweight model training strategy to learn structural embeddings and logical rules within the KG. It then leverages a novel bottom-up graph retrieval method to extract a subgraph for each query guided by the learned rules. Finally, a graph convolutional network (GCN) adapter uses the retrieved subgraph to enhance the structural embeddings, which are then integrated into the prompt for effective LLM fine-tuning. Experimental results on two general domain benchmark datasets and two biomedical datasets demonstrate the superior performance of DrKGC. Furthermore, a realistic case study in the biomedical domain highlights its interpretability and practical utility.

## introduction knowledge graphs (kgs) are structured representations of real-world facts, typically formulated as a set of triples that consist of entities and their relationships @xcite . biomedical knowledge graphs (bkgs) are specialized forms of kgs tailored to the biomedical domain. in a bkg, nodes represent biomedical entities-such as molecules, diseases, and genes-while edges capture various relationships among these entities, typically through functional predicates relevant to the biomedical domain (e.g., "treats," "inhibits," and "causes") @xcite . bkgs have proved instrumental in numerous biological tasks, including drug repurposing, side-effect prediction, and drug-drug interaction detection @xcite @xcite . bkgs, like other kgs, often suffer from incompleteness, typically manifested as missing edges between nodes @xcite . this incompleteness may arise because (1) the facts are absent from the data source, or (2) they remain undiscovered by humans. such issues are particularly prevalent in bkgs, as their data primarily originates from experimental results, clinical trials, and scientific literature. inferring missing facts in knowledge graphs has led to the development of a wide range of knowledge graph completion (kgc) models. these include structure-based methods (e.g., transe @xcite and r-gcn @xcite ), rule-based methods (e.g., neural-lp @xcite , and text-based methods (e.g., kg-bert @xcite ). recently, the advent of generative large language models (llms) has given rise to a new class of generation-based kgc approaches. unlike traditional text-based methods that encode entity and relation descriptions into fixed embeddings, these approaches leverage llms to generate missing triples in a sequence-tosequence manner, often relying on prompting or fine-tuning strategies (e.g., kicgpt @xcite , kopa @xcite ). although generation-based methods have shown promise in kgc, they face several key limitations: ❶ structural information loss: these methods often fail to preserve the rich structural information inherent in knowledge graphs. while graph paths or subgraphs can be encoded as text prompts, overly long inputs introduce noise and increase compu-tational costs. ❷ static embedding limitations: incorporating structural embeddings into llms offers a partial solution but remains limited, as such embeddings are static and do not adapt to the queryspecific context or dynamic subgraph structure. ❸ generic responses from llms: in the absence of additional constraints, llms tend to generate generic predictions influenced by pretraining data. this is especially problematic in biomedical kgs, where high-degree entities and many-to-many relations make multiple answers plausible-yet not all are contextually correct or desirable. to tackle these challenges, we propose dynamic subgraph retrieval-augmented llms for knowledge graph completion (drkgc). our approach begins by converting incomplete triples into natural language questions using an automatically generated template lexicon. it then employs lightweight models to learn global structural embeddings of entities, discover logical rules and coarsely rank candidate entities based on their relevance to the query. this anchors the reasoning process in semantic and structural context without requiring long or noisy text prompts (❶). to overcome the limitations of static embeddings (❷), drkgc dynamically constructs a query-specific subgraph using retrieved candidates and learned logical rules. this enables the model to focus on relevant local structures and incorporate adaptive, context-aware structural cues during inference. finally, to mitigate the risk of generic or irrelevant responses (❸), drkgc restricts the output space by explicitly defining a candidate entity set. the prompt is enriched with both global and local graph signals, guiding the llm to generate contextually grounded and targeted predictions, especially in cases involving complex, many-to-many relations. the key contributions of our work are as follows: ## methodology in this section, we introduce the proposed drkgc. we begin with the preliminary and an overview, followed by a detailed description of each component. ## conclusion in this paper, we propose a novel kgc framework, drkgc. drkgc fully exploits graph context information and flexibly integrates mechanisms such as dynamic subgraph information aggregation, embedding injection, and rag, overcoming the limitations of previous generation-based methods in structural information loss, static entity representations, and generic llm responses. experimental results demonstrate that drkgc achieves state-ofthe-art performance on general kgs and performs exceptionally well on domain-specific kgs such as bkgs. by capturing graph context to generate informative subgraphs, drkgc also enhances model interpretability, which is particularly valuable for biomedical applications.