MedKP: Medical Dialogue with Knowledge Enhancement and Clinical Pathway Encoding

Jiageng Wu, Xian Wu, Yefeng Zheng, Jie YangarXiv 2024 · DOI

Introduction

Large Language Models (LLMs) have demonstrated remarkable capabilities in general-purpose natural language tasks and have even shown promise in specialized domains like medicine. However, their deployment in real-world clinical consultations remains fraught with challenges. Two primary obstacles are the tendency for models to "hallucinate"—generating factually incorrect but plausible-sounding medical advice—and the "black box" nature of their reasoning, which often lacks the structured procedural logic used by human physicians.

To address these issues, the MedKP (Medical Knowledge and Pathway) framework was developed. MedKP aims to ground LLM responses in both external medical knowledge and internal clinical pathways, ensuring that AI-driven consultations are both factually accurate and procedurally sound.

The MedKP Framework

The core innovation of MedKP lies in its dual-module approach to enhancing LLM inputs. Rather than relying solely on the model's internal weights, MedKP explicitly provides context through external knowledge retrieval and clinical action recognition.

The MedKP framework architecture, illustrating the flow from dialogue to entity identification, knowledge enhancement, and clinical pathway encoding.

External Knowledge Enhancement

In this module, the system identifies medical entities such as symptoms, diseases, and medications within the ongoing dialogue. It then queries a large-scale Medical Knowledge Graph (CMEKG) to retrieve relevant triplets. Crucially, the system does not just look for direct matches; it also identifies "potential knowledge"—related concepts that are clinically relevant but have not yet been mentioned. This provides the model with a broader medical context, reducing the likelihood of hallucinations by grounding the generation process in verified facts.

Internal Clinical Pathway Encoding

This module serves as the framework's "procedural memory." Using the SOAP (Subjective, Objective, Assessment, and Plan) framework, the researchers categorized physician responses into seven distinct actions: Chitchat, Inform, Inquire, Provide Daily Precaution, State a Required Medical Test, Make a Diagnosis, and Prescribe Medications. By predicting the appropriate physician action and the relevant medical entities before generating the final response, the model is forced to follow a logical clinical progression. This prevents the AI from jumping to premature diagnoses and ensures the conversation feels professional and coherent.

The entire system is integrated into a ChatGLM3-6B model and fine-tuned using Low-Rank Adaptation (LoRA), allowing for high-performance adaptation without the computational cost of full-parameter retraining.

Experimental Evaluation

The researchers evaluated MedKP on two significant datasets:

  1. MedDG: A dataset containing approximately 17,000 dialogues focused on gastrointestinal diseases, providing a high-quality, annotated environment for testing medical entity recognition.
  2. KaMed: A larger, more diverse dataset with 29,000 dialogues across over 100 hospital departments, representing the noise and complexity of real-world medical consultations.

Results and Discussion

MedKP achieved state-of-the-art (SOTA) performance across a variety of metrics, significantly outperforming both traditional deep learning models and other LLM-based approaches.

Performance comparison of MedKP against various baselines on the MedDG dataset, showing significant improvements in entity accuracy and LLM-judge scores.

Key Findings:

  • Improved Entity Accuracy: On the MedDG dataset, MedKP achieved a Macro-F1 score of 31.41 for medical entities, a dramatic increase from the 12.41 achieved by direct inference. This indicates that the knowledge enhancement module successfully helps the model identify and utilize correct medical terminology.
  • Reduction in Hallucinations: Using an "LLM-as-a-judge" framework (utilizing GPT-4), the researchers measured hallucination (H) and consistency (C). MedKP reduced the hallucination score to 1.03 (where lower is better), compared to 2.60 for the base model.
  • Enhanced Clinical Consistency: The consistency score improved from 3.49 to 6.10, suggesting that the clinical pathway encoding successfully guided the model to produce responses that align with standard medical procedures.
  • Ablation Insights: Ablation studies confirmed that while the Knowledge Graph (+KG) was vital for factual accuracy, the Clinical Pathway (+CP) was the primary driver in ensuring the dialogue followed a logical and professional structure.

Conclusion and Future Work

MedKP represents a significant step toward making AI-driven medical consultations safer and more reliable. By explicitly encoding clinical pathways and external knowledge, the framework mitigates the risks of hallucinations and provides a more transparent reasoning process.

Future work will focus on testing the framework with larger models and incorporating human-in-the-loop evaluations where practicing physicians can grade the clinical safety of the responses. The ultimate goal is to develop MedKP into a real-time assistant for junior doctors, helping to prevent misdiagnosis and improve patient outcomes.

Summary updated

BibTeX
@misc{wu2024medkp,
  author = {Jiageng Wu and Xian Wu and Yefeng Zheng and Jie Yang},
  title = {{MedKP: Medical Dialogue with Knowledge Enhancement and Clinical Pathway Encoding}},
  year = {2024},
  eprint = {2403.06611},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.06611},
}
Figure