Introducing mCODEGPT as a zero-shot information extraction from clinical free text data tool for cancer research

Kai Zhang, Tongtong Huang, Bradley Malin, Travis Osterman, Qi Long, Xiaoqian JiangCommunications 2025

Abstract: Our approach demonstrates that LLMs, when guided by structured prompting, can accurately extract complex clinical information without the need for expert-labeled data. This method has the potential to harness unstructured data for advancing cancer research.

Introduction

Nearly 80% of electronic health record (EHR) data is currently locked away in unstructured free text, such as physician notes and pathology reports. For cancer research, converting this text into structured, standardized formats—specifically the minimal Common Oncology Data Elements (mCODE) framework—is crucial for interoperability and personalized medicine.

Traditionally, this requires Named Entity Recognition (NER) models that rely on massive, human-annotated datasets. These models are expensive to train and struggle to generalize to new contexts. While Large Language Models (LLMs) offer a "zero-shot" alternative, existing tools often use static, single-step prompts. When faced with complex, hierarchical medical ontologies, these approaches frequently miss data or "hallucinate" details not present in the source text. This paper introduces mCODEGPT, a tool designed to overcome these hurdles using novel hierarchical prompting strategies.

Methodology

The authors represent the mCODE ontology as a Directed Acyclic Graph (DAG) and introduce two dynamic prompt engineering strategies to replace standard baselines:

  1. BFOP (Breadth-First Ontology Pruner): A top-down, layer-wise approach. The LLM is first asked if a parent category (e.g., "tumor") is present. If the model says no, the algorithm prunes the graph, skipping all queries for child nodes (e.g., "tumor size").
  2. 2POP (Two-Phase Ontology Parser): A two-step approach focused on leaf nodes. In Phase 1, the LLM answers simple Yes/No questions about the presence of specific leaf nodes. In Phase 2, the LLM extracts values only for the nodes confirmed in Phase 1.
The mCODEGPT workflow illustrating the BFOP and 2POP algorithmic paths for structured information extraction.

By forcing the LLM to verify the presence of information before attempting to extract it, both methods aim to reduce cognitive load and prevent hallucinations.

Experimental Setup

To bypass strict privacy regulations, the researchers generated 1,000 synthetic oncology clinical notes using GPT-3.5. These notes simulated authentic clinical narratives across various cancer types, covering 49 named entities from the mCODE ontology, including demographics, disease details, and genomic variants.

Key Results and Discussion

The experimental results demonstrated that structured prompting significantly outperforms traditional single-step baselines. GPT-4o combined with the 2POP method achieved the highest overall accuracy at 93.9%, with a hallucination rate of just 1.1%.

Performance metrics across the 49 mCODE entities, highlighting high accuracy in demographics and challenges in specific genomic fields.

Key Insights:

  • Pruning as a Guardrail: Asking an LLM "What is the tumor size?" when no tumor is mentioned often forces the model to guess. The "presence-check" acts as a highly effective guardrail against these hallucinations.
  • 2POP Robustness: 2POP generally outperformed BFOP. BFOP's top-down approach is fragile; if the LLM misses a parent node due to non-standard phrasing (e.g., using "neoplasm" instead of "tumor"), it automatically skips all child nodes. 2POP avoids this cascading failure by checking leaf nodes directly.
  • Domain-Specific Challenges: While LLMs are near-perfect at extracting demographic data, they struggle with highly specific genomic data. For example, models frequently confused "genomic variant studied gene" with "genomic region studied," highlighting the limits of zero-shot capabilities on specialized jargon.

Conclusion and Future Work

mCODEGPT demonstrates that LLMs can be effectively harnessed for clinical information extraction without the need for expensive manual labeling. Future work will focus on expanding the tool to cover a broader spectrum of mCODE entities and exploring the fine-tuning of open-source LLMs to handle diverse, real-world terminologies while keeping patient data strictly local.

Summary updated

BibTeX
@inproceedings{zhang2025introducing,
  author = {Kai Zhang and Tongtong Huang and Bradley Malin and Travis Osterman and Qi Long and Xiaoqian Jiang},
  title = {{Introducing mCODEGPT as a zero-shot information extraction from clinical free text data tool for cancer research}},
  booktitle = {Communications},
  year = {2025},
  doi = {10.1038/s43856-025-01116-x},
}
Figure