Automated Insomnia Phenotyping from Electronic Health Records: Leveraging Large Language Models to Decode Clinical
Guillermo Lopez-Garcia1, Davy Weissenbacher1, Matthew Stadler2
1Department of Computational Biomedicine, Cedars-Sinai Medical Center, West Hollywood, CA.
Medrxiv : the Preprint Server for Health Sciences
|June 12, 2025
Summary
This study introduces an automated method using large language models (LLMs) to identify insomnia from clinical notes. This approach improves the documentation of insomnia in electronic health records (EHRs) for better research.
Area of Science:
- Medical Informatics
- Natural Language Processing
- Clinical Research
Background:
- Insomnia is common but frequently underdiagnosed.
- Inconsistent electronic health record (EHR) documentation hinders insomnia research.
- Accurate phenotyping is crucial for understanding treatment patterns and outcomes.
Purpose of the Study:
- To develop and evaluate an automated system for insomnia phenotyping using generative large language models (LLMs).
- To improve the identification and documentation of insomnia within unstructured clinical notes.
- To establish a scalable framework for clinical phenotyping of underdiagnosed conditions.
Main Methods:
- Utilized generative large language models (LLMs), specifically Llama 70B and Llama 405B.
- Employed prompt engineering with few-shot learning and chain-of-thought reasoning.
- Evaluated the system on two diverse corpora: MIMIC-III (inpatient) and University of Kansas Health System (KUMC) (outpatient) clinical notes.
Main Results:
- Achieved high F1 scores: 93.0 on the MIMIC corpus and 85.7 on the KUMC corpus.
- Demonstrated superior performance compared to domain-adapted BERT-based classifiers.
- Successfully phenotyped insomnia directly from unstructured clinical text.
Conclusions:
- The developed LLM-based framework provides a scalable and interpretable solution for clinical insomnia phenotyping.
- This approach can enhance the analysis of insomnia prevalence, treatment, and outcomes.
- The methodology serves as a model for phenotyping other underdiagnosed conditions in EHRs.
Related Concept Videos
Management of Insomnia
235
The sleep cycle, an integral part of human health, consists of several stages with distinct characteristics and functions. It begins with a transition from wakefulness to sleep, known as the light sleep phase, followed by the restorative deep sleep phase, essential for physical recovery and growth. The cycle concludes with the Rapid Eye Movement (REM) phase, characterized by high brain activity and vivid dreaming. Insomnia, a prevalent sleep disorder, involves difficulty falling asleep, staying...
235
Insomnia
79
Insomnia is a prevalent sleep disorder characterized by difficulty falling asleep, frequent awakenings during the night, and waking up too early without being able to return to sleep. People with insomnia often experience these disruptions at least three nights a week for at least one month. Chronic insomnia, which lasts for at least three months, can lead to increased anxiety, which in turn can worsen sleep difficulties, creating a cycle of sleeplessness and stress.
Multiple factors contribute...
Multiple factors contribute...
79
Narcolepsy
94
Narcolepsy is a chronic sleep disorder characterized by pervasive, uncontrolled sleepiness and other sleep disturbances. One of its hallmark symptoms is an abrupt transition to REM sleep upon falling asleep, which causes symptoms typically associated with this phase to occur unexpectedly during wakefulness. These include the following symptoms, which typically last from a minute or two to half an hour.
94
Sedatives and Hypnotics Drugs: Miscellaneous Agents
157
Sedatives and hypnotics encompass a wide range of substances, each with its unique mechanism of action, uses, and potential adverse effects.
Melatonin congeners like ramelteon (Rozerem) and tasimelteon (Hetlioz) selectively bind to melatonin receptors (MT1 and MT2) and thus mimic the actions of melatonin, a hormone that regulates sleep-wake cycles. Tasimelteon is primarily used for non-24-hour sleep-wake disorder, common in blind patients. They are also used to treat conditions like insomnia...
Melatonin congeners like ramelteon (Rozerem) and tasimelteon (Hetlioz) selectively bind to melatonin receptors (MT1 and MT2) and thus mimic the actions of melatonin, a hormone that regulates sleep-wake cycles. Tasimelteon is primarily used for non-24-hour sleep-wake disorder, common in blind patients. They are also used to treat conditions like insomnia...
157


