TL;DR
This paper introduces ELM, a novel hybrid system that combines smaller language models with a large language model (LLM) to automate the classification of tumor groups from unstructured pathology reports. ELM achieves state-of-the-art accuracy and significantly reduces manual review time, making it a practical solution for cancer registries.
What Problem Does This Paper Address?
Population-based cancer registries (PBCRs) are essential for tracking cancer incidence, guiding research, and informing public health initiatives. A critical step in their workflow is extracting structured data from unstructured pathology reports. Manually classifying these reports into tumor groups is a labor-intensive process, consuming a significant amount of time (estimated at 900 person-hours annually for a medium-sized registry processing 100,000 reports). Existing automated rule-based systems struggle with the inherent linguistic complexity, ambiguity, and variability of clinical text, leading to high error rates and continued reliance on manual review. This bottleneck hinders the efficiency and scalability of cancer surveillance.
Methods
The core of ELM is a hybrid architecture that strategically combines the strengths of different language model types. It leverages:
- Ensemble of Small Language Models (SLMs): Six fine-tuned encoder-only language models are used. To maximize coverage of the pathology report, three models process the first 512 tokens (typically the "Final Diagnosis" section), and the other three process the last 512 tokens (often containing interpretations and comments). This approach aims to capture crucial diagnostic information regardless of its location in the report.
- Ensemble Decision Logic: A majority vote from the six SLMs is used for classification. If at least five models agree, their prediction is accepted. This ensures confident predictions for straightforward cases.
- LLM Arbitration: For cases where the SLM ensemble has low agreement (fewer than five models agree) or for historically challenging tumor groups, a large language model (LLM) is employed for arbitration. The LLM receives the pathology report and a carefully crafted prompt that constrains its output to a small set of likely tumor groups, informed by the SLM predictions and domain expert knowledge. This controlled approach aims to improve accuracy and reduce hallucination.
Datasets
The study utilized data from the British Columbia Cancer Registry (BCCR).
- Training Data: 16,000 post-eMaRC reportable pathology reports from 2020, labeled with one of 19 tumor groups. Labels were assigned at the patient level, which introduces some noise but is deemed acceptable due to the robustness of transformer models and the large dataset size.
- Test Data: A held-out test set of 2,058 pathology reports randomly selected from 2023-2024 data. These reports were individually labeled by expert cancer registrars at the report level for unbiased evaluation and were unseen during model training.
Key Insights and Ideas
- Hybrid Approach is Key: Combining the efficiency of smaller models with the nuanced understanding of LLMs is crucial for achieving both high accuracy and operational efficiency. A pure LLM approach, while powerful, is computationally expensive and can be less accurate without the guiding structure provided by the ensemble.
- Maximizing Report Coverage: Splitting reports into top and bottom segments for different SLMs is an effective strategy to overcome token limitations and ensure that critical diagnostic information, which might be located at the beginning or end of a report, is captured.
- Controlled LLM Arbitration: The success of the LLM arbitration hinges on carefully engineered prompts that constrain its output. This prevents the LLM from "wandering" and ensures its predictions are grounded in the context of the pathology report and the ensemble's initial assessment.
- Domain Expertise Integration: Explicitly routing known "hard-to-classify" tumor groups to the LLM, based on domain expert input, significantly boosts performance for these challenging categories.
Key Results
- Overall Performance: ELM achieved a weighted average precision, recall, and F1-score of 0.94 across 19 tumor groups on the held-out test set.
- Superiority over Baselines: ELM significantly outperformed:
- eMaRC (rule-based): F1 of 0.64
- Single encoder-only models (average): F1 of 0.87
- Encoder-only ensemble (without LLM arbitration): F1 of 0.91
- LLM-only (Mistral Nemo with broad prompt): F1 of 0.88
- Impact of LLM Arbitration: LLM arbitration provided a statistically significant improvement, increasing the F1-score from 0.91 (encoder-only ensemble) to 0.94.
- Operational Impact: Deployed at BCCR, ELM reduced manual review requirements by 60-70%, saving an estimated 900 person-hours annually while maintaining data quality standards.
- Performance on Challenging Groups: ELM showed notable improvements for categories like leukemia (F1: 0.76 to 0.88), lymphoma (0.76 to 0.89), and non-melanoma skin cancer (0.58 to 0.74).
Limitations and Future Work
- Data Limitations: The study's data is exclusively from BCCR. External validation on data from other registries is needed to assess generalizability across different regions and healthcare systems. Performance on non-English reports is also unknown.
- Continuous Monitoring: Like all ML systems, ELM requires ongoing monitoring for data drift and periodic retraining.
- Computational Resources: While more efficient than LLM-only approaches, ELM still requires substantial computational resources (GPUs), which might be a barrier for smaller registries.
- Rare Tumor Types: Performance remains suboptimal for very rare tumor types and inherently ambiguous categories, where human expertise may still be necessary.
- Black Box Nature: The encoder-only ensemble operates as a relative black box, and for cases contradicting registrar expectations, manual review of the original report is still required.
Future Work:
- Multi-registry validation.
- Developing multi-label classification architectures for cases with multiple synchronous primaries.
- Implementing active learning to improve performance on rare tumor types.
- Exploring advanced prompting strategies for LLM arbitration.
- Investigating smaller LLMs for improved cost-performance trade-offs.
- Developing visualization tools to help registrars understand model predictions.
Summary updated