KG-Rank: Enhancing Large Language Models for Medical QA with Knowledge Graphs and Ranking Techniques

Rui Yang, Haoran Liu, Edison Marrese-Taylor, Qingcheng Zeng, Yu He Ke, Wanxin Li, Lechao Cheng, Qingyu Chen, James Caverlee, Yutaka Matsuo, Irene Li

TL;DR

KG-Rank is a new framework designed to stop Large Language Models (LLMs) from "hallucinating" in the medical domain by grounding them in structured knowledge. By combining medical Knowledge Graphs (KGs) with sophisticated ranking and re-ranking techniques, the authors achieved an 18% improvement in factual consistency for long-form medical question answering.

What Problem Does This Paper Address?

While LLMs like GPT-4 are impressively articulate, they suffer from a lack of "factual consistency," especially in specialized fields like medicine. In a clinical setting, a hallucinated answer isn't just a nuisance—it’s a safety risk.

Existing solutions often use Retrieval-Augmented Generation (RAG) to pull in external text, but this introduces a new problem: noise. Merely retrieving external knowledge often brings in irrelevant or redundant information that can confuse the model. Furthermore, most medical QA research focuses on short, multiple-choice answers. This paper tackles the much harder task of long-form medical QA, where the model must generate coherent, multi-sentence explanations that remain strictly factual.

Methods

The authors propose a four-step pipeline called KG-Rank (Knowledge Graph-Rank):

  1. Entity Extraction and Mapping: When a user asks a question, the system uses a specialized prompt to identify key medical entities (e.g., "Atrial Fibrillation," "Stroke risk"). These are then mapped to the Unified Medical Language System (UMLS), a massive medical knowledge graph.
  2. Relation Retrieval and Triplet Ranking: The system pulls "one-hop" relations (triplets like Subject-Relation-Object) from the KG. Because one entity can have thousands of relations, KG-Rank uses three innovative ranking techniques to find the best ones:
  3. Similarity Ranking: Standard vector-based similarity between the question and the triplet.
  4. Answer Expansion Ranking: The LLM first generates a "hallucinated" draft answer. The system then uses this draft to search for triplets, capturing semantic context that the original question might have missed.
  5. MMR (Maximal Marginal Relevance): A technique that balances relevance with diversity, ensuring the LLM doesn't get five versions of the same fact.
  6. Re-Ranking: The top-ranked triplets are passed through a specialized medical cross-encoder (MedCPT) to further refine the selection, ensuring only the most clinically relevant data survives.
  7. LLM Response: Finally, the LLM is prompted with both the original question and the curated list of factual triplets to generate the final answer.
The KG-Rank workflow: from entity extraction to the final LLM response.

Datasets

The framework was evaluated on four diverse medical QA datasets:

  • LiveQA: Real-world consumer health questions.
  • ExpertQA (Med & Bio): High-quality questions verified by domain experts.
  • MedicationQA: Questions specifically about drugs and their effects.
  • Mintaka: Used to test the framework's "open-domain" capabilities (law, history, etc.) by swapping the medical KG for DBpedia/Wikipedia.

Key Insights and Ideas

  • Ranking is the Secret Sauce: The authors found that how you integrate external knowledge is just as important as what you retrieve. The multi-stage ranking process significantly reduced noise, which is often the primary cause of LLM confusion in RAG systems.
  • Hallucination as a Tool: The "Answer Expansion" technique is particularly clever. By letting the model hallucinate first and then using that hallucination to search the KG, the system uses the LLM's generative strength to improve its own factual retrieval.
  • Domain Specificity Matters: In their ablation studies, a specialized medical re-ranker (MedCPT) consistently outperformed general-purpose models like Cohere, highlighting the need for domain-specific "middle-ware" in AI pipelines.
  • Cross-Domain Potential: While built for medicine, the framework is "plug-and-play." By simply swapping the underlying Knowledge Graph, they saw a 14% improvement in non-medical fields like law and history.

Key Results

  • Quantitative: KG-Rank achieved an improvement of over 18% in ROUGE-L scores on the ExpertQA-Bio dataset.
  • Qualitative: In a critical case study regarding diet for renal failure, the vanilla LLaMA2 model incorrectly suggested high protein intake (which can be dangerous for kidney patients). The KG-Rank version correctly identified the need for low protein intake based on retrieved factual triplets.
  • Model Comparison: GPT-4 consistently benefited more from the KG-Rank framework than smaller models like LLaMA2-13b, suggesting that more powerful models are better at synthesizing the structured data provided by the KG.
Figure 2: BERTScore comparison: zero-shot setting with LLaMa2-7b and Baize-Healthcare. Ep stands for ExpertQA.

Limitations and Future Work

The authors acknowledge a few hurdles for real-world deployment:

  • Evaluation Metrics: While ROUGE and BERTScore are standard, they don't always capture clinical nuance. The authors plan to incorporate more physician-led evaluations in the future.
  • Computational Cost: The multi-stage ranking and re-ranking process increases the time it takes to generate an answer. Optimizing this efficiency is a key next step.
  • Graph Depth: The current system only looks at "one-hop" neighbors in the knowledge graph. Exploring multi-hop reasoning could allow the model to connect more complex medical concepts.

Summary updated

Abstract

Large language models (LLMs) have demonstrated impressive generative capabilities with the potential to innovate in medicine. However, the application of LLMs in real clinical settings remains challenging due to the lack of factual consistency in the generated content. In this work, we develop an augmented LLM framework, KG-Rank, which leverages a medical knowledge graph (KG) along with ranking and re-ranking techniques, to improve the factuality of long-form question answering (QA) in the medical domain. Specifically, when receiving a question, KG-Rank automatically identifies medical entities within the question and retrieves the related triples from the medical KG to gather factual information. Subsequently, KG-Rank innovatively applies multiple ranking techniques to refine the ordering of these triples, providing more relevant and precise information for LLM inference. To the best of our knowledge, KG-Rank is the first application of KG combined with ranking models in medical QA specifically for generating long answers. Evaluation on four selected medical QA datasets demonstrates that KG-Rank achieves an improvement of over 18% in ROUGE-L score. Additionally, we extend KG-Rank to open domains, including law, business, music, and history, where it realizes a 14% improvement in ROUGE-L score, indicating the effectiveness and great potential of KG-Rank.
BibTeX
@inproceedings{yang2024kg,
  author = {Rui Yang and Haoran Liu and Edison Marrese-Taylor and Qingcheng Zeng and Yu He Ke and Wanxin Li and Lechao Cheng and Qingyu Chen and James Caverlee and Yutaka Matsuo and Irene Li},
  title = {{KG-Rank: Enhancing Large Language Models for Medical QA with Knowledge Graphs and Ranking Techniques}},
  booktitle = {BioNLP @ ACL},
  year = {2024},
  doi = {10.18653/v1/2024.bionlp-1.13},
}
Figure