Understanding contraceptive switching rationales from real world clinical notes using large language models
Understanding reasons for treatment switching is of significant medical interest, but these factors are often only found in unstructured clinical notes and can be difficult to extract. We evaluated the zero-shot abilities of GPT-4 and eight other open-source large language models (LLMs) to extract contraceptive switching information from 1964 clinical notes derived from the UCSF Information Commons dataset. GPT-4 extracted the contraceptives started and stopped at each switch with microF1 scores of 0.85 and 0.88, respectively, compared to 0.81 and 0.88 for the best open-source model. When evaluated by clinical experts, GPT-4 extracted reasons for switching with an accuracy of 91.4% (2.2% hallucination rate). Transformer-based topic modeling identified patient preference, adverse events, and insurance coverage as key reasons. These findings demonstrate the value of LLMs in identifying complex treatment factors and provide insights into reasons for contraceptive switching in real-world settings.
Authors
- Travis Ian Zack (ORCID: https://orcid.org/0000-0002-1620-6455)
- Brenda Y. Miao (ORCID: https://orcid.org/0000-0002-3393-9837)
- Atul J. Butte (ORCID: https://orcid.org/0000-0002-7433-2740)
- Emily Alsentzer (ORCID: https://orcid.org/0000-0002-5370-1746)
- Christopher Y. K. Williams (ORCID: https://orcid.org/0000-0001-8867-1623)
- Irene Y. Chen (ORCID: https://orcid.org/0000-0001-5202-2111)
- Ebenezer Chinedu-Eneh
Institutions
- Brigham and Women's Hospital (US)
- Executive Office of the President (US)
- Harvard University (US)
- University of California, San Francisco (US)
- UCSF Helen Diller Family Comprehensive Cancer Center (US)
- University of California, Berkeley (US)
Publication Details
- Journal
- npj Digital Medicine
- Published
- 2025-04-23
- DOI
- https://doi.org/10.1038/s41746-025-01615-0
- Citations
- 1
- Primary Topic
- Reproductive Health and Contraception
- Type
- article
- Field-Weighted Citation Impact
- 1.88
Funders
- National Institutes of Health
- University of California, San Francisco
- National Center for Advancing Translational Sciences