Abstract
The rapidly growing collection of clinical free text data in oncology provides an unprecedented opportunity to harness rich, real-world insights for advancing cancer research and treatment. However, efficiently extracting, standardizing, and structuring this vast and unstructured information remains a formidable challenge. We present mCodeGPT, a state-of-the-art data standardization tool designed for cancer-related clinical notes. mCodeGPT ingests a cancer ontology knowledge base and automatically generates hierarchical prompts to extract information following the minimal Common Oncology Data Elements (mCODE™) structure. The pipeline is entirely zero-shot, requiring no manual annotation or model training. Our evaluation, using a diverse set of 400 simulated clinical notes, demonstrates that mCodeGPT achieves an impressive 96% accuracy in information extraction. This tool simplifies the labor-intensive process of data collection and overcomes common LLM limitations such as token size constraints and hallucinations.
Introduction
In the field of oncology, approximately 80% of patient data is "trapped" in unstructured formats like physician narratives, radiology reports, and pathology findings. While this text is rich with clinical insights, manually extracting and standardizing it into structured databases is a massive bottleneck for research. Existing Natural Language Processing (NLP) tools often rely on rigid, rule-based systems or require thousands of human-annotated examples for training. Furthermore, general-purpose Large Language Model (LLM) tools like OntoGPT often struggle with the complexity of medical ontologies, frequently hitting token limits or suffering from "hallucinations"—where the model generates incorrect medical facts not present in the source text.
Methods
mCodeGPT automates the extraction process by following the minimal Common Oncology Data Elements (mCODE™) structure. The core innovation lies in representing the medical ontology as a Directed Acyclic Graph (DAG) to generate structured prompts.
To bypass token limits and improve accuracy, the researchers developed three hierarchical algorithms for prompt engineering:
- Root-to-Leaf Streamliner (RLS): Generates a single prompt for each "leaf" node by including its entire lineage (e.g., "If the patient has a tumor, what is the measurement method?").
- Breadth-First Ontology Pruner (BFOP): A layer-wise approach that first asks if a high-level category (like "Human Specimen") exists. If the answer is "No," it prunes the graph and skips all sub-questions, preventing the model from hallucinating details for non-existent entities.
- Two-Phase Ontology Parser (2POP): This "screen-then-extract" method first asks binary (Yes/No) questions about the existence of all leaf nodes. In the second phase, it only performs detailed extraction for the entities confirmed in phase one.
Datasets and Evaluation
Because real-world clinical notes are sensitive and difficult to share, the researchers used GPT-3.5-turbo to generate a high-quality synthetic dataset of 400 simulated clinical notes. These notes covered a wide spectrum of cancer categories, including skin, kidney, breast, blood, and pediatric cancers, providing a reliable "ground truth" to measure extraction accuracy across diverse medical scenarios.
Key Results
- Top Performance: The 2POP method consistently outperformed others, achieving a peak accuracy of 95.6% using GPT-3.5-turbo-16k and 95.0% with GPT-4-32k.
- Open-Source vs. Proprietary: While OpenAI's models were the most accurate, open-source models like Orca-mini-13b and Llama-2-7b-chat performed admirably, reaching over 92% accuracy with the 2POP method.
- Efficiency: GPT-3.5-turbo was the fastest, processing the entire dataset in under 1.5 hours. In contrast, some open-source models required up to 80 hours on local hardware.
- Hallucination Rates: Across the board, hallucination rates were remarkably low, staying under 2% for most model-method pairings.
- Impact of Abbreviations: A primary limitation identified was the use of medical abbreviations. Replacing full terms with common abbreviations (e.g., "Dx" for Diagnosis) caused accuracy to drop by 11% to 20%, though GPT-4 handled this better than smaller models.
Conclusion and Future Work
mCodeGPT proves that zero-shot frameworks powered by hierarchical prompting can effectively standardize complex medical data without the need for manual labeling. This approach significantly reduces the time and labor required to build high-performing medical extraction tools. Future iterations of mCodeGPT could benefit from multimodal integration—incorporating radiology images and pathology slides alongside text—and the automated generation of new ontologies for medical specialties beyond oncology.
Summary updated