Biomedical knowledge graph-optimized prompt generation for large language models
Karthik Soman, Peter W. Rose, John H Morris, Rabia E Akbas, Brett Smith, Braian Peetoom, Catalina Villouta-Reyes, Gabriel Cerono and 6 more
Why it has this license class
AChecked 2 Nov 2026. Open license (CC-BY, CC-BY-SA, CC0, public domain): full text indexed and used in synthesis.
| Source | License | Open-access status | Read as |
|---|---|---|---|
| openalex | cc-by | gold | Green |
| crossref | https://creativecommons.org/licenses/by/4.0/ | — | Green |
| unpaywall | cc-by | gold | Green |
| europepmc | cc by | — | Green |
Abstract
BMOTIVATION: Large language models (LLMs) are being adopted at an unprecedented rate, yet still face challenges in knowledge-intensive domains such as biomedicine. Solutions such as pretraining and domain-specific fine-tuning add substantial computational overhead, requiring further domain-expertise. Here, we introduce a token-optimized and robust Knowledge Graph-based Retrieval Augmented Generation (KG-RAG) framework by leveraging a massive biomedical KG (SPOKE) with LLMs such as Llama-2-13b, GPT-3.5-Turbo, and GPT-4, to generate meaningful biomedical text rooted in established knowledge. RESULTS: Compared to the existing RAG technique for Knowledge Graphs, the proposed method utilizes minimal graph schema for context extraction and uses embedding methods for context pruning. This optimization in context extraction results in more than 50% reduction in token consumption without compromising the accuracy, making a cost-effective and robust RAG implementation on proprietary LLMs. KG-RAG consistently enhanced the performance of LLMs across diverse biomedical prompts by generating responses rooted in established knowledge, accompanied by accurate provenance and statistical evidence (if available) to substantiate the claims. Further benchmarking on human curated datasets, such as biomedical true/false and multiple-choice questions (MCQ), showed a remarkable 71% boost in the performance of the Llama-2 model on the challenging MCQ dataset, demonstrating the framework's capacity to empower open-source models with fewer parameters for domain-specific questions. Furthermore, KG-RAG enhanced the performance of proprietary GPT models, such as GPT-3.5 and GPT-4. In summary, the proposed framework combines explicit and implicit knowledge of KG and LLM in a token optimized fashion, thus enhancing the adaptability of general-purpose LLMs to tackle domain-specific questions in a cost-effective fashion. AVAILABILITY AND IMPLEMENTATION: SPOKE KG can be accessed at https://spoke.rbvi.ucsf.edu/neighborhood.html. It can also be accessed using REST-API (https://spoke.rbvi.ucsf.edu/swagger/). KG-RAG code is made available at https://github.com/BaranziniLab/KG_RAG. Biomedical benchmark datasets used in this study are made available to the research community in the same GitHub repository.
Claims built on this paper
D- Structuring retrieval around entities or a minimal graph schema cuts cost without sacrificing accuracy: López et al. 2025's entity-based CLEAR pipeline reduced token usage and inference time by over 70% with improved performance, while Soman et al. 2024's KG-RAG cut token consumption by more than 50% without compromising accuracy. Trace →
- Structuring retrieval around domain entities or knowledge-graph schema, rather than raw embeddings alone, cuts cost substantially without hurting accuracy: López et al. 2025 report over 70% token and time savings with improved F1 for clinical extraction, and Soman et al. 2024 report over 50% token reduction for biomedical QA. Trace →
- The bundle contains two competing answers to stale parametric knowledge: Luo et al. 2024 demonstrate parametric updating—LoRA adapters efficiently augment LLMs with neuroscience knowledge—and cast RAG merely as a complementary approach, whereas Soman et al. 2024 avoid fine-tuning because of its computational overhead and instead give the LLM a nonparametric memory through KG-based RAG. Trace →
- Biomedical grounding in the bundle now extends beyond retrieval to direct tool use: Jin et al. 2024's GeneGPT prompts LLMs to call NCBI Web APIs and averages 0.83 on the GeneTuring benchmark, largely surpassing retrieval-augmented LLMs such as the new Bing (0.44)—a contrasting strategy to Soman et al. 2024's KG-optimized retrieval and Xu et al. 2025's multi-source evidence retrieval. Trace →
- Jannat et al. 2026 reinforce the nonparametric side of the bundle's stale-knowledge debate with a constraint Soman et al. 2024 do not name: like Soman, they call updating models for emerging knowledge computationally expensive and time-consuming, and they add that biomedical fine-tuning is constrained by limited labeled data. Trace →
- The cost and latency barriers Chen et al. 2026 list among clinical LLM deployment challenges are already being attacked by retrieval redesign inside the bundle: Soman et al. 2024's KG context pruning cut token consumption by over 50% without compromising accuracy, and López et al. 2025's entity-based CLEAR cut token usage and inference time by over 70% with improved performance. Trace →
- Yang et al. 2025 state at survey level the cost rationale the bundle's systems implement: RAG mitigates computational challenges by offloading knowledge retrieval to external databases rather than storing all knowledge internally. Soman et al. 2024 and López et al. 2025 realize those savings concretely, cutting token consumption by over 50% and over 70% respectively. Trace →