TL;DR
This study compares the effectiveness of large language models (LLMs) like LLaMA2 and LLaMA3 against a traditional rule-based system (BioMedICUS) for extracting patient symptoms from clinical notes related to COVID-19 and its long-term effects (PASC). While BioMedICUS generally performed better, LLMs showed promise in specific areas, particularly in identifying negative symptom mentions, highlighting the ongoing evolution and potential of LLMs in clinical NLP.
What Problem Does This Paper Address?
Extracting accurate patient symptom information from unstructured clinical notes is crucial for diagnosis and disease management. Traditional methods, while effective, can be labor-intensive and struggle with the nuances of natural language. Large Language Models (LLMs) offer a promising alternative, capable of understanding complex linguistic structures and potentially automating this extraction process more efficiently. However, their performance and reliability in real-world clinical settings, especially concerning fairness across demographics and generalizability to different datasets, remain areas of active investigation. This paper aims to bridge this gap by directly comparing LLMs against a well-established rule-based system for a critical clinical task: symptom extraction for COVID-19 and PASC.
Methods
The researchers fine-tuned two LLMs, LLaMA2-13B and LLaMA3-8B, for symptom classification. This involved adapting the models to recognize symptoms as "present," "negated," or "absent" within clinical notes. They employed a parameter-efficient fine-tuning technique, focusing on modifying the final layers of the LLMs to retain general language understanding while specializing them for the clinical task.
The performance of these fine-tuned LLMs was then compared against BioMedICUS, a rule-based information extraction system that leverages the Unified Medical Language System (UMLS). The comparison was conducted using three distinct corpora of clinical notes: UMN COVID, UMN PASC, and N3C COVID. Key evaluation metrics included macro-averaged recall, precision, and F1-scores. Additionally, the study performed prevalence and keyword analyses to understand symptom distribution and TF-IDF (Term Frequency-Inverse Document Frequency) to identify important keywords. Fairness analysis was conducted to assess model performance across different demographic groups (race and gender). An error analysis was also performed to identify specific challenges and failure modes for both LLMs and BioMedICUS.
Datasets
The study utilized three corpora of ground truth labeled clinical notes:
- UMN COVID: A corpus of emergency department (ED) visit notes for patients diagnosed with acute COVID-19.
- UMN PASC: A corpus of ED and outpatient (OP) visits for patients diagnosed with acute COVID-19, focusing on post-acute sequelae.
- N3C COVID: A fully de-identified corpus of notes for patients diagnosed with acute COVID-19, provided by the Mayo Clinic.
These corpora were used for both fine-tuning the LLMs and for evaluating their performance against BioMedICUS.
Key Insights and Ideas
- LLMs are not a silver bullet (yet): While LLMs show promise, they didn't universally outperform the established rule-based system (BioMedICUS) in this clinical symptom extraction task. This suggests that traditional methods still hold significant value, especially in well-defined domains.
- LLMs excel at nuance, but need careful training: LLMs demonstrated a particular strength in identifying negative symptom mentions, suggesting their advanced language understanding can capture subtle negations that rule-based systems might miss. However, this capability is highly dependent on the quality and diversity of the training data.
- Data diversity is paramount for fairness and generalizability: The study highlighted significant challenges with demographic fairness and generalizability for the LLMs, particularly LLaMA2-13B. This was attributed to potential overfitting from training on a non-diverse dataset (primarily UMN PASC) and single-annotator bias, underscoring the critical need for diverse, high-quality datasets and robust annotation processes.
- Context matters, and so does format: The study noted that the structure of clinical notes (e.g., RTF format with section headers) can significantly impact performance, especially for rule-based systems. LLMs, while more flexible, can also struggle with misinterpreting context or section headers if not explicitly trained to handle them.
- Fine-tuning significantly improves LLM output: The fine-tuned LLMs produced structured, consistent outputs, eliminating the need for extensive post-processing, unlike their un-fine-tuned counterparts which generated variable free-text outputs.
Key Results
- BioMedICUS generally outperformed LLMs: In most cases, BioMedICUS achieved higher F1-scores for both positive and negative symptom mentions across the UMN PASC and N3C COVID datasets. For example, on the UMN PASC dataset, BioMedICUS achieved a macro-averaged F1-score of 0.70 for positive mentions, compared to 0.66 for LLaMA2-13B and 0.62 for LLaMA3-8B.
- LLMs showed specific strengths: LLaMA2-13B excelled in classifying "chest pain/palpitations" and "changes in sleep" on the UMN PASC dataset. LLaMA3-8B demonstrated superior performance in detecting negative symptom mentions across many categories, outperforming both BioMedICUS and LLaMA2-13B.
- Fairness challenges for LLMs: BioMedICUS consistently outperformed the LLMs in fairness across gender and racial groups. LLaMA2-13B, in particular, showed lower recall, precision, and F1-scores across demographics.
- Un-fine-tuned LLMs were impractical: The un-fine-tuned LLaMA2-13B model produced highly variable outputs, requiring extensive parsing and post-processing, making it impractical for direct clinical deployment. Fine-tuning dramatically improved output structure and reliability.
Limitations and Future Work
- Small and non-diverse dataset: The LLMs were fine-tuned on a relatively small and non-diverse dataset (primarily UMN PASC), which may have contributed to overfitting and limited generalizability to other datasets like N3C COVID.
- Single annotator bias: The use of a single annotator for parts of the training data (UMN COVID) introduced potential bias and limited the robustness of the ground truth labels.
- Demographic fairness: The LLaMA models, especially LLaMA2-13B, struggled with equity across different patient populations, highlighting the challenge of ensuring fairness in machine learning models trained on imbalanced datasets.
- Handling negations and context: While improved in LLaMA3-8B, handling negations and complex contextual nuances remained a challenge for both LLMs and rule-based systems.
- Absence of structured headers: The lack of structured section headers in some clinical notes hindered symptom detection, particularly for BioMedICUS.
- Incomplete lexica: The lexica used in the study might be incomplete, potentially leading to an increase in false negatives.
- Note length: Very large clinical notes might require chunking, slowing down processing.
Future work should focus on developing diverse, high-quality training datasets and robust annotation processes to mitigate bias and enhance LLM generalizability. Further research into improving LLMs' ability to handle negations and contextual nuances, as well as integrating them with structured data and text formatting features, is also recommended. The study suggests that LLMs have the potential to advance clinical NLP across various medical domains, but careful consideration of bias and generalizability is crucial for each new application.
Summary updated