A Machine Learning Approach for Emergency Detection in Medical Scenarios Using Large Language Models
Authors:
Preprint
Abstract
The rapid identification of medical emergencies through digital communication channels remains a critical challenge in modern healthcare delivery, particularly with the increasing prevalence of telemedicine. This paper presents a novel approach leveraging large language models (LLMs) and prompt engineering techniques for automated emergency detection in medical communications. We developed and evaluated a comprehensive system using multiple LLaMA model variants (1B, 3B, and 7B parameters) to classify medical scenarios as emergency or non-emergency situations. Our methodology incorporated both system prompts and in-prompt training approaches, evaluated across different hardware configurations. The results demonstrate exceptional performance, with the LLaMA 2 (7B) model achieving 99.7% accuracy and the LLaMA 3.2 (3B) model reaching 99.6% accuracy with optimal prompt engineering. Through systematic testing of training examples within the prompts, we identified that including 10 example scenarios in the model prompts yielded optimal classification performance. Processing speeds varied significantly between platforms, ranging from 0.05 to 2.2 seconds per request. The system showed particular strength in minimizing high-risk false negatives in emergency scenarios, which is crucial for patient safety. The code implementation and evaluation framework are publicly available on GitHub, facilitating further research and development in this crucial area of healthcare technology.Keywords
All Related Versions
This publication has 8 references indexed in Scilit:
- A survey of large language models for healthcare: from data, technology, and applications to accountability and ethicsInformation Fusion, 2025
- Benchmarking Large Language Models in Evidence-Based MedicineIEEE Journal of Biomedical and Health Informatics, 2024
- A Semantic Controllable Long Text Steganography Framework Based on LLM Prompt Engineering and Knowledge GraphIEEE Signal Processing Letters, 2024
- Towards Reliable Healthcare LLM Agents: A Case Study for Pilgrims during HajjInformation, 2024
- The Role of Large Language Models in Transforming Emergency Medicine: Scoping ReviewJMIR Medical Informatics, 2024
- Rationalism in the face of GPT hypes: Benchmarking the output of large language models against human expert-curated biomedical knowledge graphsArtificial Intelligence in the Life Sciences, 2024
- Early detection of emergency events from social media: a new text clustering approachNatural Hazards, 2022
- Deep ensemble multitask classification of emergency medical call incidents combining multimodal data improves emergency medical dispatchArtificial Intelligence in Medicine, 2021