Surpassing GPT-4 Medical Coding with a Two-Stage Approach

Zhichao Yang, Sanjit Singh Batra, Joel Stremmel, Eran HalperinarXiv 2023 · OpenReview

TL;DR

This paper introduces LLM-codex, a novel two-stage approach to improve medical coding accuracy and explainability. It leverages a large language model (LLM) for initial code prediction and evidence extraction, followed by an LSTM-based verifier to refine predictions and ensure sentence-level evidence, outperforming existing methods, especially with limited data and for rare codes.

What Problem Does This Paper Address?

Accurately assigning International Classification of Diseases (ICD) codes to clinical text is crucial for healthcare but challenging due to the scarcity of labeled data, the need for high precision and recall across all codes (including rare ones), and the demand for explainability (i.e., identifying the specific text supporting a code assignment). While recent LLMs like GPT-4 show promise, they often suffer from low precision in this task. Existing methods struggle to simultaneously address all these challenges, particularly providing reliable, human-annotated-free evidence.

Methods

The proposed LLM-codex is a two-stage system:

  • Stage 1: LLM-based Prediction and Evidence Extraction:
    • The input EHR document is segmented into smaller parts to handle long contexts.
  • An LLM (specifically GPT-4) is used with in-context learning (ICL) to predict ICD codes and extract potential sentence-level evidence for each predicted code. This stage aims for high recall.
  • Stage 2: LSTM-based Verification:
    • An LSTM-based "Verifier" model is introduced to refine the LLM's predictions.
  • This Verifier is trained using a custom loss function that leverages both the LLM's high-recall "silver labels" (predicted ICD codes and their associated sentences) and the high-precision "gold labels" (expert-assigned ICD codes).
  • The Verifier learns to score sentences based on their relevance to predicted ICD codes, effectively filtering out incorrect predictions and improving precision.

Datasets

The study utilizes the following datasets:

  • MIMIC-III common: A standard dataset of ICU discharge summaries with expert-assigned ICD codes. The authors filtered it to include instances with at least one of the top 50 most frequent ICD codes.
  • MIMIC-III few-shot: A subset of MIMIC-III created by randomly selecting approximately one-eighth of the instances, designed to evaluate performance under limited training data conditions.
  • MIMIC-III rare: A dataset specifically curated to assess performance on predicting rare disease codes, built using rare diseases defined by medical experts.
  • MDACE Profee: A dataset used for evaluating the model's explainability. It contains ICD code evidence annotations where expert annotators labeled short text spans as evidence for assigned ICD codes. This dataset was derived from MIMIC-III annotations made under professional fee billing guidelines.

Key Insights and Ideas

  • LLMs struggle with precision in medical coding: Despite their impressive capabilities, LLMs like GPT-4 tend to over-predict ICD codes, leading to high recall but low precision.
  • A two-stage approach is effective: Combining an LLM for broad prediction and evidence generation with a specialized verifier for refinement significantly improves overall performance.
  • Leveraging dual labels is key: The Verifier model's ability to learn from both the LLM's high-recall silver labels and expert-assigned gold labels is crucial for its success.
  • Explainability without human annotation: LLM-codex can provide sentence-level evidence for its coding decisions without requiring explicit human annotation of evidence during training, reducing annotation costs.
  • Robustness to data scarcity: The proposed method demonstrates strong performance even with limited training data, making it valuable in real-world clinical settings where data is often scarce.

Key Results

  • State-of-the-art performance: LLM-codex achieves state-of-the-art results on medical coding accuracy, accuracy on rare codes, and sentence-level evidence identification.
  • Improved F1 score: It shows a substantial improvement of over 10% in F1 score for rare codes compared to existing models.
  • Few-shot learning advantage: LLM-codex exhibits about a 5% increase in F1 score on limited training data.
  • Evidence accuracy: It boosts evidence accuracy by over 10% compared to top-performing sentence-level evidence models, without needing human-annotated evidence.
  • Segmentation benefits GPT-4: Segmenting long EHRs into smaller parts significantly improved GPT-4's recall, though LLM-codex still outperformed it in F1 score.
  • Verifier's importance: Ablation studies showed that removing the Verifier model led to a significant drop in F1 score, highlighting its critical role.

Limitations and Future Work

  • Single evidence sentence constraint: LLM-codex currently generates only one sentence-level evidence per predicted ICD code. For cases where multiple sentences are needed for comprehensive evidence, GPT-4 with segmentation might perform better in recall (though not necessarily F1). Future work could explore increasing the number of evidence sentences returned by the Verifier.
  • Long sentence challenges: Case studies indicated that LLM-codex (and GPT-4) can sometimes overlook codes in very long sentences, potentially due to the presence of numerous medical keywords that can mislead the model.
  • Reliance on GPT-4: The current implementation requires GPT-4, which can be costly. Future work could involve distilling GPT-4's capabilities into smaller, more efficient LLMs.
  • Potential for over-prediction of V-codes: The model showed a tendency to assign ICD V-codes excessively, which might be partly due to under-labeling of these codes in the ground truth data.
  • Extending to other tasks: The authors believe the versatile two-stage approach has potential for other classification tasks requiring explanations, beyond medical coding.

Summary updated

Abstract

Recent advances in large language models (LLMs) show potential for clinical applications, such as clinical decision support and trial recommendations. However, the GPT-4 LLM predicts an excessive number of ICD codes for medical coding tasks, leading to high recall but low precision. To tackle this challenge, we introduce LLM-codex, a two-stage approach to predict ICD codes that first generates evidence proposals using an LLM and then employs an LSTM-based verification stage. The LSTM learns from both the LLM's high recall and human expert's high precision, using a custom loss function. Our model is the only approach that simultaneously achieves state-of-the-art results in medical coding accuracy, accuracy on rare codes, and sentence-level evidence identification to support coding decisions without training on human-annotated evidence according to experiments on the MIMIC dataset.
BibTeX
@misc{yang2023surpassing,
  author = {Zhichao Yang and Sanjit Singh Batra and Joel Stremmel and Eran Halperin},
  title = {{Surpassing GPT-4 Medical Coding with a Two-Stage Approach}},
  year = {2023},
  eprint = {2311.13735},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.13735},
}
Figure